Documentation ¶
Index ¶
- Constants
- func AfterEach()
- func BeforeEach()
- func CreateJWT(payload map[string]interface{}, validitySecondsPointer *uint64) (jwtmodels.CreateJWTResponse, error)
- func CreateJWTWithContext(payload map[string]interface{}, validitySecondsPointer *uint64, ...) (jwtmodels.CreateJWTResponse, error)
- func CreateNewSession(res http.ResponseWriter, userID string, ...) (sessmodels.SessionContainer, error)
- func CreateNewSessionWithContext(res http.ResponseWriter, userID string, ...) (sessmodels.SessionContainer, error)
- func FetchAndSetClaim(sessionHandle string, claim *claims.TypeSessionClaim) (bool, error)
- func FetchAndSetClaimWithContext(sessionHandle string, claim *claims.TypeSessionClaim, ...) (bool, error)
- func GetAllSessionHandlesForUser(userID string) ([]string, error)
- func GetAllSessionHandlesForUserWithContext(userID string, userContext supertokens.UserContext) ([]string, error)
- func GetClaimValue(sessionHandle string, claim *claims.TypeSessionClaim) (sessmodels.GetClaimValueResult, error)
- func GetClaimValueWithContext(sessionHandle string, claim *claims.TypeSessionClaim, ...) (sessmodels.GetClaimValueResult, error)
- func GetJWKS() (jwtmodels.GetJWKSResponse, error)
- func GetJWKSWithContext(userContext supertokens.UserContext) (jwtmodels.GetJWKSResponse, error)
- func GetOpenIdDiscoveryConfiguration() (openidmodels.GetOpenIdDiscoveryConfigurationResponse, error)
- func GetOpenIdDiscoveryConfigurationWithContext(userContext supertokens.UserContext) (openidmodels.GetOpenIdDiscoveryConfigurationResponse, error)
- func GetSession(req *http.Request, res http.ResponseWriter, ...) (sessmodels.SessionContainer, error)
- func GetSessionFromRequestContext(ctx context.Context) sessmodels.SessionContainer
- func GetSessionInformation(sessionHandle string) (*sessmodels.SessionInformation, error)
- func GetSessionInformationWithContext(sessionHandle string, userContext supertokens.UserContext) (*sessmodels.SessionInformation, error)
- func GetSessionWithContext(req *http.Request, res http.ResponseWriter, ...) (sessmodels.SessionContainer, error)
- func GetTopLevelDomainForSameSiteResolution(URL string) (string, error)
- func GetURLScheme(URL string) (string, error)
- func Init(config *sessmodels.TypeInput) supertokens.Recipe
- func MergeIntoAccessTokenPayload(sessionHandle string, accessTokenPayloadUpdate map[string]interface{}) (bool, error)
- func MergeIntoAccessTokenPayloadWithContext(sessionHandle string, accessTokenPayloadUpdate map[string]interface{}, ...) (bool, error)
- func RefreshSession(req *http.Request, res http.ResponseWriter) (sessmodels.SessionContainer, error)
- func RefreshSessionWithContext(req *http.Request, res http.ResponseWriter, ...) (sessmodels.SessionContainer, error)
- func RegenerateAccessToken(accessToken string, newAccessTokenPayload *map[string]interface{}, ...) (*sessmodels.RegenerateAccessTokenResponse, error)
- func RegenerateAccessTokenWithContext(accessToken string, newAccessTokenPayload *map[string]interface{}, ...) (*sessmodels.RegenerateAccessTokenResponse, error)
- func RemoveClaim(sessionHandle string, claim *claims.TypeSessionClaim) (bool, error)
- func RemoveClaimWithContext(sessionHandle string, claim *claims.TypeSessionClaim, ...) (bool, error)
- func ResetForTest()
- func RevokeAllSessionsForUser(userID string) ([]string, error)
- func RevokeAllSessionsForUserWithContext(userID string, userContext supertokens.UserContext) ([]string, error)
- func RevokeMultipleSessions(sessionHandles []string) ([]string, error)
- func RevokeMultipleSessionsWithContext(sessionHandles []string, userContext supertokens.UserContext) ([]string, error)
- func RevokeSession(sessionHandle string) (bool, error)
- func RevokeSessionWithContext(sessionHandle string, userContext supertokens.UserContext) (bool, error)
- func SetClaimValue(sessionHandle string, claim *claims.TypeSessionClaim, value interface{}) (bool, error)
- func SetClaimValueWithContext(sessionHandle string, claim *claims.TypeSessionClaim, value interface{}, ...) (bool, error)
- func UpdateAccessTokenPayload(sessionHandle string, newAccessTokenPayload map[string]interface{}) (bool, error)deprecated
- func UpdateAccessTokenPayloadWithContext(sessionHandle string, newAccessTokenPayload map[string]interface{}, ...) (bool, error)deprecated
- func UpdateSessionData(sessionHandle string, newSessionData map[string]interface{}) (bool, error)
- func UpdateSessionDataWithContext(sessionHandle string, newSessionData map[string]interface{}, ...) (bool, error)
- func ValidateClaimsForSessionHandle(sessionHandle string, ...) (sessmodels.ValidateClaimsResponse, error)
- func ValidateClaimsForSessionHandleWithContext(sessionHandle string, ...) (sessmodels.ValidateClaimsResponse, error)
- func ValidateClaimsInJWTPayload(userID string, jwtPayload map[string]interface{}, ...) ([]claims.ClaimValidationError, error)
- func ValidateClaimsInJWTPayloadWithContext(userID string, jwtPayload map[string]interface{}, ...) ([]claims.ClaimValidationError, error)
- func VerifySession(options *sessmodels.VerifySessionOptions, otherHandler http.HandlerFunc) http.HandlerFunc
- func VerifySessionHelper(recipeInstance Recipe, options *sessmodels.VerifySessionOptions, ...) http.HandlerFunc
- type Recipe
- type SessionContainerInput
- type TokenInfo
Constants ¶
View Source
const RECIPE_ID = "session"
Variables ¶
This section is empty.
Functions ¶
func BeforeEach ¶ added in v0.5.2
func BeforeEach()
func CreateJWT ¶ added in v0.3.2
func CreateJWT(payload map[string]interface{}, validitySecondsPointer *uint64) (jwtmodels.CreateJWTResponse, error)
func CreateJWTWithContext ¶ added in v0.5.0
func CreateJWTWithContext(payload map[string]interface{}, validitySecondsPointer *uint64, userContext supertokens.UserContext) (jwtmodels.CreateJWTResponse, error)
func CreateNewSession ¶
func CreateNewSession(res http.ResponseWriter, userID string, accessTokenPayload map[string]interface{}, sessionData map[string]interface{}) (sessmodels.SessionContainer, error)
func CreateNewSessionWithContext ¶ added in v0.5.0
func CreateNewSessionWithContext(res http.ResponseWriter, userID string, accessTokenPayload map[string]interface{}, sessionData map[string]interface{}, userContext supertokens.UserContext) (sessmodels.SessionContainer, error)
func FetchAndSetClaim ¶ added in v0.9.0
func FetchAndSetClaim(sessionHandle string, claim *claims.TypeSessionClaim) (bool, error)
func FetchAndSetClaimWithContext ¶ added in v0.9.0
func FetchAndSetClaimWithContext(sessionHandle string, claim *claims.TypeSessionClaim, userContext supertokens.UserContext) (bool, error)
func GetAllSessionHandlesForUserWithContext ¶ added in v0.5.0
func GetAllSessionHandlesForUserWithContext(userID string, userContext supertokens.UserContext) ([]string, error)
func GetClaimValue ¶ added in v0.9.0
func GetClaimValue(sessionHandle string, claim *claims.TypeSessionClaim) (sessmodels.GetClaimValueResult, error)
func GetClaimValueWithContext ¶ added in v0.9.0
func GetClaimValueWithContext(sessionHandle string, claim *claims.TypeSessionClaim, userContext supertokens.UserContext) (sessmodels.GetClaimValueResult, error)
func GetJWKS ¶ added in v0.3.2
func GetJWKS() (jwtmodels.GetJWKSResponse, error)
func GetJWKSWithContext ¶ added in v0.5.0
func GetJWKSWithContext(userContext supertokens.UserContext) (jwtmodels.GetJWKSResponse, error)
func GetOpenIdDiscoveryConfiguration ¶ added in v0.3.2
func GetOpenIdDiscoveryConfiguration() (openidmodels.GetOpenIdDiscoveryConfigurationResponse, error)
func GetOpenIdDiscoveryConfigurationWithContext ¶ added in v0.5.0
func GetOpenIdDiscoveryConfigurationWithContext(userContext supertokens.UserContext) (openidmodels.GetOpenIdDiscoveryConfigurationResponse, error)
func GetSession ¶
func GetSession(req *http.Request, res http.ResponseWriter, options *sessmodels.VerifySessionOptions) (sessmodels.SessionContainer, error)
func GetSessionFromRequestContext ¶
func GetSessionFromRequestContext(ctx context.Context) sessmodels.SessionContainer
func GetSessionInformation ¶
func GetSessionInformation(sessionHandle string) (*sessmodels.SessionInformation, error)
func GetSessionInformationWithContext ¶ added in v0.5.0
func GetSessionInformationWithContext(sessionHandle string, userContext supertokens.UserContext) (*sessmodels.SessionInformation, error)
func GetSessionWithContext ¶ added in v0.5.0
func GetSessionWithContext(req *http.Request, res http.ResponseWriter, options *sessmodels.VerifySessionOptions, userContext supertokens.UserContext) (sessmodels.SessionContainer, error)
func GetURLScheme ¶ added in v0.0.5
func Init ¶
func Init(config *sessmodels.TypeInput) supertokens.Recipe
func MergeIntoAccessTokenPayload ¶ added in v0.9.0
func MergeIntoAccessTokenPayloadWithContext ¶ added in v0.9.0
func MergeIntoAccessTokenPayloadWithContext(sessionHandle string, accessTokenPayloadUpdate map[string]interface{}, userContext supertokens.UserContext) (bool, error)
func RefreshSession ¶
func RefreshSession(req *http.Request, res http.ResponseWriter) (sessmodels.SessionContainer, error)
func RefreshSessionWithContext ¶ added in v0.5.0
func RefreshSessionWithContext(req *http.Request, res http.ResponseWriter, userContext supertokens.UserContext) (sessmodels.SessionContainer, error)
func RegenerateAccessToken ¶ added in v0.5.0
func RegenerateAccessToken(accessToken string, newAccessTokenPayload *map[string]interface{}, sessionHandle string) (*sessmodels.RegenerateAccessTokenResponse, error)
func RegenerateAccessTokenWithContext ¶ added in v0.5.0
func RegenerateAccessTokenWithContext(accessToken string, newAccessTokenPayload *map[string]interface{}, sessionHandle string, userContext supertokens.UserContext) (*sessmodels.RegenerateAccessTokenResponse, error)
func RemoveClaim ¶ added in v0.9.0
func RemoveClaim(sessionHandle string, claim *claims.TypeSessionClaim) (bool, error)
func RemoveClaimWithContext ¶ added in v0.9.0
func RemoveClaimWithContext(sessionHandle string, claim *claims.TypeSessionClaim, userContext supertokens.UserContext) (bool, error)
func ResetForTest ¶
func ResetForTest()
func RevokeAllSessionsForUserWithContext ¶ added in v0.5.0
func RevokeAllSessionsForUserWithContext(userID string, userContext supertokens.UserContext) ([]string, error)
func RevokeMultipleSessions ¶
func RevokeMultipleSessionsWithContext ¶ added in v0.5.0
func RevokeMultipleSessionsWithContext(sessionHandles []string, userContext supertokens.UserContext) ([]string, error)
func RevokeSession ¶
func RevokeSessionWithContext ¶ added in v0.5.0
func RevokeSessionWithContext(sessionHandle string, userContext supertokens.UserContext) (bool, error)
func SetClaimValue ¶ added in v0.9.0
func SetClaimValue(sessionHandle string, claim *claims.TypeSessionClaim, value interface{}) (bool, error)
func SetClaimValueWithContext ¶ added in v0.9.0
func SetClaimValueWithContext(sessionHandle string, claim *claims.TypeSessionClaim, value interface{}, userContext supertokens.UserContext) (bool, error)
func UpdateAccessTokenPayload
deprecated
added in
v0.1.0
func UpdateAccessTokenPayloadWithContext
deprecated
added in
v0.5.0
func UpdateAccessTokenPayloadWithContext(sessionHandle string, newAccessTokenPayload map[string]interface{}, userContext supertokens.UserContext) (bool, error)
Deprecated: use MergeIntoAccessTokenPayloadWithContext instead
func UpdateSessionData ¶
func UpdateSessionDataWithContext ¶ added in v0.5.0
func UpdateSessionDataWithContext(sessionHandle string, newSessionData map[string]interface{}, userContext supertokens.UserContext) (bool, error)
func ValidateClaimsForSessionHandle ¶ added in v0.9.0
func ValidateClaimsForSessionHandle( sessionHandle string, overrideGlobalClaimValidators func(globalClaimValidators []claims.SessionClaimValidator, sessionInfo sessmodels.SessionInformation, userContext supertokens.UserContext) []claims.SessionClaimValidator, ) (sessmodels.ValidateClaimsResponse, error)
func ValidateClaimsForSessionHandleWithContext ¶ added in v0.9.0
func ValidateClaimsForSessionHandleWithContext( sessionHandle string, overrideGlobalClaimValidators func(globalClaimValidators []claims.SessionClaimValidator, sessionInfo sessmodels.SessionInformation, userContext supertokens.UserContext) []claims.SessionClaimValidator, userContext supertokens.UserContext, ) (sessmodels.ValidateClaimsResponse, error)
func ValidateClaimsInJWTPayload ¶ added in v0.9.0
func ValidateClaimsInJWTPayload( userID string, jwtPayload map[string]interface{}, overrideGlobalClaimValidators func(globalClaimValidators []claims.SessionClaimValidator, userID string, userContext supertokens.UserContext) []claims.SessionClaimValidator, ) ([]claims.ClaimValidationError, error)
func ValidateClaimsInJWTPayloadWithContext ¶ added in v0.9.0
func ValidateClaimsInJWTPayloadWithContext( userID string, jwtPayload map[string]interface{}, overrideGlobalClaimValidators func(globalClaimValidators []claims.SessionClaimValidator, userID string, userContext supertokens.UserContext) []claims.SessionClaimValidator, userContext supertokens.UserContext, ) ([]claims.ClaimValidationError, error)
func VerifySession ¶
func VerifySession(options *sessmodels.VerifySessionOptions, otherHandler http.HandlerFunc) http.HandlerFunc
func VerifySessionHelper ¶
func VerifySessionHelper(recipeInstance Recipe, options *sessmodels.VerifySessionOptions, otherHandler http.HandlerFunc) http.HandlerFunc
Types ¶
type Recipe ¶
type Recipe struct { RecipeModule supertokens.RecipeModule Config sessmodels.TypeNormalisedInput RecipeImpl sessmodels.RecipeInterface OpenIdRecipe *openid.Recipe APIImpl sessmodels.APIInterface // contains filtered or unexported fields }
func GetRecipeInstanceOrThrowError ¶ added in v0.9.0
func MakeRecipe ¶
func MakeRecipe(recipeId string, appInfo supertokens.NormalisedAppinfo, config *sessmodels.TypeInput, onSuperTokensAPIError func(err error, req *http.Request, res http.ResponseWriter)) (Recipe, error)
func (*Recipe) AddClaimFromOtherRecipe ¶ added in v0.9.0
func (r *Recipe) AddClaimFromOtherRecipe(claim *claims.TypeSessionClaim) error
Claim functions
func (*Recipe) AddClaimValidatorFromOtherRecipe ¶ added in v0.9.0
func (r *Recipe) AddClaimValidatorFromOtherRecipe(validator claims.SessionClaimValidator) error
type SessionContainerInput ¶
type SessionContainerInput struct {
// contains filtered or unexported fields
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.