Documentation ¶
Index ¶
- func GetCookieSecret() string
- func GetOauthClientID(service string) (string, error)
- func GetOauthSecret(service string) (string, error)
- type Service
- func (service *Service) AddRoutes(router *mux.Router)
- func (service *Service) FilterAuthorizedScopes(r *http.Request, username string, grantedTo string, requestedscopes []string) (authorizedScopes []string, err error)
- func (service *Service) FilterPossibleScopes(r *http.Request, username string, requestedScopes []string, ...) (possibleScopes []string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCookieSecret ¶
func GetCookieSecret() string
GetCookieSecret gets the cookie secret from mongodb if it exists otherwise, generate a new one and save it
func GetOauthClientID ¶
GetOauthClientID gets the oauth secret from mongodb for a specified service. If it doesn't exist, an error gets logged.
func GetOauthSecret ¶
GetOauthSecret gets the oauth secret from mongodb for a specified service. If it doesn't exist, an error gets logged.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the identityserver http service
func NewService ¶
func NewService(smsService communication.SMSService, emailService communication.EmailService) (service *Service)
NewService creates and initializes a Service
func (*Service) FilterAuthorizedScopes ¶
func (service *Service) FilterAuthorizedScopes(r *http.Request, username string, grantedTo string, requestedscopes []string) (authorizedScopes []string, err error)
FilterAuthorizedScopes filters the requested scopes to the ones that are authorizated, if no authorization exists, authorizedScops is nil
func (*Service) FilterPossibleScopes ¶
func (service *Service) FilterPossibleScopes(r *http.Request, username string, requestedScopes []string, allowInvitations bool) (possibleScopes []string, err error)
FilterPossibleScopes filters the requestedScopes to the relevant ones that are possible For example, a `user:memberof:orgid1` is not possible if the user is not a member the `orgid1` organization and there is no outstanding invite for this organization If allowInvitations is true, invitations to organizations allows the "user:memberof:organization" as possible scopes