package goidentity
import "github.com/jcmturner/goidentity/v6"
Index ¶
- Constants
- func AddToHTTPRequestContext(id Identity, r *http.Request) *http.Request
- type Authenticator
- type Identity
- type User
- func NewUser(username string) User
- func (u *User) AddAuthzAttribute(a string)
- func (u *User) Attributes() map[string]interface{}
- func (u *User) AuthTime() time.Time
- func (u *User) Authenticated() bool
- func (u *User) Authorized(a string) bool
- func (u *User) AuthzAttributes() []string
- func (u *User) DisableAuthzAttribute(a string)
- func (u *User) DisplayName() string
- func (u *User) Domain() string
- func (u *User) EnableAuthzAttribute(a string)
- func (u *User) Expired() bool
- func (u *User) Human() bool
- func (u *User) Marshal() ([]byte, error)
- func (u *User) RemoveAttribute(k string)
- func (u *User) RemoveAuthzAttribute(a string)
- func (u *User) SessionID() string
- func (u *User) SetAttribute(k string, v interface{})
- func (u *User) SetAttributes(a map[string]interface{})
- func (u *User) SetAuthTime(t time.Time)
- func (u *User) SetAuthenticated(b bool)
- func (u *User) SetDisplayName(s string)
- func (u *User) SetDomain(s string)
- func (u *User) SetExpiry(t time.Time)
- func (u *User) SetHuman(b bool)
- func (u *User) SetUserName(s string)
- func (u *User) Unmarshal(b []byte) error
- func (u *User) UserName() string
Constants ¶
const (
CTXKey = "jcmturner/goidentity"
)
Functions ¶
func AddToHTTPRequestContext ¶
Types ¶
type Authenticator ¶
type Authenticator interface { Authenticate() (Identity, bool, error) Mechanism() string // gives the name of the type of authentication mechanism }
type Identity ¶
type Identity interface { UserName() string SetUserName(s string) Domain() string SetDomain(s string) DisplayName() string SetDisplayName(s string) Human() bool SetHuman(b bool) AuthTime() time.Time SetAuthTime(t time.Time) AuthzAttributes() []string AddAuthzAttribute(a string) RemoveAuthzAttribute(a string) Authenticated() bool SetAuthenticated(b bool) Authorized(a string) bool SessionID() string Expired() bool Attributes() map[string]interface{} SetAttribute(k string, v interface{}) SetAttributes(map[string]interface{}) RemoveAttribute(k string) Marshal() ([]byte, error) Unmarshal([]byte) error }
func FromHTTPRequestContext ¶
type User ¶
type User struct {
// contains filtered or unexported fields
}
func NewUser ¶
func (*User) AddAuthzAttribute ¶
func (*User) Attributes ¶
func (*User) AuthTime ¶
func (*User) Authenticated ¶
func (*User) Authorized ¶
func (*User) AuthzAttributes ¶
func (*User) DisableAuthzAttribute ¶
func (*User) DisplayName ¶
func (*User) Domain ¶
func (*User) EnableAuthzAttribute ¶
func (*User) Expired ¶
func (*User) Human ¶
func (*User) Marshal ¶
func (*User) RemoveAttribute ¶
func (*User) RemoveAuthzAttribute ¶
func (*User) SessionID ¶
func (*User) SetAttribute ¶
func (*User) SetAttributes ¶
func (*User) SetAuthTime ¶
func (*User) SetAuthenticated ¶
func (*User) SetDisplayName ¶
func (*User) SetDomain ¶
func (*User) SetExpiry ¶
func (*User) SetHuman ¶
func (*User) SetUserName ¶
func (*User) Unmarshal ¶
func (*User) UserName ¶
Source Files ¶
authenticator.go identity.go user.go
- Version
- v6.0.1 (latest)
- Published
- Jan 19, 2020
- Platform
- darwin/amd64
- Imports
- 6 packages
- Last checked
- now –
Tools for package owners.