2023-06-26 13:23:05 +01:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-11 09:12:13 -04:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-06-26 13:23:05 +01:00
|
|
|
|
|
|
|
//go: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 {
|
2023-09-19 17:14:15 -05:00
|
|
|
return &acl.AuthorizerContext{
|
|
|
|
Peer: peerNameV2ToV1(t.PeerName),
|
|
|
|
}
|
2023-06-26 13:23:05 +01:00
|
|
|
}
|