Files
zitadel/internal/denylist/error.go
T
Marco A. d9df998adb fix(actions): add denylist for target URLs
This PR adds a possibility to deny certain domains and/or IPs as targets for action v2.
By default, localhost as well as loopback IPs are denied.

(cherry picked from commit b2532e9666)
2026-02-25 06:46:01 +01:00

27 lines
534 B
Go

package denylist
import (
"errors"
"fmt"
)
type AddressDeniedError struct {
deniedBy string
}
func NewAddressDeniedError(deniedBy string) *AddressDeniedError {
return &AddressDeniedError{deniedBy: deniedBy}
}
func (e *AddressDeniedError) Error() string {
return fmt.Sprintf("address is denied by '%s'", e.deniedBy)
}
func (e *AddressDeniedError) Is(target error) bool {
var addressDeniedErr *AddressDeniedError
if !errors.As(target, &addressDeniedErr) {
return false
}
return e.deniedBy == addressDeniedErr.deniedBy
}