sso

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultVerificationOptions = VerificationOptions{SkipNodeClaimCheck: false}

DefaultVerificationOptions default options

View Source
var ErrAuthorizationGrantTokenMissing = errors.New("token must be set")

ErrAuthorizationGrantTokenMissing blank authorization token

View Source
var ErrCodeVerifierMissing = errors.New("no code verifier generated")

ErrCodeVerifierMissing code verifier is missing

View Source
var ErrMystnodesAuthorizationFail = errors.New("mystnodes SSO grant authorization verification failed")

ErrMystnodesAuthorizationFail authorization failed against mystnodes

View Source
var ErrNoUnlockedIdentity = errors.New("lastUnlockedIdentity must not be empty")

ErrNoUnlockedIdentity no unlocked identity

View Source
var ErrRedirectMissing = errors.New("host must not be empty")

ErrRedirectMissing host can't be blank

Functions

This section is empty.

Types

type Mystnodes

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

Mystnodes SSO support

func NewMystnodes

func NewMystnodes(signer identity.SignerFactory, client httpClient) *Mystnodes

NewMystnodes constructor

func (m *Mystnodes) SSOLink(redirectURL *url.URL) (*url.URL, error)

SSOLink build SSO link to begin authentication via mystnodes.com

func (*Mystnodes) Subscribe

func (m *Mystnodes) Subscribe(eventBus eventbus.EventBus) error

Subscribe unlocked identity is required in order to sign request

func (*Mystnodes) VerifyAuthorizationGrant

func (m *Mystnodes) VerifyAuthorizationGrant(authorizationGrantToken string, opts VerificationOptions) (VerifyInfo, error)

VerifyAuthorizationGrant verifies authorization grant against mystnodes.com using PKCE workflow

type MystnodesMessage

type MystnodesMessage struct {
	CodeChallenge string `json:"codeChallenge"`
	Identity      string `json:"identity"`
	RedirectURL   string `json:"redirectUrl"` // http://guillem.nodeUI
}

MystnodesMessage expected by mystnodes.com

func (MystnodesMessage) JSON

func (msg MystnodesMessage) JSON() ([]byte, error)

JSON convenience receiver to convert MystnodesMessage struct to []byte

type VerificationOptions

type VerificationOptions struct {
	SkipNodeClaimCheck bool
}

VerificationOptions options

type VerifyInfo

type VerifyInfo struct {
	APIkey                        string `json:"apiKey"`
	WalletAddress                 string `json:"walletAddress"`
	IsEligibleForFreeRegistration bool   `json:"isEligibleForFreeRegistration"`
}

VerifyInfo information gathered during grant verification

Jump to

Keyboard shortcuts

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