auth

package
v1.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CredentialStrategy

type CredentialStrategy interface {
	GetCredentials(w http.ResponseWriter, r *http.Request) (*Credentials, error)
	AddWWWAuthenticate(w http.ResponseWriter, r *http.Request, realm string)
}

CredentialStrategy obtains Credentials from the request.

type Credentials

type Credentials struct {
	Type         string
	ClientID     string
	ClientSecret string
}

Credentials contains the auth type, client id and secret.

type Manager

type Manager interface {
	Authenticate(ctx context.Context, clientID, clientSecret string) (*user.User, map[string]*authpb.Scope, error)
}

Manager is the interface to implement to authenticate users.

type Registry

type Registry interface {
	ListProviders(ctx context.Context) ([]*registry.ProviderInfo, error)
	GetProvider(ctx context.Context, authType string) (*registry.ProviderInfo, error)
}

Registry is the interface that auth registries implement for discovering auth providers.

type TokenStrategy

type TokenStrategy interface {
	GetToken(r *http.Request) string
}

TokenStrategy obtains a token from the request. If token does not exist returns an empty string.

type TokenWriter

type TokenWriter interface {
	WriteToken(token string, w http.ResponseWriter)
}

TokenWriter stores the token in a http response.

Directories

Path Synopsis
manager
nextcloud
Package nextcloud verifies a clientID and clientSecret against a Nextcloud backend.
Package nextcloud verifies a clientID and clientSecret against a Nextcloud backend.
oidc
Package oidc verifies an OIDC token against the configured OIDC provider and obtains the necessary claims to obtain user information.
Package oidc verifies an OIDC token against the configured OIDC provider and obtains the necessary claims to obtain user information.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL