-
Notifications
You must be signed in to change notification settings - Fork 2
/
service.go
47 lines (38 loc) · 955 Bytes
/
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
package server
import (
"net/http"
"github.com/dpb587/ssoca/auth"
"github.com/dpb587/ssoca/server/service/req"
svc "github.com/dpb587/ssoca/service/uaaauth"
svcapi "github.com/dpb587/ssoca/service/uaaauth/api"
svcconfig "github.com/dpb587/ssoca/service/uaaauth/server/config"
)
type Service struct {
svc.ServiceType
name string
config svcconfig.Config
}
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 svcapi.Metadata{
URL: s.config.URL,
CACertificate: s.config.CACertificate,
ClientID: s.config.ClientID,
ClientSecret: s.config.ClientSecret,
Prompts: s.config.Prompts,
}
}
func (s Service) GetRoutes() []req.RouteHandler {
return nil
}
func (s Service) VerifyAuthorization(_ http.Request, _ *auth.Token) error {
return nil
}