factors

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2017 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factors

type Factors []struct {
	FactorType   string   `json:"type"`
	ID           string   `json:"id,omitempty"`
	Value        string   `json:"value"`
	Capabilities []string `json:"capabilities,omitempty"`
}

Factors :

Struct of factor data returned by the users endpoint.

type Request

type Request struct{}

Request :

Empty Request struct to allow easy use for Get func.

func (*Request) Get

func (r *Request) Get(c *sa.Client, user string) (*Response, error)

Get :

Executes a get to the users endpoint.

Parameters:

[Required] r: empty struct used to make Get easy.
[Required] c: passing in the client containing authorization and host information.
[Required] user: the user you want to get factor information for.

Returns:

Response: Struct marshaled from the Json response from the API endpoints.
Error: If an error is encountered, response will be nil and the error must be handled.

type Response

type Response struct {
	UserID       string         `json:"user_id"`
	Status       string         `json:"status"`
	Message      string         `json:"message"`
	Factors      Factors        `json:"factors,omitempty"`
	RawJSON      string         `json:"-"`
	HTTPResponse *http.Response `json:"-"`
}

Response :

Response struct that will be populated after the post request.

func (*Response) IsSignatureValid added in v1.1.0

func (r *Response) IsSignatureValid(c *sa.Client) (bool, error)

IsSignatureValid :

Helper function to validate the SecureAuth Response signature in X-SA-SIGNATURE

Parameters:

[Required] r: response struct with HTTPResponse
[Required] c: passing in the client with application id and key

Returns:

bool: if true, computed signature matches X-SA-SIGNATURE. if false, computed signature does not match.
error: If an error is encountered, bool will be false and the error must be handled.

Jump to

Keyboard shortcuts

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