authorizer/server/memorystore/providers/providers.go

44 lines
2.0 KiB
Go
Raw Permalink 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
2023-04-08 07:36:15 +00:00
SetUserSession(userId, key, token string, expiration int64) error
2022-06-11 13:40:39 +00:00
// 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
2023-07-24 03:58:36 +00:00
// SetMfaSession sets the mfa session with key and value of userId
SetMfaSession(userId, key string, expiration int64) error
2023-07-23 05:02:14 +00:00
// GetMfaSession returns value of given mfa session
2023-07-24 03:58:36 +00:00
GetMfaSession(userId, key string) (string, error)
2023-07-23 05:02:14 +00:00
// DeleteMfaSession deletes given mfa session from in-memory store.
2023-07-24 03:58:36 +00:00
DeleteMfaSession(userId, key string) error
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)
2024-02-22 08:51:20 +00:00
GetUserAppDataFromRedis(userId string) (string, error)
2022-05-27 17:50:38 +00:00
}