Documentation ¶
Index ¶
- func CheckContext(ctx context.Context) error
- func FetchEnv(key string, def string) string
- func ReplaceJSONPlaceholders(source string, jsonData string) string
- func StringifyJSON(data interface{}) (string, error)
- func UnmashalJSONResponse(resp *http.Response, v interface{}, b *[]byte) error
- type APIKeySecretFinder
- type AuthConfigCleaner
- type AuthConfigEvaluator
- type AuthPipeline
- type AuthResult
- type IdentityConfigEvaluator
- type JSONPatternMatchingRule
- type JSONProperty
- type JSONValue
- type NamedConfigEvaluator
- type Prioritizable
- type ResponseConfigEvaluator
- type WristbandIssuer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckContext ¶
CheckContext checks if a go context is still active or done When it's done, returns a generic error
func myFunc(ctx context.Context) error { if err := common.CheckContext(ctx); err != nil { return err } else { doSomething() } }
func ReplaceJSONPlaceholders ¶ added in v0.2.0
func StringifyJSON ¶ added in v0.5.0
Types ¶
type APIKeySecretFinder ¶
type APIKeySecretFinder interface {
FindSecretByName(types.NamespacedName) *v1.Secret
}
type AuthConfigCleaner ¶ added in v0.6.0
type AuthConfigEvaluator ¶
type AuthConfigEvaluator interface {
Call(AuthPipeline, context.Context) (interface{}, error)
}
AuthConfigEvaluator interface represents the configuration pieces of Identity, Metadata and Authorization
type AuthPipeline ¶
type AuthPipeline interface { Evaluate() AuthResult GetRequest() *envoy_auth.CheckRequest GetHttp() *envoy_auth.AttributeContext_HttpRequest GetAPI() interface{} GetResolvedIdentity() (interface{}, interface{}) GetAuthorizationJSON() string }
type AuthResult ¶ added in v0.5.0
type AuthResult struct { // Code is gRPC response code to the auth check Code rpc.Code `json:"code,omitempty"` // Status is HTTP status code to override the default mapping between gRPC response codes and HTTP status messages // for auth Status envoy_type.StatusCode `json:"status,omitempty"` // Message is X-Ext-Auth-Reason message returned in an injected HTTP response header, to explain the reason of the // auth check result Message string `json:"message,omitempty"` // Headers are other HTTP headers to inject in the response Headers []map[string]string `json:"headers,omitempty"` // Metadata are Envoy dynamic metadata content Metadata map[string]interface{} `json:"metadata,omitempty"` }
AuthResult holds the result data for building the response to an auth check
func (*AuthResult) Success ¶ added in v0.5.0
func (result *AuthResult) Success() bool
Success tells whether the auth check result was successful and therefore access can be granted to the requested resource or it has failed (deny access)
type IdentityConfigEvaluator ¶
type IdentityConfigEvaluator interface { GetAuthCredentials() auth_credentials.AuthCredentials GetOIDC() interface{} ResolveExtendedProperties(AuthPipeline) (interface{}, error) }
type JSONPatternMatchingRule ¶ added in v0.5.0
func (*JSONPatternMatchingRule) EvaluateFor ¶ added in v0.5.0
func (rule *JSONPatternMatchingRule) EvaluateFor(jsonData string) (bool, error)
type JSONProperty ¶ added in v0.4.0
JSONProperty represents a name-value pair for a JSON property where the value can be a static value or a pattern for a value fetched dynamically from the authorization JSON
type JSONValue ¶ added in v0.4.0
type JSONValue struct { // Static value of the JSON property. Static interface{} // Resolves the value of the JSON property by fetching the pattern from the authorization JSON. Pattern string }
func (*JSONValue) IsTemplate ¶ added in v0.5.0
IsTemplate tells whether a pattern is as a simple pattern or a template that mixes static value with variable placeholders that resolve to patterns. In case of a template that mixes no variable placeholder, but it contains nothing but a static string value, users should use `JSONValue.Static` instead of `JSONValue.Pattern`.
func (*JSONValue) ResolveFor ¶ added in v0.4.0
ResolveFor resolves a value for a given input JSON. For static values, it returns the value right away; for patterns, it magically decides whether to process as a simple pattern or as a template that mixes static value with variable placeholders that resolve to patterns. In case of a template that mixes no variable placeholder, but it contains nothing but a static string value, users should use `JSONValue.Static` instead of `JSONValue.Pattern`.
type NamedConfigEvaluator ¶
type NamedConfigEvaluator interface {
GetName() string
}
type Prioritizable ¶ added in v0.6.0
type Prioritizable interface {
GetPriority() int
}
type ResponseConfigEvaluator ¶ added in v0.4.0
type ResponseConfigEvaluator interface { NamedConfigEvaluator GetWristbandIssuer() WristbandIssuer }
type WristbandIssuer ¶ added in v0.2.0
Directories ¶
Path | Synopsis |
---|---|
mocks
Package mock_auth_credentials is a generated GoMock package.
|
Package mock_auth_credentials is a generated GoMock package. |
mocks
Package mock_logr is a generated GoMock package.
|
Package mock_logr is a generated GoMock package. |
Package mock_common is a generated GoMock package.
|
Package mock_common is a generated GoMock package. |