Documentation
¶
Index ¶
- type APIDefinition
- type APILimit
- type AccessDefinition
- type AccessSpec
- type CertResponse
- type DBApiDefinition
- func (d *DBApiDefinition) GetAPIID() string
- func (d *DBApiDefinition) GetAPIName() string
- func (d *DBApiDefinition) GetDBID() model.ObjectID
- func (d *DBApiDefinition) GetDomain() string
- func (d *DBApiDefinition) GetListenPath() string
- func (d *DBApiDefinition) IsOASAPI() bool
- func (d *DBApiDefinition) SetAPIID(apiID string)
- func (d *DBApiDefinition) SetDBID(id model.ObjectID)
- func (d *DBApiDefinition) SetOrgID(orgID string)
- type DBAssets
- type FieldAccessDefinition
- type FieldLimits
- type JSONRawMessage
- type Policy
- type User
- type UsersResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIDefinition ¶ added in v1.2.2
type APIDefinition struct {
apidef.APIDefinition
Scopes *apidef.Scopes `json:"scopes,omitempty"`
AnalyticsPluginConfig *apidef.AnalyticsPluginConfig `json:"analytics_plugin,omitempty"`
ExternalOAuth *apidef.ExternalOAuth `json:"external_oauth,omitempty"`
}
type APILimit ¶ added in v1.2.0
type APILimit struct {
Rate float64 `json:"rate" bson:"rate"`
Per float64 `json:"per" bson:"per"`
ThrottleInterval float64 `json:"throttle_interval" bson:"throttle_interval"`
ThrottleRetryLimit int `json:"throttle_retry_limit" bson:"throttle_retry_limit"`
MaxQueryDepth int `json:"max_query_depth" bson:"max_query_depth"`
QuotaMax int64 `json:"quota_max" bson:"quota_max"`
QuotaRenews int64 `json:"quota_renews" bson:"quota_renews"`
QuotaRemaining int64 `json:"quota_remaining" bson:"quota_remaining"`
QuotaRenewalRate int64 `json:"quota_renewal_rate" bson:"quota_renewal_rate"`
SetByPolicy bool `json:"set_by_policy" bson:"set_by_policy"`
}
APILimit stores quota and rate limit on ACL level (per API)
type AccessDefinition ¶
type AccessDefinition struct {
APIName string `json:"api_name" bson:"apiname"`
APIID string `json:"api_id" bson:"apiid"`
Versions []string `json:"versions" bson:"versions"`
AllowedURLs []AccessSpec `json:"allowed_urls" bson:"allowed_urls"` // mapped string MUST be a valid regex
RestrictedTypes []graphql.Type `json:"restricted_types" bson:"restricted_types"`
Limit *APILimit `json:"limit" bson:"limit"`
FieldAccessRights []FieldAccessDefinition `json:"field_access_rights" bson:"field_access_rights"`
AllowanceScope string `json:"allowance_scope" bson:"allowance_scope"`
}
AccessDefinition defines which versions of an API a key has access to
type AccessSpec ¶
type CertResponse ¶
type DBApiDefinition ¶
type DBApiDefinition struct {
*APIDefinition `bson:"api_definition" json:"api_definition,omitempty"`
OAS *oas.OAS `json:"oas,omitempty"`
Categories []string `bson:"categories" json:"categories,omitempty"`
HookReferences []interface{} `bson:"hook_references" json:"hook_references"`
IsSite bool `bson:"is_site" json:"is_site"`
SortBy int `bson:"sort_by" json:"sort_by"`
UserGroupOwners []bson.ObjectId `bson:"user_group_owners" json:"user_group_owners"`
UserOwners []bson.ObjectId `bson:"user_owners" json:"user_owners"`
}
func NewDefinition ¶
func NewDefinition() *DBApiDefinition
func (*DBApiDefinition) GetAPIID ¶ added in v1.5.0
func (d *DBApiDefinition) GetAPIID() string
func (*DBApiDefinition) GetAPIName ¶ added in v1.5.0
func (d *DBApiDefinition) GetAPIName() string
func (*DBApiDefinition) GetDBID ¶ added in v1.5.0
func (d *DBApiDefinition) GetDBID() model.ObjectID
func (*DBApiDefinition) GetDomain ¶ added in v1.5.0
func (d *DBApiDefinition) GetDomain() string
func (*DBApiDefinition) GetListenPath ¶ added in v1.5.0
func (d *DBApiDefinition) GetListenPath() string
func (*DBApiDefinition) IsOASAPI ¶ added in v1.5.0
func (d *DBApiDefinition) IsOASAPI() bool
func (*DBApiDefinition) SetAPIID ¶ added in v1.5.0
func (d *DBApiDefinition) SetAPIID(apiID string)
func (*DBApiDefinition) SetDBID ¶ added in v1.5.0
func (d *DBApiDefinition) SetDBID(id model.ObjectID)
func (*DBApiDefinition) SetOrgID ¶ added in v1.5.0
func (d *DBApiDefinition) SetOrgID(orgID string)
type FieldAccessDefinition ¶ added in v1.2.0
type FieldAccessDefinition struct {
TypeName string `json:"type_name" bson:"type_name"`
FieldName string `json:"field_name" bson:"field_name"`
Limits FieldLimits `json:"limits" bson:"limits"`
}
type FieldLimits ¶ added in v1.2.0
type FieldLimits struct {
MaxQueryDepth int `json:"max_query_depth" bson:"max_query_depth"`
}
type JSONRawMessage ¶ added in v1.5.0
type JSONRawMessage []byte
JSONRawMessage implements Scanner and Valuer interface for gorm.
func (JSONRawMessage) MarshalJSON ¶ added in v1.5.0
func (j JSONRawMessage) MarshalJSON() ([]byte, error)
MarshalJSON returns m as the JSON encoding of m.
func (*JSONRawMessage) UnmarshalJSON ¶ added in v1.5.0
func (j *JSONRawMessage) UnmarshalJSON(data []byte) error
UnmarshalJSON sets *m to a copy of data.
type Policy ¶
type Policy struct {
MID bson.ObjectId `bson:"_id,omitempty" json:"_id"`
ID string `bson:"id,omitempty" json:"id"`
Name string `bson:"name" json:"name"`
OrgID string `bson:"org_id" json:"org_id"`
Rate float64 `bson:"rate" json:"rate"`
Per float64 `bson:"per" json:"per"`
QuotaMax int64 `bson:"quota_max" json:"quota_max"`
QuotaRenewalRate int64 `bson:"quota_renewal_rate" json:"quota_renewal_rate"`
ThrottleInterval float64 `bson:"throttle_interval" json:"throttle_interval"`
ThrottleRetryLimit int `bson:"throttle_retry_limit" json:"throttle_retry_limit"`
MaxQueryDepth int `bson:"max_query_depth" json:"max_query_depth"`
AccessRights map[string]AccessDefinition `bson:"access_rights" json:"access_rights"`
HMACEnabled bool `bson:"hmac_enabled" json:"hmac_enabled"`
Active bool `bson:"active" json:"active"`
IsInactive bool `bson:"is_inactive" json:"is_inactive"`
DateCreated time.Time `bson:"date_created" json:"date_created"`
Tags []string `bson:"tags" json:"tags"`
KeyExpiresIn int64 `bson:"key_expires_in" json:"key_expires_in"`
Partitions struct {
Quota bool `bson:"quota" json:"quota"`
RateLimit bool `bson:"rate_limit" json:"rate_limit"`
Complexity bool `bson:"complexity" json:"complexity"`
Acl bool `bson:"acl" json:"acl"`
PerAPI bool `bson:"per_api" json:"per_api"`
} `bson:"partitions" json:"partitions"`
LastUpdated string `bson:"last_updated" json:"last_updated"`
MetaData map[string]interface{} `bson:"meta_data" json:"meta_data"`
}
type UsersResponse ¶ added in v1.2.0
type UsersResponse struct {
Users []User `json:"users"`
}
Click to show internal directories.
Click to hide internal directories.