identity

package
v0.0.0-...-a9e6128 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CTXKey = "github.com/pbvdven/rdpgw/common/identity"

	AttrRemoteAddr  = "remoteAddr"
	AttrClientIp    = "clientIp"
	AttrProxies     = "proxyAddresses"
	AttrAccessToken = "accessToken" // todo remove for security reasons
)

Variables

This section is empty.

Functions

func AddToRequestCtx

func AddToRequestCtx(id Identity, r *http.Request) *http.Request

Types

type Identity

type Identity interface {
	UserName() string
	SetUserName(string)
	DisplayName() string
	SetDisplayName(string)
	Domain() string
	SetDomain(string)
	Authenticated() bool
	SetAuthenticated(bool)
	AuthTime() time.Time
	SetAuthTime(time2 time.Time)
	SessionId() string
	SetAttribute(string, interface{})
	GetAttribute(string) interface{}
	Attributes() map[string]interface{}
	DelAttribute(string)
	Email() string
	SetEmail(string)
	Expiry() time.Time
	SetExpiry(time.Time)
	Marshal() ([]byte, error)
	Unmarshal([]byte) error
}

func FromCtx

func FromCtx(ctx context.Context) Identity

func FromRequestCtx

func FromRequestCtx(r *http.Request) Identity

type User

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

func NewUser

func NewUser() *User

func (*User) Attributes

func (u *User) Attributes() map[string]interface{}

func (*User) AuthTime

func (u *User) AuthTime() time.Time

func (*User) Authenticated

func (u *User) Authenticated() bool

func (*User) DelAttribute

func (u *User) DelAttribute(s string)

func (*User) DisplayName

func (u *User) DisplayName() string

func (*User) Domain

func (u *User) Domain() string

func (*User) Email

func (u *User) Email() string

func (*User) Expiry

func (u *User) Expiry() time.Time

func (*User) GetAttribute

func (u *User) GetAttribute(s string) interface{}

func (*User) Marshal

func (u *User) Marshal() ([]byte, error)

func (*User) SessionId

func (u *User) SessionId() string

func (*User) SetAttribute

func (u *User) SetAttribute(s string, i interface{})

func (*User) SetAuthTime

func (u *User) SetAuthTime(t time.Time)

func (*User) SetAuthenticated

func (u *User) SetAuthenticated(b bool)

func (*User) SetDisplayName

func (u *User) SetDisplayName(s string)

func (*User) SetDomain

func (u *User) SetDomain(s string)

func (*User) SetEmail

func (u *User) SetEmail(s string)

func (*User) SetExpiry

func (u *User) SetExpiry(t time.Time)

func (*User) SetUserName

func (u *User) SetUserName(s string)

func (*User) Unmarshal

func (u *User) Unmarshal(b []byte) error

func (*User) UserName

func (u *User) UserName() string

Jump to

Keyboard shortcuts

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