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