Documentation ¶
Index ¶
- Constants
- Variables
- type Response
- type RestrictionKey
- func (rk RestrictionKey) MarshalJSON() ([]byte, error)
- func (rk *RestrictionKey) String() string
- func (rk *RestrictionKey) UnmarshalJSON(data []byte) error
- func (rk *RestrictionKey) UnmarshalText(data []byte) error
- func (rk *RestrictionKey) UnmarshalYAML(value *yaml.Node) error
- func (rk *RestrictionKey) Valid() bool
- type RestrictionKeys
Constants ¶
const ( AttrScope = "scope" AttrAud = "audience" AttrCapability = "capability" )
Defined attributes
Variables ¶
var AllRestrictionKeyStrings = api.AllRestrictionKeys
AllRestrictionKeyStrings holds all defined RestrictionKey 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 RestrictionKey ¶ added in v0.3.0
type RestrictionKey int
RestrictionKey is an enum like type for restriction keys
const ( RestrictionKeyNotBefore RestrictionKey = iota RestrictionKeyExpiresAt RestrictionKeyScope RestrictionKeyAudiences RestrictionKeyIPs RestrictionKeyGeoIPAllow RestrictionKeyGeoIPDisallow RestrictionKeyUsagesAT RestrictionKeyUsagesOther )
RestrictionKeys
func NewRestrictionKey ¶ added in v0.3.0
func NewRestrictionKey(s string) RestrictionKey
NewRestrictionKey creates a new RestrictionKey from the grant type string
func (RestrictionKey) MarshalJSON ¶ added in v0.3.0
func (rk RestrictionKey) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface
func (*RestrictionKey) String ¶ added in v0.3.0
func (rk *RestrictionKey) String() string
func (*RestrictionKey) UnmarshalJSON ¶ added in v0.3.0
func (rk *RestrictionKey) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface
func (*RestrictionKey) UnmarshalText ¶ added in v0.3.0
func (rk *RestrictionKey) UnmarshalText(data []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface
func (*RestrictionKey) UnmarshalYAML ¶ added in v0.3.0
func (rk *RestrictionKey) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML implements the yaml.Unmarshaler interface
func (*RestrictionKey) Valid ¶ added in v0.3.0
func (rk *RestrictionKey) Valid() bool
Valid checks that RestrictionKey is a defined grant type
type RestrictionKeys ¶ added in v0.3.0
type RestrictionKeys []RestrictionKey
RestrictionKeys is a slice of RestrictionKey
var AllRestrictionKeys RestrictionKeys
AllRestrictionKeys holds all defined RestrictionKeys
func (RestrictionKeys) Disable ¶ added in v0.3.0
func (rks RestrictionKeys) Disable(disable RestrictionKeys) (left RestrictionKeys)
Disable subtracts the passed RestrictionKeys from this RestrictionKeys and returns the left RestrictionKeys
func (RestrictionKeys) Has ¶ added in v0.3.0
func (rks RestrictionKeys) Has(rk RestrictionKey) bool
Has checks if a a RestrictionKey is in a RestrictionKeys