Documentation ¶
Index ¶
- func CheckCapabilityAndRestriction(tx *sqlx.Tx, mt *mytoken.Mytoken, ip string, scopes, auds []string, ...) (*restrictions.Restriction, *model.Response)
- func RequireCapability(capability api.Capability, mt *mytoken.Mytoken) *model.Response
- func RequireGrantType(want, got model2.GrantType) *model.Response
- func RequireMatchingIssuer(mtOIDCIssuer string, requestIssuer *string) (*config.ProviderConf, *model.Response)
- func RequireMytoken(reqToken *universalmytoken.UniversalMytoken, ctx *fiber.Ctx) (*mytoken.Mytoken, *model.Response)
- func RequireMytokenNotRevoked(tx *sqlx.Tx, mt *mytoken.Mytoken) *model.Response
- func RequireUsableRestriction(tx *sqlx.Tx, mt *mytoken.Mytoken, ip string, scopes, auds []string, ...) (*restrictions.Restriction, *model.Response)
- func RequireUsableRestrictionAT(tx *sqlx.Tx, mt *mytoken.Mytoken, ip string, scopes, auds []string) (*restrictions.Restriction, *model.Response)
- func RequireUsableRestrictionOther(tx *sqlx.Tx, mt *mytoken.Mytoken, ip string, scopes, auds []string) (*restrictions.Restriction, *model.Response)
- func RequireValidMytoken(tx *sqlx.Tx, reqToken *universalmytoken.UniversalMytoken, ctx *fiber.Ctx) (*mytoken.Mytoken, *model.Response)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCapabilityAndRestriction ¶
func CheckCapabilityAndRestriction(tx *sqlx.Tx, mt *mytoken.Mytoken, ip string, scopes, auds []string, capability api.Capability) (*restrictions.Restriction, *model.Response)
CheckCapabilityAndRestriction checks the mytoken.Mytoken's capability and restrictions
func RequireCapability ¶
RequireCapability checks that the passed mytoken.Mytoken has the required api.Capability and returns an error model.Response if not
func RequireGrantType ¶
RequireGrantType checks that the passed model.GrantType are the same, and returns an error model.Response if not
func RequireMatchingIssuer ¶
func RequireMatchingIssuer(mtOIDCIssuer string, requestIssuer *string) (*config.ProviderConf, *model.Response)
RequireMatchingIssuer checks that the OIDC issuer from a mytoken is the same as the issuer string in a request (if given). RequireMatchingIssuer also checks that the issuer is valid for this mytoken instance.
func RequireMytoken ¶
func RequireMytoken(reqToken *universalmytoken.UniversalMytoken, ctx *fiber.Ctx) (*mytoken.Mytoken, *model.Response)
RequireMytoken checks the passed universalmytoken.UniversalMytoken and if needed other request parameters like authorization header and cookie value for a mytoken string. The mytoken string is parsed and if not valid an error model.Response is returned.
func RequireMytokenNotRevoked ¶
RequireMytokenNotRevoked checks that the passed mytoken.Mytoken was not revoked, if it was an error model.Response is returned.
func RequireUsableRestriction ¶
func RequireUsableRestriction(tx *sqlx.Tx, mt *mytoken.Mytoken, ip string, scopes, auds []string, capability api.Capability) (*restrictions.Restriction, *model.Response)
RequireUsableRestriction checks that the mytoken.Mytoken's restrictions allow the usage
func RequireUsableRestrictionAT ¶
func RequireUsableRestrictionAT(tx *sqlx.Tx, mt *mytoken.Mytoken, ip string, scopes, auds []string) (*restrictions.Restriction, *model.Response)
RequireUsableRestrictionAT checks that the mytoken.Mytoken's restrictions allow the AT usage
func RequireUsableRestrictionOther ¶
func RequireUsableRestrictionOther(tx *sqlx.Tx, mt *mytoken.Mytoken, ip string, scopes, auds []string) (*restrictions.Restriction, *model.Response)
RequireUsableRestrictionOther checks that the mytoken.Mytoken's restrictions allow the non-AT usage
func RequireValidMytoken ¶
func RequireValidMytoken(tx *sqlx.Tx, reqToken *universalmytoken.UniversalMytoken, ctx *fiber.Ctx) (*mytoken.Mytoken, *model.Response)
RequireValidMytoken checks the passed universalmytoken.UniversalMytoken and if needed other request parameters like authorization header and cookie value for a mytoken string. The mytoken string is parsed and if not valid an error model.Response is returned. RequireValidMytoken also asserts that the mytoken.Mytoken was not revoked.
Types ¶
This section is empty.