2023-04-18 09:03:23 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-11 13:12:13 +00:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-04-18 09:03:23 +00:00
|
|
|
|
|
|
|
package resolver
|
|
|
|
|
2023-09-26 17:52:53 +00:00
|
|
|
import (
|
|
|
|
"github.com/hashicorp/consul/acl"
|
|
|
|
"github.com/hashicorp/consul/agent/structs"
|
|
|
|
)
|
2023-04-18 09:03:23 +00: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 17:52:53 +00:00
|
|
|
func (DANGER_NO_AUTH) ResolveTokenAndDefaultMeta(_ string, entMeta *acl.EnterpriseMeta, _ *acl.AuthorizerContext) (Result, error) {
|
|
|
|
entMeta.Merge(structs.DefaultEnterpriseMetaInDefaultPartition())
|
2023-04-18 09:03:23 +00:00
|
|
|
return Result{Authorizer: acl.ManageAll()}, nil
|
|
|
|
}
|