auth

package
v0.3.6-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthCookies

func GetAuthCookies() (string, error)

func GetEntitlementToken

func GetEntitlementToken() (string, error)

Types

type AuthCookiesRequestBody

type AuthCookiesRequestBody struct {
	ClientID     string `json:"client_id"`
	Nonce        string `json:"nonce"`
	RedirectUri  string `json:"redirect_uri"`
	ResponseType string `json:"response_type"`
	Scope        string `json:"scope"`
}

type AuthCookiesResponseBody

type AuthCookiesResponseBody struct {
	Type    string `json:"type"`
	Country string `json:"country"`
}

type Entitlements

type Entitlements struct {
	Entitlements []string `json:"entitlements"`
	Hash         string   `json:"at_hash"`
	Subject      string   `json:"sub"`
	Issuer       string   `json:"iss"`
	IssuedAt     int      `json:"iat"`
	JTI          string   `json:"jti"`
}

func GetEntitlementsFromToken

func GetEntitlementsFromToken(entitlement string) (*Entitlements, error)

type EntitlementsResponseBody

type EntitlementsResponseBody struct {
	Token string `json:"entitlements_token"`
}

type LoginRequestBody

type LoginRequestBody struct {
	Type     string `json:"type"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type LoginResponseBody

type LoginResponseBody struct {
	Type     string                    `json:"type"`
	Response LoginResponseBodyResponse `json:"response"`
	Country  string                    `json:"country"`
}

type LoginResponseBodyResponse

type LoginResponseBodyResponse struct {
	Mode       string `json:"mode"`
	Parameters struct {
		Uri string `json:"uri"`
	} `json:"parameters"`
}

type LoginUriTokens

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

func Login

func Login(username, password string) (*LoginUriTokens, string, error)

Jump to

Keyboard shortcuts

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