Documentation
¶
Overview ¶
Package auth provides the authentication api for the opampcommander application
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthnTokenResponse ¶
type AuthnTokenResponse struct {
// Token is the access token.
Token string `json:"token"`
// RefreshToken is the refresh token used to obtain a new access token without re-authentication.
RefreshToken string `json:"refreshToken,omitempty"`
// ExpiresAt is the time when the access token expires.
ExpiresAt v1.Time `json:"expiresAt,omitzero"`
} // @name AuthnTokenResponse
AuthnTokenResponse defines the response structure for authentication token requests.
type DeviceAuthnTokenResponse ¶
type DeviceAuthnTokenResponse struct {
// DeviceCode
DeviceCode string `json:"deviceCode"`
// UserCode is the code the user should enter at the verification uri
UserCode string `json:"userCode"`
// VerificationURI is where user should enter the user code
VerificationURI string `json:"verificationUri"`
// VerificationURIComplete (if populated) includes the user code in the verification URI.
// This is typically shown to the user in non-textual form, such as a QR code.
VerificationURIComplete string `json:"verificationUriComplete,omitempty"`
// Expiry is when the device code and user code expire
Expiry v1.Time `json:"expiry,omitzero"`
// Interval is the duration in seconds that Poll should wait between requests
Interval int64 `json:"interval,omitempty"`
} // @name DeviceAuthnTokenResponse
DeviceAuthnTokenResponse defines the response structure for device authentication token requests. It is same to `oauth2.DeviceAuthResponse`.
type InfoResponse ¶
type InfoResponse struct {
Authenticated bool `json:"authenticated"`
Email *string `json:"email"`
} // @name InfoResponse
InfoResponse defines the response structure for authentication info.
type MyRole ¶ added in v0.1.37
type MyRole struct {
// Role is the role of the user
Role v1.Role `json:"role"`
// RoleBinding is the rolebinding of the user
RoleBinding v1.RoleBinding `json:"rolebinding"`
}
MyRole represents the current user's role and rolebinding.
type OAuth2AuthCodeURLResponse ¶
type OAuth2AuthCodeURLResponse struct {
// URL is the OAuth2 authorization URL.
URL string `json:"url"`
} // @name OAuth2AuthCodeURLResponse
OAuth2AuthCodeURLResponse defines the response structure for OAuth2 authorization URL requests. It contains the URL that the client should redirect to for OAuth2 authentication.
type RefreshTokenRequest ¶ added in v0.1.39
type RefreshTokenRequest struct {
// RefreshToken is the refresh token previously issued by the server.
RefreshToken string `binding:"required" json:"refreshToken"`
} // @name RefreshTokenRequest
RefreshTokenRequest defines the request body for refreshing an access token.