Documentation ¶
Index ¶
- Constants
- func DestroyToken(rData *pages.RequestData) error
- func GetFinalDurationByAudience(audience string) int64
- func GetInitialDurationByAudience(audience string) int64
- func GetJwtFromDb(rData *pages.RequestData, keyVal interface{}) (*datastore.JwtRecord, bool)
- func GetJwtFromString(rData *pages.RequestData, jwtString string, forceDbCheck bool) (*datastore.JwtRecord, bool)
- func GetNewLoginJWT(rData *pages.RequestData, userRecord *datastore.UserRecord, audience string) (*datastore.JwtRecord, string, error)
- func GetNewSystemsOobJWT(rData *pages.RequestData, systemId int64, scopes int64, extra string) (*datastore.JwtRecord, string, error)
- func GetNewUserOobJWT(rData *pages.RequestData, userRecord *datastore.UserRecord, scopes int64, ...) (*datastore.JwtRecord, string, error)
- func SetJWTCookie(rData *pages.RequestData, jwtString string, sid string, duration int)
- func SignJwt(ctx context.Context, jwtRecord *datastore.JwtRecord) (string, error)
- func UnsetJWTCookie(rData *pages.RequestData)
- func ValidatePageRequest(rData *pages.RequestData) (bool, bool)
- func ValidateUserType(rData *pages.RequestData, jwtRecord *datastore.JwtRecord) (bool, interface{})
- type SigningMethodAppEngine
Constants ¶
View Source
const ( //descripes how the userid is used JWT_USERTYPE_USER_RECORD string = "usr" JWT_USERTYPE_SYSTEM_ID string = "sys" JWT_DURATION_SHORT int64 = 3600 JWT_DURATION_LONG int64 = 604800 JWT_DURATION_NEVER int64 = -1 REQUEST_SOURCE_APPENGINE_TASK string = "appengine-task" JWT_AUDIENCE_COOKIE string = "cookie" //will vet cookie / header, does not necessarily vet against db JWT_AUDIENCE_APP string = "app" //for app usual usage, does not necessarily vet against db JWT_AUDIENCE_OOB string = "oob" //for passing around via email, page embeds, etc. - always vets against db )
View Source
const (
SYSTEM_ID_OAUTH
)
Variables ¶
This section is empty.
Functions ¶
func DestroyToken ¶
func DestroyToken(rData *pages.RequestData) error
func GetJwtFromDb ¶
func GetJwtFromDb(rData *pages.RequestData, keyVal interface{}) (*datastore.JwtRecord, bool)
func GetJwtFromString ¶
func GetNewLoginJWT ¶
func GetNewLoginJWT(rData *pages.RequestData, userRecord *datastore.UserRecord, audience string) (*datastore.JwtRecord, string, error)
func GetNewSystemsOobJWT ¶
func GetNewUserOobJWT ¶
func GetNewUserOobJWT(rData *pages.RequestData, userRecord *datastore.UserRecord, scopes int64, extraMap map[string]interface{}) (*datastore.JwtRecord, string, error)
func SetJWTCookie ¶
func SetJWTCookie(rData *pages.RequestData, jwtString string, sid string, duration int)
func UnsetJWTCookie ¶
func UnsetJWTCookie(rData *pages.RequestData)
func ValidatePageRequest ¶
func ValidatePageRequest(rData *pages.RequestData) (bool, bool)
func ValidateUserType ¶
func ValidateUserType(rData *pages.RequestData, jwtRecord *datastore.JwtRecord) (bool, interface{})
Types ¶
type SigningMethodAppEngine ¶
type SigningMethodAppEngine struct{}
Implements the built-in AppEngine signing method This method uses a private key unique to your AppEngine application and the key may rotate from time to time. https://cloud.google.com/appengine/docs/go/reference#SignBytes https://cloud.google.com/appengine/docs/go/appidentity/#Go_Asserting_identity_to_other_systems
func (*SigningMethodAppEngine) Alg ¶
func (s *SigningMethodAppEngine) Alg() string
func (*SigningMethodAppEngine) Sign ¶
func (s *SigningMethodAppEngine) Sign(signingString string, key interface{}) (string, error)
Implements the Sign method from SigningMethod For this signing method, a valid appengine.Context must be passed as the key.
func (*SigningMethodAppEngine) Verify ¶
func (s *SigningMethodAppEngine) Verify(signingString, signature string, key interface{}) error
Implements the Verify method from SigningMethod For this signing method, a valid appengine.Context must be passed as the key.
Click to show internal directories.
Click to hide internal directories.