auth

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Auth0DevClientId = "N53szkXwrMZmWiMQ96bJVCSuafn6myMR"
	Auth0DevBaseUrl  = "https://auth.nucleuscloud.dev"

	Auth0StageClientId = "IHJD9fSlrH4p9WhPYp6uJe0yFNr26ZLy"
	Auth0StageBaseUrl  = "https://auth.stage.nucleuscloud.com"

	Auth0ProdClientId = "6zk97YDDj9YplY9jqOaHmKYojhEXquD8"
	Auth0ProdBaseUrl  = "https://auth.nucleuscloud.com"

	ApiAudience = "https://api.nucleuscloud.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthClientInterface

type AuthClientInterface interface {
	ValidateToken(ctx context.Context, accessToken string) error
	GetLogoutUrl() (string, error)
	GetAuthorizeUrl(scopes []string, state string, redirectUri string, org *string) string
}

func NewAuthClient

func NewAuthClient(tenantUrl, clientId, audience string) (AuthClientInterface, error)

func NewAuthClientByEnv

func NewAuthClientByEnv(envType clienv.NucleusEnv) (AuthClientInterface, error)

type AuthDeviceResponse

type AuthDeviceResponse struct {
	DeviceCode              string `json:"device_code"`
	UserCode                string `json:"user_code"`
	VerificationURI         string `json:"verification_uri"`
	VerificationURIComplete string `json:"verification_uri_complete"`
	ExpiresIn               int    `json:"expires_in"`
	Interval                int    `json:"interval"`
}

type AuthTokenResponseData

type AuthTokenResponseData struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token,omitempty"`
	IdToken      string `json:"id_token,omitempty"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳