api

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

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 AuthResponse added in v0.42.0

type AuthResponse struct {
	AccessToken  string `json:"accessToken"`
	RefreshToken string `json:"refreshToken,omitempty"`
}

type Entity

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

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 RefreshRequest added in v0.42.0

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

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