Documentation ¶
Index ¶
- Constants
- Variables
- type Response
- type RestrictionClaim
- func (rc RestrictionClaim) MarshalJSON() ([]byte, error)
- func (rc *RestrictionClaim) String() string
- func (rc *RestrictionClaim) UnmarshalJSON(data []byte) error
- func (rc *RestrictionClaim) UnmarshalText(data []byte) error
- func (rc *RestrictionClaim) UnmarshalYAML(value *yaml.Node) error
- func (rc *RestrictionClaim) Valid() bool
- type RestrictionClaims
Constants ¶
const ( AttrScope = "scope" AttrAud = "audience" AttrCapability = "capability" )
Defined attributes
Variables ¶
var AllRestrictionClaimStrings = api.AllRestrictionClaims
AllRestrictionClaimStrings holds all defined RestrictionClaim strings
var Attributes = []string{ AttrScope, AttrAud, AttrCapability, }
Attributes holds all defined attributes
var ResponseNYI = Response{ Status: fiber.StatusNotImplemented, Response: api.ErrorNYI, }
ResponseNYI is the server response when something is not yet implemented
Functions ¶
This section is empty.
Types ¶
type Response ¶
type Response struct { // The Http Status code of the response Status int // The response body, will be marshalled as json Response interface{} // Cookies that should be set Cookies []*fiber.Cookie }
Response models a http server response
func ErrorToBadRequestErrorResponse ¶
ErrorToBadRequestErrorResponse creates a bad request error response from a golang error
func ErrorToInternalServerErrorResponse ¶
ErrorToInternalServerErrorResponse creates an internal server error response from a golang error
type RestrictionClaim ¶ added in v0.5.0
type RestrictionClaim int
RestrictionClaim is an enum like type for restriction keys
const ( RestrictionClaimNotBefore RestrictionClaim = iota RestrictionClaimExpiresAt RestrictionClaimScope RestrictionClaimAudiences RestrictionClaimHosts RestrictionClaimGeoIPAllow RestrictionClaimGeoIPDisallow RestrictionClaimUsagesAT RestrictionClaimUsagesOther )
RestrictionClaims
func NewRestrictionClaim ¶ added in v0.5.0
func NewRestrictionClaim(s string) RestrictionClaim
NewRestrictionClaim creates a new RestrictionClaim from the grant type string
func (RestrictionClaim) MarshalJSON ¶ added in v0.5.0
func (rc RestrictionClaim) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface
func (*RestrictionClaim) String ¶ added in v0.5.0
func (rc *RestrictionClaim) String() string
func (*RestrictionClaim) UnmarshalJSON ¶ added in v0.5.0
func (rc *RestrictionClaim) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface
func (*RestrictionClaim) UnmarshalText ¶ added in v0.5.0
func (rc *RestrictionClaim) UnmarshalText(data []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface
func (*RestrictionClaim) UnmarshalYAML ¶ added in v0.5.0
func (rc *RestrictionClaim) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML implements the yaml.Unmarshaler interface
func (*RestrictionClaim) Valid ¶ added in v0.5.0
func (rc *RestrictionClaim) Valid() bool
Valid checks that RestrictionClaim is a defined grant type
type RestrictionClaims ¶ added in v0.5.0
type RestrictionClaims []RestrictionClaim
RestrictionClaims is a slice of RestrictionClaim
var AllRestrictionClaims RestrictionClaims
AllRestrictionClaims holds all defined RestrictionClaims
func (RestrictionClaims) Disable ¶ added in v0.5.0
func (rks RestrictionClaims) Disable(disable RestrictionClaims) (left RestrictionClaims)
Disable subtracts the passed RestrictionClaims from this RestrictionClaims and returns the left RestrictionClaims
func (RestrictionClaims) Has ¶ added in v0.5.0
func (rks RestrictionClaims) Has(rk RestrictionClaim) bool
Has checks if a RestrictionClaim is in a RestrictionClaims