pam_issuer

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package pam_issuer provides primitives to interact with the PAM Issuer openapi HTTP API.

Package pam_issuer provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.

Package pam_issuer provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.

Index

Constants

View Source
const (
	BearerAuthScopes = "bearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

type AuthAuthorizeParams

type AuthAuthorizeParams struct {
	// ResponseType OAuth2 response type.
	ResponseType AuthAuthorizeParamsResponseType `form:"response_type" json:"response_type"`

	// ClientId OAuth2 client ID.
	ClientId string `form:"client_id" json:"client_id"`

	// RedirectUri OAuth2 redirect URI.
	RedirectUri string `form:"redirect_uri" json:"redirect_uri"`

	// Scope OAuth2 scope.
	Scope *string `form:"scope,omitempty" json:"scope,omitempty"`

	// State OAuth2 state parameter.
	State *string `form:"state,omitempty" json:"state,omitempty"`

	// CodeChallenge PKCE code challenge.
	CodeChallenge *string `form:"code_challenge,omitempty" json:"code_challenge,omitempty"`

	// CodeChallengeMethod PKCE code challenge method (only S256 supported).
	CodeChallengeMethod *AuthAuthorizeParamsCodeChallengeMethod `form:"code_challenge_method,omitempty" json:"code_challenge_method,omitempty"`
}

AuthAuthorizeParams defines parameters for AuthAuthorize.

type AuthAuthorizeParamsCodeChallengeMethod

type AuthAuthorizeParamsCodeChallengeMethod string

AuthAuthorizeParamsCodeChallengeMethod defines parameters for AuthAuthorize.

const (
	AuthAuthorizeParamsCodeChallengeMethodS256 AuthAuthorizeParamsCodeChallengeMethod = "S256"
)

Defines values for AuthAuthorizeParamsCodeChallengeMethod.

type AuthAuthorizeParamsResponseType

type AuthAuthorizeParamsResponseType string

AuthAuthorizeParamsResponseType defines parameters for AuthAuthorize.

const (
	Code  AuthAuthorizeParamsResponseType = "code"
	Token AuthAuthorizeParamsResponseType = "token"
)

Defines values for AuthAuthorizeParamsResponseType.

type AuthLoginParams

type AuthLoginParams struct {
	// ClientId OAuth2 client ID.
	ClientId string `form:"client_id" json:"client_id"`

	// RedirectUri OAuth2 redirect URI.
	RedirectUri string `form:"redirect_uri" json:"redirect_uri"`

	// State OAuth2 state parameter.
	State *string `form:"state,omitempty" json:"state,omitempty"`

	// Scope OAuth2 scope.
	Scope *string `form:"scope,omitempty" json:"scope,omitempty"`

	// CodeChallenge PKCE code challenge.
	CodeChallenge *string `form:"code_challenge,omitempty" json:"code_challenge,omitempty"`

	// CodeChallengeMethod PKCE code challenge method (only S256 supported).
	CodeChallengeMethod *AuthLoginParamsCodeChallengeMethod `form:"code_challenge_method,omitempty" json:"code_challenge_method,omitempty"`
}

AuthLoginParams defines parameters for AuthLogin.

type AuthLoginParamsCodeChallengeMethod

type AuthLoginParamsCodeChallengeMethod string

AuthLoginParamsCodeChallengeMethod defines parameters for AuthLogin.

const (
	S256 AuthLoginParamsCodeChallengeMethod = "S256"
)

Defines values for AuthLoginParamsCodeChallengeMethod.

type AuthLoginPostFormdataBody

type AuthLoginPostFormdataBody struct {
	// Password Password for authentication
	Password *string `form:"password,omitempty" json:"password,omitempty"`

	// Username Username for authentication
	Username string `form:"username" json:"username"`
}

AuthLoginPostFormdataBody defines parameters for AuthLoginPost.

type AuthLoginPostFormdataRequestBody

type AuthLoginPostFormdataRequestBody AuthLoginPostFormdataBody

AuthLoginPostFormdataRequestBody defines body for AuthLoginPost for application/x-www-form-urlencoded ContentType.

type AuthLogoutParams

type AuthLogoutParams struct {
	// PostLogoutRedirectUri Where to redirect the user after logout (must align with registered redirect URIs).
	PostLogoutRedirectUri *string `form:"post_logout_redirect_uri,omitempty" json:"post_logout_redirect_uri,omitempty"`

	// IdTokenHint Optional ID token hint (accepted for interoperability; not required for logout).
	IdTokenHint *string `form:"id_token_hint,omitempty" json:"id_token_hint,omitempty"`

	// ClientId OAuth2 client ID; if set, must match the configured client.
	ClientId *string `form:"client_id,omitempty" json:"client_id,omitempty"`

	// State Optional opaque state (passed through to post_logout_redirect_uri as query param when redirecting).
	State *string `form:"state,omitempty" json:"state,omitempty"`
}

AuthLogoutParams defines parameters for AuthLogout.

type AuthTokenFormdataRequestBody

type AuthTokenFormdataRequestBody = TokenRequest

AuthTokenFormdataRequestBody defines body for AuthToken for application/x-www-form-urlencoded ContentType.

type AuthTokenJSONRequestBody

type AuthTokenJSONRequestBody = TokenRequest

AuthTokenJSONRequestBody defines body for AuthToken for application/json ContentType.

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type JWKSResponse

type JWKSResponse struct {
	Keys *[]struct {
		// Alg Algorithm.
		Alg *string `json:"alg,omitempty"`

		// Crv Elliptic curve name (for EC keys, e.g., "P-256").
		Crv *string `json:"crv,omitempty"`

		// E RSA exponent (for RSA keys).
		E *string `json:"e,omitempty"`

		// Kid Key ID.
		Kid *string `json:"kid,omitempty"`

		// Kty Key type.
		Kty *string `json:"kty,omitempty"`

		// N RSA modulus (for RSA keys).
		N *string `json:"n,omitempty"`

		// Use Key use.
		Use *string `json:"use,omitempty"`

		// X EC x-coordinate (for EC keys).
		X *string `json:"x,omitempty"`

		// Y EC y-coordinate (for EC keys).
		Y *string `json:"y,omitempty"`
	} `json:"keys,omitempty"`
}

JWKSResponse JSON Web Key Set

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type OAuth2Error

type OAuth2Error struct {
	// Code OAuth2 error code (RFC 6749 Section 5.2).
	Code OAuth2ErrorError `json:"error"`

	// ErrorDescription Human-readable ASCII text providing additional information.
	ErrorDescription *string `json:"error_description,omitempty"`

	// ErrorUri URI identifying a human-readable web page with information about the error.
	ErrorUri *string `json:"error_uri,omitempty"`
}

OAuth2Error OAuth2 error response (RFC 6749 Section 5.2)

func IsOAuth2Error

func IsOAuth2Error(err error) (*OAuth2Error, bool)

IsOAuth2Error checks if an error is an OAuth2Error

func (*OAuth2Error) Error

func (o *OAuth2Error) Error() string

Error implements the error interface for OAuth2Error This allows OAuth2Error to be returned as a standard Go error

type OAuth2ErrorError

type OAuth2ErrorError string

OAuth2ErrorError OAuth2 error code (RFC 6749 Section 5.2).

const (
	InvalidClient          OAuth2ErrorError = "invalid_client"
	InvalidGrant           OAuth2ErrorError = "invalid_grant"
	InvalidRequest         OAuth2ErrorError = "invalid_request"
	InvalidScope           OAuth2ErrorError = "invalid_scope"
	ServerError            OAuth2ErrorError = "server_error"
	TemporarilyUnavailable OAuth2ErrorError = "temporarily_unavailable"
	UnauthorizedClient     OAuth2ErrorError = "unauthorized_client"
	UnsupportedGrantType   OAuth2ErrorError = "unsupported_grant_type"
)

Defines values for OAuth2ErrorError.

type OpenIDConfiguration

type OpenIDConfiguration struct {
	// AuthorizationEndpoint Authorization endpoint.
	AuthorizationEndpoint *string `json:"authorization_endpoint,omitempty"`

	// ClaimsSupported Supported claims.
	ClaimsSupported *[]string `json:"claims_supported,omitempty"`

	// CodeChallengeMethodsSupported Supported PKCE code challenge methods.
	CodeChallengeMethodsSupported *[]OpenIDConfigurationCodeChallengeMethodsSupported `json:"code_challenge_methods_supported,omitempty"`

	// EndSessionEndpoint OIDC RP-Initiated Logout endpoint (end session at the issuer).
	EndSessionEndpoint *string `json:"end_session_endpoint,omitempty"`

	// GrantTypesSupported Supported grant types.
	GrantTypesSupported *[]string `json:"grant_types_supported,omitempty"`

	// IdTokenSigningAlgValuesSupported Supported signing algorithms.
	IdTokenSigningAlgValuesSupported *[]string `json:"id_token_signing_alg_values_supported,omitempty"`

	// Issuer OIDC issuer.
	Issuer *string `json:"issuer,omitempty"`

	// JwksUri JWKS endpoint.
	JwksUri *string `json:"jwks_uri,omitempty"`

	// ResponseTypesSupported Supported response types.
	ResponseTypesSupported *[]string `json:"response_types_supported,omitempty"`

	// ScopesSupported Supported scopes.
	ScopesSupported *[]string `json:"scopes_supported,omitempty"`

	// SubjectTypesSupported Supported subject identifier types.
	SubjectTypesSupported *[]OpenIDConfigurationSubjectTypesSupported `json:"subject_types_supported,omitempty"`

	// TokenEndpoint Token endpoint.
	TokenEndpoint *string `json:"token_endpoint,omitempty"`

	// TokenEndpointAuthMethodsSupported Supported authentication methods.
	TokenEndpointAuthMethodsSupported *[]string `json:"token_endpoint_auth_methods_supported,omitempty"`

	// UserinfoEndpoint UserInfo endpoint.
	UserinfoEndpoint *string `json:"userinfo_endpoint,omitempty"`
}

OpenIDConfiguration OpenID Connect configuration

type OpenIDConfigurationCodeChallengeMethodsSupported

type OpenIDConfigurationCodeChallengeMethodsSupported string

OpenIDConfigurationCodeChallengeMethodsSupported defines model for OpenIDConfiguration.CodeChallengeMethodsSupported.

const (
	OpenIDConfigurationCodeChallengeMethodsSupportedS256 OpenIDConfigurationCodeChallengeMethodsSupported = "S256"
)

Defines values for OpenIDConfigurationCodeChallengeMethodsSupported.

type OpenIDConfigurationSubjectTypesSupported

type OpenIDConfigurationSubjectTypesSupported string

OpenIDConfigurationSubjectTypesSupported defines model for OpenIDConfiguration.SubjectTypesSupported.

Defines values for OpenIDConfigurationSubjectTypesSupported.

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type ServerInterface

type ServerInterface interface {

	// (GET /api/v1/auth/.well-known/openid-configuration)
	AuthOpenIDConfiguration(w http.ResponseWriter, r *http.Request)

	// (GET /api/v1/auth/authorize)
	AuthAuthorize(w http.ResponseWriter, r *http.Request, params AuthAuthorizeParams)

	// (GET /api/v1/auth/jwks)
	AuthJWKS(w http.ResponseWriter, r *http.Request)

	// (GET /api/v1/auth/login)
	AuthLogin(w http.ResponseWriter, r *http.Request, params AuthLoginParams)

	// (POST /api/v1/auth/login)
	AuthLoginPost(w http.ResponseWriter, r *http.Request)

	// (GET /api/v1/auth/logout)
	AuthLogout(w http.ResponseWriter, r *http.Request, params AuthLogoutParams)

	// (POST /api/v1/auth/token)
	AuthToken(w http.ResponseWriter, r *http.Request)

	// (GET /api/v1/auth/userinfo)
	AuthUserInfo(w http.ResponseWriter, r *http.Request)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) AuthAuthorize

func (siw *ServerInterfaceWrapper) AuthAuthorize(w http.ResponseWriter, r *http.Request)

AuthAuthorize operation middleware

func (*ServerInterfaceWrapper) AuthJWKS

func (siw *ServerInterfaceWrapper) AuthJWKS(w http.ResponseWriter, r *http.Request)

AuthJWKS operation middleware

func (*ServerInterfaceWrapper) AuthLogin

func (siw *ServerInterfaceWrapper) AuthLogin(w http.ResponseWriter, r *http.Request)

AuthLogin operation middleware

func (*ServerInterfaceWrapper) AuthLoginPost

func (siw *ServerInterfaceWrapper) AuthLoginPost(w http.ResponseWriter, r *http.Request)

AuthLoginPost operation middleware

func (*ServerInterfaceWrapper) AuthLogout

func (siw *ServerInterfaceWrapper) AuthLogout(w http.ResponseWriter, r *http.Request)

AuthLogout operation middleware

func (*ServerInterfaceWrapper) AuthOpenIDConfiguration

func (siw *ServerInterfaceWrapper) AuthOpenIDConfiguration(w http.ResponseWriter, r *http.Request)

AuthOpenIDConfiguration operation middleware

func (*ServerInterfaceWrapper) AuthToken

func (siw *ServerInterfaceWrapper) AuthToken(w http.ResponseWriter, r *http.Request)

AuthToken operation middleware

func (*ServerInterfaceWrapper) AuthUserInfo

func (siw *ServerInterfaceWrapper) AuthUserInfo(w http.ResponseWriter, r *http.Request)

AuthUserInfo operation middleware

type TokenRequest

type TokenRequest struct {
	// ClientId OAuth2 client ID.
	ClientId *string `json:"client_id"`

	// ClientSecret OAuth2 client secret (optional for public clients).
	ClientSecret *string `json:"client_secret"`

	// Code Authorization code for authorization_code grant.
	Code *string `json:"code"`

	// CodeVerifier PKCE code verifier.
	CodeVerifier *string `json:"code_verifier"`

	// GrantType OAuth2 grant type.
	GrantType TokenRequestGrantType `json:"grant_type"`

	// Password Password for password grant (not used in OIDC flows).
	Password *string `json:"password"`

	// RedirectUri OAuth2 redirect URI (required for authorization_code grant if included in authorization request).
	RedirectUri *string `json:"redirect_uri"`

	// RefreshToken Refresh token for refresh_token grant.
	RefreshToken *string `json:"refresh_token"`

	// Scope OAuth2 scope.
	Scope *string `json:"scope"`

	// Username Username for password grant (not used in OIDC flows).
	Username *string `json:"username"`
}

TokenRequest OAuth2 token request

type TokenRequestGrantType

type TokenRequestGrantType string

TokenRequestGrantType OAuth2 grant type.

const (
	AuthorizationCode TokenRequestGrantType = "authorization_code"
	Password          TokenRequestGrantType = "password"
	RefreshToken      TokenRequestGrantType = "refresh_token"
)

Defines values for TokenRequestGrantType.

type TokenResponse

type TokenResponse struct {
	// AccessToken OAuth2 access token.
	AccessToken string `json:"access_token"`

	// ExpiresIn Token expiration time in seconds.
	ExpiresIn *int `json:"expires_in,omitempty"`

	// IdToken OpenID Connect ID token (returned when openid scope is requested).
	IdToken *string `json:"id_token,omitempty"`

	// RefreshToken OAuth2 refresh token.
	RefreshToken *string `json:"refresh_token,omitempty"`

	// TokenType Token type.
	TokenType TokenResponseTokenType `json:"token_type"`
}

TokenResponse OAuth2 successful token response

type TokenResponseTokenType

type TokenResponseTokenType string

TokenResponseTokenType Token type.

const (
	Bearer TokenResponseTokenType = "Bearer"
)

Defines values for TokenResponseTokenType.

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type Unimplemented

type Unimplemented struct{}

func (Unimplemented) AuthAuthorize

func (_ Unimplemented) AuthAuthorize(w http.ResponseWriter, r *http.Request, params AuthAuthorizeParams)

(GET /api/v1/auth/authorize)

func (Unimplemented) AuthJWKS

func (_ Unimplemented) AuthJWKS(w http.ResponseWriter, r *http.Request)

(GET /api/v1/auth/jwks)

func (Unimplemented) AuthLogin

func (_ Unimplemented) AuthLogin(w http.ResponseWriter, r *http.Request, params AuthLoginParams)

(GET /api/v1/auth/login)

func (Unimplemented) AuthLoginPost

func (_ Unimplemented) AuthLoginPost(w http.ResponseWriter, r *http.Request)

(POST /api/v1/auth/login)

func (Unimplemented) AuthLogout

func (_ Unimplemented) AuthLogout(w http.ResponseWriter, r *http.Request, params AuthLogoutParams)

(GET /api/v1/auth/logout)

func (Unimplemented) AuthOpenIDConfiguration

func (_ Unimplemented) AuthOpenIDConfiguration(w http.ResponseWriter, r *http.Request)

(GET /api/v1/auth/.well-known/openid-configuration)

func (Unimplemented) AuthToken

func (_ Unimplemented) AuthToken(w http.ResponseWriter, r *http.Request)

(POST /api/v1/auth/token)

func (Unimplemented) AuthUserInfo

func (_ Unimplemented) AuthUserInfo(w http.ResponseWriter, r *http.Request)

(GET /api/v1/auth/userinfo)

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

type UserInfoResponse

type UserInfoResponse struct {
	// Email Email address.
	Email *string `json:"email,omitempty"`

	// EmailVerified Email verification status.
	EmailVerified *bool `json:"email_verified,omitempty"`

	// Name Full name.
	Name *string `json:"name,omitempty"`

	// Organizations User organizations.
	Organizations *[]string `json:"organizations,omitempty"`

	// PreferredUsername Preferred username.
	PreferredUsername *string `json:"preferred_username,omitempty"`

	// Roles User roles.
	Roles *[]string `json:"roles,omitempty"`

	// Sub Subject identifier.
	Sub string `json:"sub"`
}

UserInfoResponse OIDC UserInfo response

Jump to

Keyboard shortcuts

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