authorizer/server/memorystore/providers/providers.go

38 lines
1.7 KiB
Go
Raw Normal View History

2022-05-27 17:50:38 +00:00
package providers
// Provider defines current memory store provider
type Provider interface {
// SetUserSession sets the user session for given user identifier in form recipe:user_id
2022-06-11 13:40:39 +00:00
SetUserSession(userId, key, token string) error
// GetAllUserSessions returns all the user sessions from the session store
GetAllUserSessions(userId string) (map[string]string, error)
// GetUserSession returns the session token for given token
2022-06-11 18:57:21 +00:00
GetUserSession(userId, key string) (string, error)
2022-06-11 13:40:39 +00:00
// DeleteUserSession deletes the user session
2022-06-11 18:57:21 +00:00
DeleteUserSession(userId, key string) error
2022-05-27 17:50:38 +00:00
// DeleteAllSessions deletes all the sessions from the session store
2022-06-11 13:40:39 +00:00
DeleteAllUserSessions(userId string) error
2022-07-01 16:32:34 +00:00
// DeleteSessionForNamespace deletes the session for a given namespace
DeleteSessionForNamespace(namespace string) error
2022-06-11 13:40:39 +00:00
2022-05-27 17:50:38 +00:00
// SetState sets the login state (key, value form) in the session store
SetState(key, state string) error
// GetState returns the state from the session store
2022-05-29 11:52:46 +00:00
GetState(key string) (string, error)
2022-05-27 17:50:38 +00:00
// RemoveState removes the social login state from the session store
RemoveState(key string) error
2022-05-29 11:52:46 +00:00
// methods for env store
// UpdateEnvStore to update the whole env store object
UpdateEnvStore(store map[string]interface{}) error
// GetEnvStore() returns the env store object
GetEnvStore() (map[string]interface{}, error)
// UpdateEnvVariable to update the particular env variable
UpdateEnvVariable(key string, value interface{}) error
// GetStringStoreEnvVariable to get the string env variable from env store
GetStringStoreEnvVariable(key string) (string, error)
// GetBoolStoreEnvVariable to get the bool env variable from env store
GetBoolStoreEnvVariable(key string) (bool, error)
2022-05-27 17:50:38 +00:00
}