Skip to content

Commit

Permalink
resource: add AuthorizerContext helper method (#17393)
Browse files Browse the repository at this point in the history
  • Loading branch information
boxofrad authored Jun 26, 2023
1 parent d5d3a3d commit 48445df
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions internal/resource/authz_oss.go
Original file line number Diff line number Diff line change
@@ -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}
}

0 comments on commit 48445df

Please sign in to comment.