Documentation ¶
Index ¶
Constants ¶
const EnvManifoldEmail string = "MANIFOLD_EMAIL"
EnvManifoldEmail describes the environment variable name used to reference a Manifold login email
const EnvManifoldPass string = "MANIFOLD_PASS"
EnvManifoldPass describes the environment variable name used to reference a Manifold login password
const EnvManifoldToken string = "MANIFOLD_API_TOKEN"
EnvManifoldToken describes the environment variable name used to reference a Manifold api token
const EnvManifoldTokenLen int = 60
EnvManifoldTokenLen specifies the character length of a token
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authorized ¶
type Authorized struct {
// contains filtered or unexported fields
}
Authorized struct to represent an authorized user session
func (*Authorized) Authenticated ¶
func (a *Authorized) Authenticated() bool
Authenticated returns if the session is authenticated or not, in this case
true
func (*Authorized) FromEnvVars ¶
func (a *Authorized) FromEnvVars() bool
FromEnvVars returns if the session was recently authenticated from environment login variablesor not
func (*Authorized) IsUser ¶ added in v0.8.1
func (a *Authorized) IsUser() bool
IsUser returns true if the authenticated session is based on a user
func (*Authorized) LabelInfo ¶
func (a *Authorized) LabelInfo() *[]string
LabelInfo returns information used in selects for this user
func (*Authorized) User ¶
func (a *Authorized) User() *models.User
User returns the user object associated with this session, in this case nil
type Session ¶
type Session interface { Authenticated() bool FromEnvVars() bool User() *models.User IsUser() bool LabelInfo() *[]string }
Session interface to describe user session and authentication with Manifold
API
type Unauthorized ¶
type Unauthorized struct{}
Unauthorized struct to represent an unauthorized user session
func (*Unauthorized) Authenticated ¶
func (*Unauthorized) Authenticated() bool
Authenticated returns if the session is authenticated or not, in this case false
func (*Unauthorized) FromEnvVars ¶
func (*Unauthorized) FromEnvVars() bool
FromEnvVars returns if the session was recently authenticated from environment login variablesor not, in this case false
func (*Unauthorized) IsUser ¶ added in v0.8.1
func (*Unauthorized) IsUser() bool
IsUser returns true if the authenticated session is based on a user
func (*Unauthorized) LabelInfo ¶
func (*Unauthorized) LabelInfo() *[]string
LabelInfo returns information used in selects for this user
func (*Unauthorized) User ¶
func (*Unauthorized) User() *models.User
User returns the user object associated with this session, in this case nil