mirror of https://github.com/status-im/consul.git
resource: add `AuthorizerContext` helper method (#17393)
This commit is contained in:
parent
d5d3a3ddb9
commit
48445dfa55
|
@ -0,0 +1,17 @@
|
|||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
//go:build !consulent
|
||||
// +build !consulent
|
||||
|
||||
package resource
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/consul/acl"
|
||||
"github.com/hashicorp/consul/proto-public/pbresource"
|
||||
)
|
||||
|
||||
// AuthorizerContext builds an ACL AuthorizerContext for the given tenancy.
|
||||
func AuthorizerContext(t *pbresource.Tenancy) *acl.AuthorizerContext {
|
||||
return &acl.AuthorizerContext{Peer: t.PeerName}
|
||||
}
|
Loading…
Reference in New Issue