Versions in this module Expand all Collapse all v0 v0.53.0 May 6, 2024 Changes in this version + func HandlerPatternFromRequest(r *http.Request) (string, error) + func NewContextWithRequestHandlerPattern(ctx context.Context, pattern string) context.Context + func RequestHandlerPatternFromContext(ctx context.Context) (string, error) v0.52.0 Feb 22, 2023 Changes in this version + const ApiKeyHeaderKey + const AppIDHeaderKey + const AuthProviderHeaderKey type Auth + ProviderAccessToken string + ProviderAccessTokenExpiry time.Time + ProviderRefreshToken string type AuthenticationServicer + AuthenticationParamExchange func(ctx context.Context, params *AuthenticationParams) (*ProviderInfo, error) + DetermineAppContext func(ctx context.Context, auth Auth, realm string) (context.Context, error) + FindExistingAuth func(r *http.Request, realm string) (Auth, error) + NewAuthenticationParams func(r *http.Request, realm string) (*AuthenticationParams, error) type ProviderTokenInfo + Audience string + IssuedTo string + Token *oauth2.Token type ProviderUserInfo + VerifiedEmail bool type User + func NewUserFromProviderInfo(pi *ProviderInfo, lm language.Matcher) *User + func UserFromContext(ctx context.Context) (*User, error) + type UserResponse struct + BirthDate time.Time + CompanyDepartment string + CompanyName string + Email string + ExternalID secure.Identifier + FirstName string + FullName string + HostedDomain string + ID uuid.UUID + JobTitle string + LanguagePreferences []language.Tag + LastName string + MiddleName string + NamePrefix string + NameSuffix string + Nickname string + PictureURL string + ProfileLink string + Source string v0.51.1 Feb 6, 2023 v0.51.0 Feb 3, 2023 v0.50.1 Jan 17, 2023 v0.50.0 Dec 13, 2022 Changes in this version + const BearerTokenType + func NewContextWithApp(ctx context.Context, a *App) context.Context + func NewContextWithAuthParams(ctx context.Context, ap *AuthenticationParams) context.Context + func NewContextWithUser(ctx context.Context, u *User) context.Context + func NewNullInt32(i int32) sql.NullInt32 + func NewNullInt64(i int64) sql.NullInt64 + func NewNullString(s string) sql.NullString + func NewNullTime(t time.Time) sql.NullTime + func NewNullUUID(i uuid.UUID) uuid.NullUUID + type APIKey struct + func NewAPIKey(g APIKeyGenerator, ek *[32]byte, deactivation time.Time) (APIKey, error) + func NewAPIKeyFromCipher(ciphertext string, ek *[32]byte) (APIKey, error) + func (a *APIKey) Ciphertext() string + func (a *APIKey) DeactivationDate() time.Time + func (a *APIKey) Key() string + func (a *APIKey) SetDeactivationDate(t time.Time) + func (a *APIKey) SetStringAsDeactivationDate(s string) error + type APIKeyGenerator interface + RandomString func(n int) (string, error) + type APIKeyResponse struct + DeactivationDate string + Key string + type App struct + APIKeys []APIKey + Description string + ExternalID secure.Identifier + ID uuid.UUID + Name string + Org *Org + Provider Provider + ProviderClientID string + func AppFromContext(ctx context.Context) (*App, error) + func AppFromRequest(r *http.Request) (*App, error) + func (a *App) AddKey(key APIKey) error + func (a *App) ValidateKey(realm, matchKey string) error + type AppResponse struct + APIKeys []APIKeyResponse + CreateAppExtlID string + CreateDateTime string + CreateUserFirstName string + CreateUserLastName string + Description string + ExternalID string + Name string + UpdateAppExtlID string + UpdateDateTime string + UpdateUserFirstName string + UpdateUserLastName string + type AppServicer interface + Create func(ctx context.Context, r *CreateAppRequest, adt Audit) (*AppResponse, error) + Update func(ctx context.Context, r *UpdateAppRequest, adt Audit) (*AppResponse, error) + type Audit struct + App *App + Moment time.Time + User *User + func AuditFromRequest(r *http.Request) (adt Audit, err error) + type Auth struct + ID uuid.UUID + Provider Provider + ProviderClientID string + ProviderPersonID string + Token *oauth2.Token + User *User + type AuthenticationParams struct + Provider Provider + Realm string + Token *oauth2.Token + func AuthParamsFromContext(ctx context.Context) (*AuthenticationParams, error) + type AuthenticationServicer interface + FindAppByAPIKey func(ctx context.Context, realm, appExtlID, key string) (*App, error) + FindAppByProviderClientID func(ctx context.Context, realm string, auth Auth) (a *App, err error) + FindAuth func(ctx context.Context, params AuthenticationParams) (Auth, error) + SelfRegister func(ctx context.Context, params AuthenticationParams) (auth Auth, err error) + type AuthorizationServicer interface + Authorize func(r *http.Request, lgr zerolog.Logger, adt Audit) error + type CreateAppRequest struct + Description string + Name string + Oauth2Provider string + Oauth2ProviderClientID string + func (r CreateAppRequest) Validate() error + type CreateMovieRequest struct + Director string + Rated string + Released string + RunTime int + Title string + Writer string + type CreateOrgRequest struct + CreateAppRequest *CreateAppRequest + Description string + Kind string + Name string + func (r CreateOrgRequest) Validate() error + type CreatePermissionRequest struct + Active bool + Description string + Operation string + Resource string + type CreateRoleRequest struct + Active bool + Code string + Description string + Permissions []*FindPermissionRequest + type DBTX interface + Exec func(context.Context, string, ...interface{}) (pgconn.CommandTag, error) + Query func(context.Context, string, ...interface{}) (pgx.Rows, error) + QueryRow func(context.Context, string, ...interface{}) pgx.Row + type Datastorer interface + BeginTx func(ctx context.Context) (pgx.Tx, error) + CommitTx func(ctx context.Context, tx pgx.Tx) error + Ping func(ctx context.Context) error + RollbackTx func(ctx context.Context, tx pgx.Tx, err error) error + type DeleteResponse struct + Deleted bool + ExternalID string + type FindPermissionRequest struct + ExternalID string + Operation string + Resource string + type GenesisRequest struct + CreatePermissionRequests []CreatePermissionRequest + CreateRoleRequests []CreateRoleRequest + User struct{ ... } + UserInitiatedOrg CreateOrgRequest + type GenesisResponse struct + Principal *OrgResponse + Test *OrgResponse + UserInitiated *OrgResponse + type GenesisServicer interface + Arche func(ctx context.Context, r *GenesisRequest) (GenesisResponse, error) + ReadConfig func() (GenesisResponse, error) + type LoggerRequest struct + GlobalLogLevel string + LogErrorStack string + type LoggerResponse struct + GlobalLogLevel string + LogErrorStack bool + LoggerMinimumLevel string + type LoggerServicer interface + Read func() *LoggerResponse + Update func(r *LoggerRequest) (*LoggerResponse, error) + type Movie struct + Director string + ExternalID secure.Identifier + ID uuid.UUID + Rated string + Released time.Time + RunTime int + Title string + Writer string + func (m *Movie) IsValid() error + type MovieResponse struct + CreateAppExtlID string + CreateDateTime string + CreateUserFirstName string + CreateUserLastName string + Director string + ExternalID string + Rated string + Released string + RunTime int + Title string + UpdateAppExtlID string + UpdateDateTime string + UpdateUserFirstName string + UpdateUserLastName string + Writer string + type MovieServicer interface + Create func(ctx context.Context, r *CreateMovieRequest, adt Audit) (*MovieResponse, error) + Delete func(ctx context.Context, extlID string) (DeleteResponse, error) + FindAllMovies func(ctx context.Context) ([]*MovieResponse, error) + FindMovieByExternalID func(ctx context.Context, extlID string) (*MovieResponse, error) + Update func(ctx context.Context, r *UpdateMovieRequest, adt Audit) (*MovieResponse, error) + type Org struct + Description string + ExternalID secure.Identifier + ID uuid.UUID + Kind *OrgKind + Name string + func (o Org) Validate() (err error) + type OrgKind struct + Description string + ExternalID string + ID uuid.UUID + func (o OrgKind) Validate() error + type OrgResponse struct + App *AppResponse + CreateAppExtlID string + CreateDateTime string + CreateUserFirstName string + CreateUserLastName string + Description string + ExternalID string + KindExternalID string + Name string + UpdateAppExtlID string + UpdateDateTime string + UpdateUserFirstName string + UpdateUserLastName string + type OrgServicer interface + Create func(ctx context.Context, r *CreateOrgRequest, adt Audit) (*OrgResponse, error) + Delete func(ctx context.Context, extlID string) (DeleteResponse, error) + FindAll func(ctx context.Context) ([]*OrgResponse, error) + FindByExternalID func(ctx context.Context, extlID string) (*OrgResponse, error) + Update func(ctx context.Context, r *UpdateOrgRequest, adt Audit) (*OrgResponse, error) + type Permission struct + Active bool + Description string + ExternalID secure.Identifier + ID uuid.UUID + Operation string + Resource string + func (p Permission) Validate() error + type PermissionResponse struct + Active bool + Description string + ExternalID string + Operation string + Resource string + type PermissionServicer interface + Create func(ctx context.Context, r *CreatePermissionRequest, adt Audit) (*PermissionResponse, error) + Delete func(ctx context.Context, extlID string) (DeleteResponse, error) + FindAll func(ctx context.Context) ([]*PermissionResponse, error) + type Person struct + ExternalID secure.Identifier + ID uuid.UUID + Users []*User + func (p Person) NullUUID() uuid.NullUUID + func (p Person) Validate() (err error) + type PingResponse struct + DBUp bool + type PingServicer interface + Ping func(ctx context.Context, lgr zerolog.Logger) PingResponse + type Provider uint8 + const Google + const UnknownProvider + func ParseProvider(s string) Provider + func (p Provider) String() string + type ProviderInfo struct + Provider Provider + TokenInfo *ProviderTokenInfo + UserInfo *ProviderUserInfo + type ProviderTokenInfo struct + ClientID string + Expiration time.Time + Scope string + type ProviderUserInfo struct + BirthDate time.Time + Email string + ExternalID string + FirstName string + FullName string + Gender string + HostedDomain string + LastName string + Locale string + MiddleName string + NamePrefix string + NameSuffix string + Nickname string + Picture string + ProfileLink string + type RegisterUserServicer interface + SelfRegister func(ctx context.Context, adt Audit) error + type Role struct + Active bool + Code string + Description string + ExternalID secure.Identifier + ID uuid.UUID + Permissions []*Permission + func (r Role) Validate() error + type RoleResponse struct + Active bool + Code string + Description string + ExternalID string + Permissions []*Permission + type RoleServicer interface + Create func(ctx context.Context, r *CreateRoleRequest, adt Audit) (*RoleResponse, error) + type SimpleAudit struct + Create Audit + Update Audit + type TokenExchanger interface + Exchange func(ctx context.Context, realm string, provider Provider, token *oauth2.Token) (*ProviderInfo, error) + type UpdateAppRequest struct + Description string + ExternalID string + Name string + type UpdateMovieRequest struct + Director string + ExternalID string + Rated string + Released string + RunTime int + Title string + Writer string + type UpdateOrgRequest struct + Description string + ExternalID string + Name string + type User struct + BirthDate time.Time + CompanyDepartment string + CompanyName string + Email string + ExternalID secure.Identifier + FirstName string + FullName string + Gender string + HostedDomain string + ID uuid.UUID + JobTitle string + LanguagePreferences []language.Tag + LastName string + MiddleName string + NamePrefix string + NameSuffix string + Nickname string + PictureURL string + ProfileLink string + Source string + func UserFromRequest(r *http.Request) (u *User, err error) + func (u User) NullUUID() uuid.NullUUID + func (u User) Validate() error v0.0.2 Oct 20, 2017 v0.0.1 Sep 25, 2017