session

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 28 Imported by: 71

Documentation

Index

Constants

View Source
const RECIPE_ID = "session"

Variables

This section is empty.

Functions

func AfterEach added in v0.5.2

func AfterEach()

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 GetAllSessionHandlesForUser

func GetAllSessionHandlesForUser(userID string) ([]string, error)

func GetAllSessionHandlesForUserWithContext added in v0.5.0

func GetAllSessionHandlesForUserWithContext(userID string, userContext supertokens.UserContext) ([]string, 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 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 GetTopLevelDomainForSameSiteResolution

func GetTopLevelDomainForSameSiteResolution(URL string) (string, error)

func GetURLScheme added in v0.0.5

func GetURLScheme(URL string) (string, error)

func Init

func Init(config *sessmodels.TypeInput) supertokens.Recipe

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 ResetForTest

func ResetForTest()

func RevokeAllSessionsForUser

func RevokeAllSessionsForUser(userID string) ([]string, error)

func RevokeAllSessionsForUserWithContext added in v0.5.0

func RevokeAllSessionsForUserWithContext(userID string, userContext supertokens.UserContext) ([]string, error)

func RevokeMultipleSessions

func RevokeMultipleSessions(sessionHandles []string) ([]string, error)

func RevokeMultipleSessionsWithContext added in v0.5.0

func RevokeMultipleSessionsWithContext(sessionHandles []string, userContext supertokens.UserContext) ([]string, error)

func RevokeSession

func RevokeSession(sessionHandle string) (bool, error)

func RevokeSessionWithContext added in v0.5.0

func RevokeSessionWithContext(sessionHandle string, userContext supertokens.UserContext) (bool, error)

func UpdateAccessTokenPayload added in v0.1.0

func UpdateAccessTokenPayload(sessionHandle string, newAccessTokenPayload map[string]interface{}) (bool, error)

func UpdateAccessTokenPayloadWithContext added in v0.5.0

func UpdateAccessTokenPayloadWithContext(sessionHandle string, newAccessTokenPayload map[string]interface{}, userContext supertokens.UserContext) (bool, error)

func UpdateSessionData

func UpdateSessionData(sessionHandle string, newSessionData map[string]interface{}) (bool, error)

func UpdateSessionDataWithContext added in v0.5.0

func UpdateSessionDataWithContext(sessionHandle string, newSessionData map[string]interface{}, userContext supertokens.UserContext) (bool, 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
}

func MakeRecipe

func MakeRecipe(recipeId string, appInfo supertokens.NormalisedAppinfo, config *sessmodels.TypeInput, onSuperTokensAPIError func(err error, req *http.Request, res http.ResponseWriter)) (Recipe, error)

type SessionContainerInput

type SessionContainerInput struct {
	// contains filtered or unexported fields
}

type TokenInfo

type TokenInfo struct {
	Uid string      `json:"uid"`
	Ate uint64      `json:"ate"`
	Up  interface{} `json:"up"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL