Oc Auth x Hydra x LDAP : draft of claims enrich for traefik + draft of forwarding
This commit is contained in:
32
infrastructure/infrastructure.go
Normal file
32
infrastructure/infrastructure.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package infrastructure
|
||||
|
||||
import (
|
||||
"oc-auth/conf"
|
||||
auth_connectors "oc-auth/infrastructure/auth_connector"
|
||||
"oc-auth/infrastructure/claims"
|
||||
"oc-auth/infrastructure/perms_connectors"
|
||||
|
||||
"cloud.o-forge.io/core/oc-lib/tools"
|
||||
)
|
||||
|
||||
var t = map[string]claims.ClaimService{
|
||||
"hydra": claims.HydraClaims{},
|
||||
}
|
||||
|
||||
var a = map[string]auth_connectors.AuthConnector{
|
||||
"hydra": auth_connectors.HydraConnector{
|
||||
Caller: tools.NewHTTPCaller(map[tools.DataType]map[tools.METHOD]string{}),
|
||||
State: "12345678", ResponseType: "token", Scopes: "openid profile email roles"}, // base url
|
||||
}
|
||||
|
||||
func GetAuthConnector() auth_connectors.AuthConnector {
|
||||
return a[conf.GetConfig().Auth]
|
||||
}
|
||||
|
||||
func GetPermissionConnector() perms_connectors.PermConnector {
|
||||
return perms_connectors.GetPermissionConnector()
|
||||
}
|
||||
|
||||
func GetClaims() claims.ClaimService {
|
||||
return t[conf.GetConfig().Auth]
|
||||
}
|
||||
Reference in New Issue
Block a user