Documentation
¶
Index ¶
- Constants
- func Discover(path string) string
- func LogJSON(raw json.RawMessage) string
- func ValidPath(path string) bool
- type Body
- type Discovery
- type Endpoint
- type Exception
- type GraphQLSettings
- type ImportIssue
- type Issue
- type JWK
- type JWTSettings
- type Log
- type Parameter
- type Request
- type Result
- type Schema
- type SchemaSettings
- type Scope
- type Settings
Constants ¶
const Feature = "api-security-v1"
const MaxBodyBytes = 131072
Variables ¶
This section is empty.
Functions ¶
func LogJSON ¶
func LogJSON(raw json.RawMessage) string
LogJSON validates the small metadata envelope again at the data-plane boundary; unknown fields and request values never enter the proto log.
Types ¶
type GraphQLSettings ¶
type GraphQLSettings struct {
Mode string `json:"mode"`
PathPrefixes []string `json:"pathPrefixes"`
MaxDepth int `json:"maxDepth"`
MaxFields int `json:"maxFields"`
MaxAliases int `json:"maxAliases"`
MaxBatch int `json:"maxBatch"`
MaxDocumentBytes int `json:"maxDocumentBytes"`
Introspection bool `json:"introspection"`
}
type ImportIssue ¶
type JWTSettings ¶
type Request ¶
type Request struct {
SiteID string `json:"site_id"`
Version string `json:"version"`
Method string `json:"method"`
Path string `json:"path"`
RawPath string `json:"raw_path"`
Query string `json:"query"`
JWTScoped bool `json:"jwt_scoped"`
GraphQLScoped bool `json:"graphql_scoped"`
Headers map[string][]string `json:"headers"`
Authorization []string `json:"authorization"`
Body []byte `json:"body"`
BodyTruncated bool `json:"body_truncated"`
HeadersTruncated bool `json:"headers_truncated"`
PathAmbiguous bool `json:"path_ambiguous"`
}
Scope selection is shared with access authentication in Lua. Only the local agent socket accepts these fields; the version binds them to the plan.
type Schema ¶
type Schema struct {
Type string `json:"type"`
Nullable bool `json:"nullable,omitempty"`
Properties map[string]*Schema `json:"properties,omitempty"`
Required []string `json:"required,omitempty"`
AdditionalProperties *bool `json:"additionalProperties,omitempty"`
Items *Schema `json:"items,omitempty"`
Enum []any `json:"enum,omitempty"`
MinLength *int `json:"minLength,omitempty"`
MaxLength *int `json:"maxLength,omitempty"`
Minimum *float64 `json:"minimum,omitempty"`
Maximum *float64 `json:"maximum,omitempty"`
MinItems *int `json:"minItems,omitempty"`
MaxItems *int `json:"maxItems,omitempty"`
}
type SchemaSettings ¶
type SchemaSettings struct {
Mode string `json:"mode"`
UnknownEndpoints string `json:"unknownEndpoints"`
Endpoints []Endpoint `json:"endpoints"`
Issues []ImportIssue `json:"issues"`
}
type Settings ¶
type Settings struct {
Version int `json:"version"`
Discovery Discovery `json:"discovery"`
Schema SchemaSettings `json:"schema"`
JWT JWTSettings `json:"jwt"`
GraphQL GraphQLSettings `json:"graphql"`
Exceptions []Exception `json:"exceptions"`
// contains filtered or unexported fields
}