Documentation
¶
Index ¶
- Variables
- type Config
- type ConfigService
- type HTTPMethod
- type ProcessRequest
- type ProviderDescription
- func (p *ProviderDescription) NeedAudit(method string) bool
- func (p *ProviderDescription) NeedAuthentication(method string) bool
- func (p *ProviderDescription) Permissions(method string) []string
- func (p *ProviderDescription) SelectRateLimiter(method string) (description *RateLimiterDescription, isServiceLimiter bool)
- type ProviderDescriptionMethod
- type ProviderProcessRequest
- type ProviderProcessResponse
- type RateLimitDescriptionBy
- type RateLimiterDescription
- type SubjectInformation
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidHTTPMethod = errors.New("not a valid HTTPMethod")
var ErrInvalidRateLimitDescriptionBy = errors.New("not a valid RateLimitDescriptionBy")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { PublicListenAddress string `json:"public_listen_address"` AdminListenAddress string `json:"admin_listen_address"` Auth0Domain string `json:"auth0_domain"` Auth0Audience string `json:"auth0_audience"` Auth0ClientID string `json:"auth0_client_id"` Auth0ClientSecret string `json:"auth0_client_secret"` RedisAddress string `json:"redis_address"` RedisPassword string `json:"redis_password"` DescriptionSyncPeriod time.Duration `json:"description_sync_period"` Services []*ConfigService `json:"services"` }
Config ...
type ConfigService ¶
type ConfigService struct { Name string `json:"name"` Address string `json:"address"` M2MAudience string `json:"m2m_audience"` OperationTimeout time.Duration `json:"timeout"` }
ConfigService ...
type HTTPMethod ¶
type HTTPMethod uint8
HTTPMethod ... ENUM(unspecified, get, put, post, delete, patch)
const ( // HTTPMethodUnspecified is a HTTPMethod of type Unspecified. HTTPMethodUnspecified HTTPMethod = iota // HTTPMethodGet is a HTTPMethod of type Get. HTTPMethodGet // HTTPMethodPut is a HTTPMethod of type Put. HTTPMethodPut // HTTPMethodPost is a HTTPMethod of type Post. HTTPMethodPost // HTTPMethodDelete is a HTTPMethod of type Delete. HTTPMethodDelete // HTTPMethodPatch is a HTTPMethod of type Patch. HTTPMethodPatch )
func ParseHTTPMethod ¶
func ParseHTTPMethod(name string) (HTTPMethod, error)
ParseHTTPMethod attempts to convert a string to a HTTPMethod.
func (HTTPMethod) IsValid ¶
func (x HTTPMethod) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (HTTPMethod) String ¶
func (x HTTPMethod) String() string
String implements the Stringer interface.
type ProcessRequest ¶
type ProcessRequest struct { Service string HTTPMethod HTTPMethod APIMethod string Path string Query string Body []byte Headers http.Header RemoteAddr string }
ProcessRequest ...
type ProviderDescription ¶
type ProviderDescription struct { AuditEnabled bool RateLimiter *RateLimiterDescription RequireAuthentication bool RequiredPermissions []string DescriptionByMethod map[string]*ProviderDescriptionMethod }
ProviderDescription ...
func (*ProviderDescription) NeedAudit ¶
func (p *ProviderDescription) NeedAudit(method string) bool
NeedAudit ...
func (*ProviderDescription) NeedAuthentication ¶
func (p *ProviderDescription) NeedAuthentication(method string) bool
NeedAuthentication ...
func (*ProviderDescription) Permissions ¶
func (p *ProviderDescription) Permissions(method string) []string
Permissions ...
func (*ProviderDescription) SelectRateLimiter ¶
func (p *ProviderDescription) SelectRateLimiter(method string) (description *RateLimiterDescription, isServiceLimiter bool)
SelectRateLimiter ...
type ProviderDescriptionMethod ¶
type ProviderDescriptionMethod struct { Method string AuditEnabled bool RateLimiter *RateLimiterDescription RequiredAuthentication bool RequiredPermissions []string AllowedHTTPMethods mapset.Set[HTTPMethod] }
ProviderDescriptionMethod ...
type ProviderProcessRequest ¶
type ProviderProcessRequest struct { APIMethod string HTTPMethod HTTPMethod Path string Query string Body []byte Headers http.Header SubjectInformation *SubjectInformation }
ProviderProcessRequest ...
func (*ProviderProcessRequest) Preprocess ¶
func (p *ProviderProcessRequest) Preprocess()
Preprocess ...
type ProviderProcessResponse ¶
ProviderProcessResponse ...
func (*ProviderProcessResponse) SetDefaults ¶
func (p *ProviderProcessResponse) SetDefaults()
SetDefaults ...
type RateLimitDescriptionBy ¶
type RateLimitDescriptionBy uint8
RateLimitDescriptionBy ... ENUM(ip, subject_id)
const ( // RateLimitDescriptionByIp is a RateLimitDescriptionBy of type Ip. RateLimitDescriptionByIp RateLimitDescriptionBy = iota // RateLimitDescriptionBySubjectId is a RateLimitDescriptionBy of type Subject_id. RateLimitDescriptionBySubjectId )
func ParseRateLimitDescriptionBy ¶
func ParseRateLimitDescriptionBy(name string) (RateLimitDescriptionBy, error)
ParseRateLimitDescriptionBy attempts to convert a string to a RateLimitDescriptionBy.
func (RateLimitDescriptionBy) IsValid ¶
func (x RateLimitDescriptionBy) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (RateLimitDescriptionBy) String ¶
func (x RateLimitDescriptionBy) String() string
String implements the Stringer interface.
type RateLimiterDescription ¶
type RateLimiterDescription struct { By RateLimitDescriptionBy Rate uint64 Burst uint64 Period time.Duration }
RateLimiterDescription ...
type SubjectInformation ¶
SubjectInformation ...