Documentation
¶
Index ¶
- func Delete(contextName string) error
- func Exists(contextName string) bool
- func FmtFilename(contextName string) string
- func GetAll() map[string]Entry
- func ModTime(contextName string) (time.Time, error)
- func OpenStore(backend tokenstore.Backend) (tokenstore.Store, error)
- func ReconnectError(srcErr error, contextName string) error
- func Save(contextName string, token Entry) error
- func SaveShared(token Entry) error
- type Entry
- type OpenID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
Delete forgets the tokens of a context. The tokens an openid context shares with others are kept for them, and forgotten with the last of them.
func FmtFilename ¶
func OpenStore ¶
func OpenStore(backend tokenstore.Backend) (tokenstore.Store, error)
OpenStore returns the store of a backend, or the first usable one when backend is empty.
func ReconnectError ¶
ReconnectError says a cached token could not be used, and names the command that renews it.
That command is always ox, whichever program is reporting: only ox manages the client contexts, so an om reading a context whose token expired is fixed with ox too.
func SaveShared ¶
SaveShared saves the tokens of an openid entry in the store its reference names, for the contexts reading them there, without touching the file of any context.
Types ¶
type Entry ¶
type Entry struct {
AccessTokenExpire time.Time `json:"access_expired_at"`
AccessToken string `json:"access_token"`
AccessTokenDuration *duration.Duration `json:"access_token_duration,omitempty"`
RefreshTokenExpire time.Time `json:"refresh_expired_at"`
RefreshToken string `json:"refresh_token"`
// OpenID is set when the tokens were issued by the openid issuer the
// cluster trusts, rather than by the cluster. They are then shared by
// the contexts logging in at the same issuer and client, kept in the
// token store OpenID names, and only this reference is in the file of
// the context.
OpenID *OpenID `json:"openid,omitempty"`
}
func FindOpenID ¶
FindOpenID returns the tokens some context logged in at the issuer and client, in any usable store, so another context of the same issuer and client logs in with them, without a challenge. It returns nil when there are none.