Documentation ¶
Index ¶
- Constants
- func AuthTokenFromContext(ctx context.Context) (string, bool)
- func ContextWithAuthToken(ctx context.Context, token string) context.Context
- func ContextWithIdentity(ctx context.Context, ident Identity) context.Context
- func GenerateAccessToken(keyID string, privateKeyFile string, expiration time.Duration, ...) (string, error)
- type Identity
- type TenantID
- type TokenValidator
- type UserID
Constants ¶
View Source
const ( AnonymousTenantID TenantID = "tenant_000000000000000000000000001" AnonymousUserID UserID = "user_000000000000000000000000001" )
View Source
const ( // These are the namespaced custom claims we expect on any JWT // access token. TenantIDClaim = "https://lake.brimdata.io/tenant_id" UserIDClaim = "https://lake.brimdata.io/user_id" )
Variables ¶
This section is empty.
Functions ¶
func ContextWithAuthToken ¶
func ContextWithIdentity ¶
func GenerateAccessToken ¶
func GenerateAccessToken(keyID string, privateKeyFile string, expiration time.Duration, audience, domain string, tenantID TenantID, userID UserID) (string, error)
GenerateAccessToken creates a JWT in string format with the expected audience, issuer, and claims to pass zqd authentication checks.
Types ¶
type Identity ¶
func IdentityFromContext ¶
type TokenValidator ¶
type TokenValidator struct {
// contains filtered or unexported fields
}
func NewTokenValidator ¶
func NewTokenValidator(audience, domain, jwksPath string) (*TokenValidator, error)
func (*TokenValidator) ValidateRequest ¶
Click to show internal directories.
Click to hide internal directories.