Documentation ¶
Index ¶
- Constants
- type AgentInfo
- type BoltBackend
- func (b *BoltBackend) CollectGarbage() (cnt uint, err error)
- func (b *BoltBackend) IsRevoked(session Session) (isRevoked bool, err error)
- func (b *BoltBackend) ListRevoked() (list SessionList, err error)
- func (b *BoltBackend) ListUser(username string) (list SessionFullList, err error)
- func (b *BoltBackend) LoadRevocations(list SessionList) (cnt uint, err error)
- func (b *BoltBackend) Name() string
- func (b *BoltBackend) Revoke(session Session) error
- func (b *BoltBackend) RevokeID(username string, id ulid.ULID) error
- func (b *BoltBackend) Save(session SessionFull) error
- type BoltBackendConfig
- type BoltSession
- type Config
- type Ed25519Config
- type Ed25519SignerVerifier
- type InMemoryBackend
- func (b *InMemoryBackend) CollectGarbage() (uint, error)
- func (b *InMemoryBackend) IsRevoked(session Session) (bool, error)
- func (b *InMemoryBackend) ListRevoked() (list SessionList, err error)
- func (b *InMemoryBackend) ListUser(username string) (list SessionFullList, err error)
- func (b *InMemoryBackend) LoadRevocations(list SessionList) (cnt uint, err error)
- func (b *InMemoryBackend) Name() string
- func (b *InMemoryBackend) Revoke(session Session) error
- func (b *InMemoryBackend) RevokeID(username string, id ulid.ULID) error
- func (b *InMemoryBackend) Save(session SessionFull) error
- type InMemoryBackendConfig
- type InMemorySession
- type InMemorySessionMap
- type Options
- type Session
- type SessionBase
- type SessionFull
- type SessionFullList
- type SessionList
- type SignedRevocationList
- type SignerVerifier
- type SignerVerifierConfig
- type Store
- func (st *Store) ListRevoked() (result SignedRevocationList, err error)
- func (st *Store) ListUser(username string) (SessionFullList, error)
- func (st *Store) New(username string, ai AgentInfo) (value string, opts Options, err error)
- func (st *Store) Options() (opts Options)
- func (st *Store) Revoke(session Session) error
- func (st *Store) RevokeID(username string, id ulid.ULID) error
- func (st *Store) Verify(value string) (s Session, err error)
- type StoreBackend
- type StoreBackendConfig
- type StoreSyncConfig
- type Value
Constants ¶
View Source
const ( BoltSessionsBucket = "sessions" BoltRevokedBucket = "revoked" )
View Source
const ( DefaultCookieName = "whawty-nginx-sso" DefaultExpire = 24 * time.Hour )
View Source
const ( DeviceTypeMobile = "Mobile" DeviceTypeTablet = "Tablet" DeviceTypeDesktop = "Desktop" DeviceTypeBot = "Bot" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoltBackend ¶ added in v0.3.1
type BoltBackend struct {
// contains filtered or unexported fields
}
func NewBoltBackend ¶ added in v0.3.1
func NewBoltBackend(conf *BoltBackendConfig, prom prometheus.Registerer) (*BoltBackend, error)
func (*BoltBackend) CollectGarbage ¶ added in v0.3.1
func (b *BoltBackend) CollectGarbage() (cnt uint, err error)
func (*BoltBackend) IsRevoked ¶ added in v0.3.1
func (b *BoltBackend) IsRevoked(session Session) (isRevoked bool, err error)
func (*BoltBackend) ListRevoked ¶ added in v0.3.1
func (b *BoltBackend) ListRevoked() (list SessionList, err error)
func (*BoltBackend) ListUser ¶ added in v0.3.1
func (b *BoltBackend) ListUser(username string) (list SessionFullList, err error)
func (*BoltBackend) LoadRevocations ¶ added in v0.3.1
func (b *BoltBackend) LoadRevocations(list SessionList) (cnt uint, err error)
func (*BoltBackend) Name ¶ added in v0.3.1
func (b *BoltBackend) Name() string
func (*BoltBackend) Revoke ¶ added in v0.3.1
func (b *BoltBackend) Revoke(session Session) error
func (*BoltBackend) RevokeID ¶ added in v0.3.1
func (b *BoltBackend) RevokeID(username string, id ulid.ULID) error
func (*BoltBackend) Save ¶ added in v0.3.1
func (b *BoltBackend) Save(session SessionFull) error
type BoltBackendConfig ¶ added in v0.3.1
type BoltBackendConfig struct {
Path string `yaml:"path"`
}
type BoltSession ¶ added in v0.3.1
type BoltSession struct { SessionBase Agent AgentInfo `json:"agent"` }
type Config ¶
type Config struct { Name string `yaml:"name"` Domain string `yaml:"domain"` Secure bool `yaml:"secure"` Expire time.Duration `yaml:"expire"` Keys []SignerVerifierConfig `yaml:"keys"` Backend StoreBackendConfig `yaml:"backend"` }
type Ed25519Config ¶
type Ed25519SignerVerifier ¶
type Ed25519SignerVerifier struct {
// contains filtered or unexported fields
}
func NewEd25519SignerVerifier ¶
func NewEd25519SignerVerifier(context string, conf *Ed25519Config) (*Ed25519SignerVerifier, error)
func (Ed25519SignerVerifier) Algo ¶
func (s Ed25519SignerVerifier) Algo() string
func (Ed25519SignerVerifier) CanSign ¶
func (s Ed25519SignerVerifier) CanSign() bool
func (Ed25519SignerVerifier) Sign ¶
func (s Ed25519SignerVerifier) Sign(payload []byte) ([]byte, error)
func (Ed25519SignerVerifier) Verify ¶
func (s Ed25519SignerVerifier) Verify(payload, signature []byte) error
type InMemoryBackend ¶ added in v0.3.1
type InMemoryBackend struct {
// contains filtered or unexported fields
}
func NewInMemoryBackend ¶ added in v0.3.1
func NewInMemoryBackend(conf *InMemoryBackendConfig, prom prometheus.Registerer) (*InMemoryBackend, error)
func (*InMemoryBackend) CollectGarbage ¶ added in v0.3.1
func (b *InMemoryBackend) CollectGarbage() (uint, error)
func (*InMemoryBackend) IsRevoked ¶ added in v0.3.1
func (b *InMemoryBackend) IsRevoked(session Session) (bool, error)
func (*InMemoryBackend) ListRevoked ¶ added in v0.3.1
func (b *InMemoryBackend) ListRevoked() (list SessionList, err error)
func (*InMemoryBackend) ListUser ¶ added in v0.3.1
func (b *InMemoryBackend) ListUser(username string) (list SessionFullList, err error)
func (*InMemoryBackend) LoadRevocations ¶ added in v0.3.1
func (b *InMemoryBackend) LoadRevocations(list SessionList) (cnt uint, err error)
func (*InMemoryBackend) Name ¶ added in v0.3.1
func (b *InMemoryBackend) Name() string
func (*InMemoryBackend) Revoke ¶ added in v0.3.1
func (b *InMemoryBackend) Revoke(session Session) error
func (*InMemoryBackend) RevokeID ¶ added in v0.3.1
func (b *InMemoryBackend) RevokeID(username string, id ulid.ULID) error
func (*InMemoryBackend) Save ¶ added in v0.3.1
func (b *InMemoryBackend) Save(session SessionFull) error
type InMemoryBackendConfig ¶ added in v0.3.1
type InMemoryBackendConfig struct { }
type InMemorySession ¶ added in v0.3.1
type InMemorySession struct { SessionBase Agent AgentInfo `json:"agent"` }
type InMemorySessionMap ¶ added in v0.3.1
type InMemorySessionMap map[ulid.ULID]InMemorySession
type Session ¶ added in v0.3.1
type Session struct { ID ulid.ULID `json:"id"` SessionBase }
type SessionBase ¶ added in v0.3.1
func (*SessionBase) IsExpired ¶ added in v0.3.1
func (s *SessionBase) IsExpired() bool
func (*SessionBase) SetExpiry ¶ added in v0.3.1
func (s *SessionBase) SetExpiry(lifetime time.Duration)
type SessionFull ¶ added in v0.3.1
func (SessionFull) CreatedAt ¶ added in v0.3.1
func (s SessionFull) CreatedAt() time.Time
func (SessionFull) ExpiresAt ¶ added in v0.3.1
func (s SessionFull) ExpiresAt() time.Time
type SessionFullList ¶ added in v0.3.1
type SessionFullList []SessionFull
func (SessionFullList) MarshalJSON ¶ added in v0.3.1
func (l SessionFullList) MarshalJSON() ([]byte, error)
type SessionList ¶ added in v0.3.1
type SessionList []Session
func (SessionList) MarshalJSON ¶ added in v0.3.1
func (l SessionList) MarshalJSON() ([]byte, error)
type SignedRevocationList ¶ added in v0.3.1
type SignedRevocationList struct { Revoked json.RawMessage `json:"revoked"` Signature []byte `json:"signature"` }
type SignerVerifier ¶
type SignerVerifierConfig ¶
type SignerVerifierConfig struct { Name string `yaml:"name"` Ed25519 *Ed25519Config `yaml:"ed25519"` }
type Store ¶ added in v0.3.1
type Store struct {
// contains filtered or unexported fields
}
func NewStore ¶ added in v0.3.1
func NewStore(conf *Config, prom prometheus.Registerer, infoLog, dbgLog *log.Logger) (*Store, error)
func (*Store) ListRevoked ¶ added in v0.3.1
func (st *Store) ListRevoked() (result SignedRevocationList, err error)
func (*Store) ListUser ¶ added in v0.3.1
func (st *Store) ListUser(username string) (SessionFullList, error)
type StoreBackend ¶ added in v0.3.1
type StoreBackend interface { Name() string Save(session SessionFull) error ListUser(username string) (SessionFullList, error) Revoke(session Session) error RevokeID(username string, id ulid.ULID) error IsRevoked(session Session) (bool, error) ListRevoked() (SessionList, error) LoadRevocations(SessionList) (uint, error) CollectGarbage() (uint, error) }
type StoreBackendConfig ¶ added in v0.3.1
type StoreBackendConfig struct { GCInterval time.Duration `yaml:"gc-interval"` Sync *StoreSyncConfig `yaml:"sync"` InMemory *InMemoryBackendConfig `yaml:"in-memory"` Bolt *BoltBackendConfig `yaml:"bolt"` }
type StoreSyncConfig ¶ added in v0.3.1
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func MakeValue ¶ added in v0.3.1
func MakeValue(id ulid.ULID, s SessionBase) (v *Value, err error)
func (*Value) FromString ¶
Click to show internal directories.
Click to hide internal directories.