universal_sdk

package
v0.0.0-...-690b1ba Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BodyToken

type BodyToken struct {
	IdToken     string `json:"id_token"`
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
	TokenType   string `json:"token_type"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(clientId, clientSecret, apiHost, redirectUri string) (*Client, error)

func (*Client) CreateAuthURL

func (client *Client) CreateAuthURL(username, state, action, ip, ua string) (string, error)

func (*Client) GenerateState

func (client *Client) GenerateState() (string, error)

Return a cryptographically-secure string of random characters with the default length

func (*Client) GenerateStateWithLength

func (client *Client) GenerateStateWithLength(length int) (string, error)

Return a cryptographically-secure string of random characters suitable for use in state values. length is the number of characters in the randomly generated string

func (*Client) GetTokenResponse

func (client *Client) GetTokenResponse(code string, username string) (*TokenResponse, error)

func (*Client) HealthCheck

func (client *Client) HealthCheck(username, action, ip, ua string) (*HealthCheckResponse, error)

type HealthCheckResponse

type HealthCheckResponse struct {
	Stat          string `json:"stat"`
	Code          string `json:"code"`
	Timestamp     int    `json:"timestamp"`
	Message       string `json:"message"`
	MessageDetail string `json:"message_detail"`
}

type MapClaims

type MapClaims map[string]interface{}

type ResponseMessage

type ResponseMessage struct {
	Code string                 `json:"code"`
	Msg  string                 `json:"msg"`
	Data map[string]interface{} `json:"data"`
}

type TokenResponse

type TokenResponse struct {
	Id              string `json:"jti"`
	AuthTime        int    `json:"auth_time"`
	Audience        string `json:"aud"`
	AuthorizedParty string `json:"azp"`
	Issuer          string `json:"iss"`
	Subject         string `json:"sub"`
	IssuedAt        int64  `json:"iat"`
	ExpiresAt       int64  `json:"exp"`
}

Jump to

Keyboard shortcuts

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