oc-auth/infrastructure/infrastructure.go

33 lines
849 B
Go
Raw Normal View History

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]
}