Documentation
¶
Overview ¶
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except * in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type AuthConfig struct {
// Basic Auth Configuration
BasicAuth *BasicAuth
// JWT/Bearer Auth Configuration
JWTConfig *IDPConfig
// Paths to skip authentication
SkipPaths []string
// Allow either basic or bearer (if true), require both (if false and both configured)
AllowEither bool
// ResourceRoles holds the mapping of resource -> allowed local roles.
// Keys may be either "METHOD /path" (preferred) or just "/path".
ResourceRoles map[string][]string `json:"resource_roles"`
}
AuthConfig holds configuration for the authentication middleware
type AuthContext ¶
AuthContext is a packed authentication/authorization context that can be attached to a request context and passed downstream.
This avoids setting and reading multiple independent context keys. Claims is kept as 'any' to avoid coupling common/models to a specific JWT library type.
type IDPConfig ¶
type IDPConfig struct {
Enabled bool `json:"enabled"`
IssuerURL string `json:"issuer_url"`
JWKSUrl string `json:"jwks_url"`
ScopeClaim string `json:"scope_claim"`
UsernameClaim string `json:"username_claim"`
Audience *[]string `json:"audience"`
Certificate *string `json:"certificate"`
ClaimMapping *map[string]string `json:"claim_mapping"`
PermissionMapping *map[string][]string `json:"permission_mapping"`
InsecureSkipVerifyTLS bool `json:"insecure_skip_verify_tls"`
JWTLeeway *time.Duration `json:"jwt_leeway"`
}
IDPConfig holds identity provider configuration