oauth2provider
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- func CreateApp(db database.Store, accessURL *url.URL, auditor *audit.Auditor, ...) http.HandlerFunc
- func CreateAppSecret(db database.Store, auditor *audit.Auditor, logger slog.Logger) http.HandlerFunc
- func CreateDynamicClientRegistration(db database.Store, accessURL *url.URL, auditor *audit.Auditor, ...) http.HandlerFunc
- func DeleteApp(db database.Store, auditor *audit.Auditor, logger slog.Logger) http.HandlerFunc
- func DeleteAppSecret(db database.Store, auditor *audit.Auditor, logger slog.Logger) http.HandlerFunc
- func DeleteClientConfiguration(db database.Store, auditor *audit.Auditor, logger slog.Logger) http.HandlerFunc
- func GetApp(accessURL *url.URL) http.HandlerFunc
- func GetAppSecrets(db database.Store) http.HandlerFunc
- func GetAuthorizationServerMetadata(accessURL *url.URL) http.HandlerFunc
- func GetClientConfiguration(db database.Store) http.HandlerFunc
- func GetProtectedResourceMetadata(accessURL *url.URL) http.HandlerFunc
- func ListApps(db database.Store, accessURL *url.URL) http.HandlerFunc
- func ProcessAuthorize(db database.Store) http.HandlerFunc
- func RequireRegistrationAccessToken(db database.Store) func(http.Handler) http.Handler
- func RevokeApp(db database.Store) http.HandlerFunc
- func ShowAuthorizePage(accessURL *url.URL) http.HandlerFunc
- func Tokens(db database.Store, lifetimes codersdk.SessionLifetime) http.HandlerFunc
- func UpdateApp(db database.Store, accessURL *url.URL, auditor *audit.Auditor, ...) http.HandlerFunc
- func UpdateClientConfiguration(db database.Store, auditor *audit.Auditor, logger slog.Logger) http.HandlerFunc
- func VerifyPKCE(challenge, verifier string) bool
- type AppSecret
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcCreateApp¶
func CreateApp(dbdatabase.Store, accessURL *url.URL, auditor *audit.Auditor, loggerslog.Logger)http.HandlerFunc
CreateApp returns an http.HandlerFunc that handles POST /oauth2-provider/apps
funcCreateAppSecret¶
CreateAppSecret returns an http.HandlerFunc that handles POST /oauth2-provider/apps/{app}/secrets
funcCreateDynamicClientRegistration¶
func CreateDynamicClientRegistration(dbdatabase.Store, accessURL *url.URL, auditor *audit.Auditor, loggerslog.Logger)http.HandlerFunc
CreateDynamicClientRegistration returns an http.HandlerFunc that handles POST /oauth2/register
funcDeleteAppSecret¶
DeleteAppSecret returns an http.HandlerFunc that handles DELETE /oauth2-provider/apps/{app}/secrets/{secretID}
funcDeleteClientConfiguration¶
func DeleteClientConfiguration(dbdatabase.Store, auditor *audit.Auditor, loggerslog.Logger)http.HandlerFunc
DeleteClientConfiguration returns an http.HandlerFunc that handles DELETE /oauth2/clients/{client_id}
funcGetApp¶
func GetApp(accessURL *url.URL)http.HandlerFunc
GetApp returns an http.HandlerFunc that handles GET /oauth2-provider/apps/{app}
funcGetAppSecrets¶
func GetAppSecrets(dbdatabase.Store)http.HandlerFunc
GetAppSecrets returns an http.HandlerFunc that handles GET /oauth2-provider/apps/{app}/secrets
funcGetAuthorizationServerMetadata¶
func GetAuthorizationServerMetadata(accessURL *url.URL)http.HandlerFunc
GetAuthorizationServerMetadata returns an http.HandlerFunc that handles GET /.well-known/oauth-authorization-server
funcGetClientConfiguration¶
func GetClientConfiguration(dbdatabase.Store)http.HandlerFunc
GetClientConfiguration returns an http.HandlerFunc that handles GET /oauth2/clients/{client_id}
funcGetProtectedResourceMetadata¶
func GetProtectedResourceMetadata(accessURL *url.URL)http.HandlerFunc
GetProtectedResourceMetadata returns an http.HandlerFunc that handles GET /.well-known/oauth-protected-resource
funcProcessAuthorize¶
func ProcessAuthorize(dbdatabase.Store)http.HandlerFunc
ProcessAuthorize handles POST /oauth2/authorize requests to process the user's authorization decisionand generate an authorization code.
funcRequireRegistrationAccessToken¶
RequireRegistrationAccessToken returns middleware that validates the registration access token forRFC 7592 endpoints
funcShowAuthorizePage¶
func ShowAuthorizePage(accessURL *url.URL)http.HandlerFunc
ShowAuthorizePage handles GET /oauth2/authorize requests to display the HTML authorization page.
funcTokens¶
func Tokens(dbdatabase.Store, lifetimescodersdk.SessionLifetime)http.HandlerFunc
TokensTODO: the sessions lifetime config passed is for coder api tokens.Should there be a separate config for oauth2 tokens? They are related,but they are not the same.
funcUpdateApp¶
func UpdateApp(dbdatabase.Store, accessURL *url.URL, auditor *audit.Auditor, loggerslog.Logger)http.HandlerFunc
UpdateApp returns an http.HandlerFunc that handles PUT /oauth2-provider/apps/{app}
funcUpdateClientConfiguration¶
func UpdateClientConfiguration(dbdatabase.Store, auditor *audit.Auditor, loggerslog.Logger)http.HandlerFunc
UpdateClientConfiguration returns an http.HandlerFunc that handles PUT /oauth2/clients/{client_id}
funcVerifyPKCE¶
VerifyPKCE verifies that the code_verifier matches the code_challengeusing the S256 method as specified inRFC 7636.
Types¶
typeAppSecret¶
type AppSecret struct {// Formatted contains the secret. This value is owned by the client, not the// server. It is formatted to include the prefix.Formattedstring// Prefix is the ID of this secret owned by the server. When a client uses a// secret, this is the matching string to do a lookup on the hashed value. We// cannot use the hashed value directly because the server does not store the// salt.Prefixstring// Hashed is the server stored hash(secret,salt,...). Used for verifying a// secret.Hashedstring}
funcGenerateSecret¶
GenerateSecret generates a secret to be used as a client secret, refreshtoken, or authorization code.
Source Files¶
Directories¶
Path | Synopsis |
---|---|
Package oauth2providertest provides comprehensive testing utilities for OAuth2 identity provider functionality. | Package oauth2providertest provides comprehensive testing utilities for OAuth2 identity provider functionality. |