api

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

View Source
const (
	GrantTypeDeviceCode        = GrantType(oidc.GrantTypeDeviceCode)
	GrantTypeClientCredentials = GrantType(oidc.GrantTypeClientCredentials)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth added in v0.42.0

type Auth struct {
	Login    string `json:"login"`
	Password string `json:"password"`
}

func (*Auth) UnmarshalJSON added in v0.42.0

func (u *Auth) UnmarshalJSON(data []byte) error

type Entity

type Entity interface {
	GetKind() string
	GetMetadata() Metadata
	GetSpec() any
}

type GrantType added in v0.44.0

type GrantType oidc.GrantType

GrantType is a subset of the OAuth 2.0 grant types. In our case, we will explicitly need them only in the /token endpoint, that we are using only in the context of device code flow and client credentials flow.

type Metadata

type Metadata interface {
	GetName() string
	Flatten(sensitive bool)
}

type Migrate added in v0.18.0

type Migrate struct {
	Input            map[string]string `json:"input,omitempty"`
	GrafanaDashboard json.RawMessage   `json:"grafanaDashboard"`
}

func (*Migrate) UnmarshalJSON added in v0.18.0

func (m *Migrate) UnmarshalJSON(data []byte) error

type OAuthError added in v0.44.0

type OAuthError struct {
	ErrorCode        string `json:"error"`
	ErrorDescription string `json:"error_description"`
}

OAuthError represents the error response of a possible oauth endpoint. It is used to control the error type in the response of the backend request (client and server side) It helps for example when polling device access token to know if the device code is still valid, or if we need to slow down, etc ... Refs: https://www.rfc-editor.org/rfc/rfc8628#section-3.5 https://www.rfc-editor.org/rfc/rfc6749#section-5.2

func (*OAuthError) Error added in v0.44.0

func (e *OAuthError) Error() string

Error makes it an error, which can be convenient.

type PublicAuth added in v0.48.0

type PublicAuth struct {
	Login    string        `json:"login"`
	Password secret.Hidden `json:"password"`
}

func NewPublicAuth added in v0.48.0

func NewPublicAuth(auth *Auth) *PublicAuth

type RefreshRequest added in v0.42.0

type RefreshRequest struct {
	RefreshToken string `json:"refresh_token"`
}

RefreshRequest represents the request used to refresh an access token from a refresh token. Disclaimer: This is an exception to the general camelCase convention in the project, to respect oauth 2.0 specs. -> https://datatracker.ietf.org/doc/html/rfc6749#section-6

func (*RefreshRequest) UnmarshalJSON added in v0.42.0

func (r *RefreshRequest) UnmarshalJSON(data []byte) error

type TokenRequest added in v0.44.0

type TokenRequest struct {
	GrantType    GrantType `json:"grant_type"`
	DeviceCode   string    `json:"device_code"`
	ClientID     string    `json:"client_id"`
	ClientSecret string    `json:"client_secret"`
}

TokenRequest represents the body of a /token endpoint request. DeviceCode or ClientID, ClientSecret will be necessary based on the grant type.

func (*TokenRequest) UnmarshalJSON added in v0.44.0

func (r *TokenRequest) UnmarshalJSON(data []byte) error

Directories

Path Synopsis
v1

Jump to

Keyboard shortcuts

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