mirror of
https://github.com/status-im/consul.git
synced 2025-01-13 15:26:48 +00:00
resource: add AuthorizerContext
helper method (#17393)
This commit is contained in:
parent
d5d3a3ddb9
commit
48445dfa55
17
internal/resource/authz_oss.go
Normal file
17
internal/resource/authz_oss.go
Normal file
@ -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…
x
Reference in New Issue
Block a user