mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-02-14 18:09:58 +00:00
* chore(deps): update dependency golangci/golangci-lint to v2.8.0 * chore(deps): update dependency golangci/golangci-lint to v2.8.0 Signed-off-by: Hristo Hristov <me@hhristov.info> * chore(deps): update dependency golangci/golangci-lint to v2.8.0 Signed-off-by: Hristo Hristov <me@hhristov.info> * chore(deps): update dependency golangci/golangci-lint to v2.8.0 Signed-off-by: Hristo Hristov <me@hhristov.info> --------- Signed-off-by: Hristo Hristov <me@hhristov.info> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Hristo Hristov <me@hhristov.info>
44 lines
1.1 KiB
Go
44 lines
1.1 KiB
Go
// Copyright 2020-2026 Project Capsule Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package gateway
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/projectcapsule/capsule/internal/webhook/utils"
|
|
"github.com/projectcapsule/capsule/pkg/api"
|
|
)
|
|
|
|
type gatewayClassForbiddenError struct {
|
|
gatewayClassName string
|
|
spec api.DefaultAllowedListSpec
|
|
}
|
|
|
|
func NewGatewayClassForbidden(class string, spec api.DefaultAllowedListSpec) error {
|
|
return &gatewayClassForbiddenError{
|
|
gatewayClassName: class,
|
|
spec: spec,
|
|
}
|
|
}
|
|
|
|
func (i gatewayClassForbiddenError) Error() string {
|
|
err := fmt.Sprintf("Gateway Class %s is forbidden for the current Tenant: ", i.gatewayClassName)
|
|
|
|
return utils.DefaultAllowedValuesErrorMessage(i.spec, err)
|
|
}
|
|
|
|
type gatewayClassUndefinedError struct {
|
|
spec api.DefaultAllowedListSpec
|
|
}
|
|
|
|
func NewGatewayClassUndefined(spec api.DefaultAllowedListSpec) error {
|
|
return &gatewayClassUndefinedError{
|
|
spec: spec,
|
|
}
|
|
}
|
|
|
|
func (i gatewayClassUndefinedError) Error() string {
|
|
return utils.DefaultAllowedValuesErrorMessage(i.spec, "No gateway Class is forbidden for the current Tenant. Specify a gateway Class which is allowed within the Tenant: ")
|
|
}
|