-
Notifications
You must be signed in to change notification settings - Fork 2
/
service.go
56 lines (46 loc) · 1.15 KB
/
service.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package server
import (
"net/http"
"github.com/dpb587/ssoca/auth"
"github.com/dpb587/ssoca/server/service"
"github.com/dpb587/ssoca/server/service/req"
svc "github.com/dpb587/ssoca/service/ssh"
svcconfig "github.com/dpb587/ssoca/service/ssh/server/config"
svcreq "github.com/dpb587/ssoca/service/ssh/server/req"
)
type Service struct {
svc.ServiceType
name string
config svcconfig.Config
}
var _ service.Service = Service{}
func NewService(name string, config svcconfig.Config) *Service {
return &Service{
name: name,
config: config,
}
}
func (s Service) Name() string {
return s.name
}
func (s Service) Metadata() interface{} {
return nil
}
func (s Service) GetRoutes() []req.RouteHandler {
return []req.RouteHandler{
svcreq.CAPublicKey{
CertAuth: s.config.CertAuth,
},
svcreq.SignPublicKey{
Validity: s.config.Validity,
Principals: s.config.Principals,
CriticalOptions: s.config.CriticalOptions,
Extensions: s.config.Extensions,
CertAuth: s.config.CertAuth,
Target: s.config.Target,
},
}
}
func (s Service) VerifyAuthorization(_ http.Request, _ *auth.Token) error {
return nil
}