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 {
|
|
|
|
return &acl.AuthorizerContext{Peer: t.PeerName}
|
|
|
|
}
|