Documentation ¶
Index ¶
- func ConvertCasAuthenticationSuccessToUser(cas *CasAuthenticationSuccess) *storage.User
- func ParseOptionsFromEnv(opts interface{}) error
- func SetupServer(opts Options, storage Storage) *mux.Router
- type Cas
- type CasAuthenticationFailure
- type CasAuthenticationSuccess
- type CasServiceResponse
- type ExternalGroupsProvider
- type Options
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertCasAuthenticationSuccessToUser ¶
func ConvertCasAuthenticationSuccessToUser(cas *CasAuthenticationSuccess) *storage.User
func ParseOptionsFromEnv ¶
func ParseOptionsFromEnv(opts interface{}) error
getOptionsFromEnv retrieves options for a service from environment variables. The function returns an Options struct and an error if any required variables are missing.
func SetupServer ¶
SetupServer creates an OIDC server with Issuer=http://localhost:<port>
Use one of the pre-made clients in storage/clients.go or register a new one.
Types ¶
type CasAuthenticationSuccess ¶
type CasAuthenticationSuccess struct { User string `xml:"user" json:"user"` SsoId string `xml:"attributes>ssoId" json:"ssoId"` LastName string `xml:"attributes>lastName" json:"lastName"` Country string `xml:"attributes>country" json:"country"` EmailConfirmed bool `xml:"attributes>emailConfirmed" json:"emailConfirmed"` Contactid string `xml:"attributes>contactid" json:"contactid"` HasRememberMe bool `xml:"attributes>hasRememberMe" json:"hasRememberMe"` Telephone string `xml:"attributes>telephone" json:"telephone"` Employee int `xml:"attributes>employee" json:"employee"` PasswordCreationTime int `xml:"attributes>passwordCreationTime" json:"passwordCreationTime"` UserId string `xml:"attributes>userId" json:"userId"` LastAuthenticationFromRepositories string `xml:"attributes>lastAuthenticationFromRepositories" json:"lastAuthenticationFromRepositories"` FirstName string `xml:"attributes>firstName" json:"firstName"` UserUuid string `xml:"attributes>user_uuid" json:"user_uuid"` Company string `xml:"attributes>company" json:"company"` Email string `xml:"attributes>email" json:"email"` TwoFaActive bool `xml:"attributes>twoFaActive" json:"twoFaActive"` Username string `xml:"attributes>username" json:"username"` }
type CasServiceResponse ¶
type CasServiceResponse struct { XMLName xml.Name `xml:"http://www.yale.edu/tp/cas serviceResponse"` AuthenticationSuccess *CasAuthenticationSuccess `xml:"authenticationSuccess,omitempty"` AuthenticationFailure *CasAuthenticationFailure `xml:"authenticationFailure,omitempty"` }
type ExternalGroupsProvider ¶
type ExternalGroupsProvider struct {
// contains filtered or unexported fields
}
func NewExternalGroupsProvider ¶
func NewExternalGroupsProvider(url string, header string) *ExternalGroupsProvider
NewExternalGroupsProvider Constructor function for ExternalGroupsProvider
type Options ¶
type Options struct { Host string `env:"HOST" default:"localhost"` Port string `env:"PORT" default:"9998"` PrefixURL string `env:"PREFIX_URL" default:""` Issuer string `env:"ISSUER" default:"http://localhost:9998/"` CasAddress string `env:"CAS_ADDRESS"` CasLoginEndpoint string `env:"CAS_LOGIN_ENDPOINT" default:"/login"` CasLogoutEndpoint string `env:"CAS_LOGOUT_ENDPOINT" default:"/logout"` CasValidateEndpoint string `env:"CAS_VALIDATE_ENDPOINT" default:"/serviceValidate"` ClientID string `env:"CLIENT_ID" default:"web"` ClientSecret string `env:"CLIENT_SECRET"` ClientRedirectURIs string `env:"CLIENT_REDIRECT_URIs" default:"http://localhost:9999/auth/callback"` OpenIDKeyPhrase string `env:"OPENID_KEY_PHRASE"` SigningPrivateKey string `env:"SIGNING_PRIVATE_KEY"` SigningPublicKey string `env:"SIGNING_PUBLIC_KEY"` SigningKeyID string `env:"SIGNING_KEY_ID" default:"682a39b4-cf9f-40de-9fdd-b5c78ff07fe4"` InjectedGroups string `env:"INJECT_GROUPS" default:""` ExternalGroupsProvider string `env:"EXTERNAL_GROUPS_PROVIDER" default:""` EgpHeader string `env:"EXTERNAL_GROUPS_PROVIDER_HEADER" default:"user-id"` }
Click to show internal directories.
Click to hide internal directories.