2023-04-18 10:03:23 +01:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-11 09:12:13 -04:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-04-18 10:03:23 +01:00
|
|
|
|
|
|
|
package resolver
|
|
|
|
|
2023-09-26 11:52:53 -06:00
|
|
|
import (
|
|
|
|
"github.com/hashicorp/consul/acl"
|
|
|
|
"github.com/hashicorp/consul/agent/structs"
|
|
|
|
)
|
2023-04-18 10:03:23 +01:00
|
|
|
|
|
|
|
// DANGER_NO_AUTH implements an ACL resolver short-circuit authorization in
|
|
|
|
// cases where it is handled somewhere else or expressly not required.
|
|
|
|
type DANGER_NO_AUTH struct{}
|
|
|
|
|
|
|
|
// ResolveTokenAndDefaultMeta returns an authorizer with unfettered permissions.
|
2023-09-26 11:52:53 -06:00
|
|
|
func (DANGER_NO_AUTH) ResolveTokenAndDefaultMeta(_ string, entMeta *acl.EnterpriseMeta, _ *acl.AuthorizerContext) (Result, error) {
|
|
|
|
entMeta.Merge(structs.DefaultEnterpriseMetaInDefaultPartition())
|
2023-04-18 10:03:23 +01:00
|
|
|
return Result{Authorizer: acl.ManageAll()}, nil
|
|
|
|
}
|