2023-03-28 18:39:22 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-11 13:12:13 +00:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-03-28 18:39:22 +00:00
|
|
|
|
2018-03-26 00:52:26 +00:00
|
|
|
package structs
|
|
|
|
|
2022-03-13 03:55:53 +00:00
|
|
|
import "github.com/hashicorp/consul/acl"
|
|
|
|
|
2018-03-26 00:52:26 +00:00
|
|
|
// ConnectAuthorizeRequest is the structure of a request to authorize
|
|
|
|
// a connection.
|
|
|
|
type ConnectAuthorizeRequest struct {
|
|
|
|
// Target is the name of the service that is being requested.
|
|
|
|
Target string
|
|
|
|
|
2020-01-13 20:51:40 +00:00
|
|
|
// EnterpriseMeta is the embedded Consul Enterprise specific metadata
|
2022-03-13 03:55:53 +00:00
|
|
|
acl.EnterpriseMeta
|
2020-01-13 20:51:40 +00:00
|
|
|
|
2018-03-28 21:29:35 +00:00
|
|
|
// ClientCertURI is a unique identifier for the requesting client. This
|
2018-03-26 00:52:26 +00:00
|
|
|
// is currently the URI SAN from the TLS client certificate.
|
|
|
|
//
|
|
|
|
// ClientCertSerial is a colon-hex-encoded of the serial number for
|
|
|
|
// the requesting client cert. This is used to check against revocation
|
|
|
|
// lists.
|
2018-03-28 21:29:35 +00:00
|
|
|
ClientCertURI string
|
2018-03-26 00:52:26 +00:00
|
|
|
ClientCertSerial string
|
|
|
|
}
|
2021-06-25 21:47:47 +00:00
|
|
|
|
|
|
|
func (req *ConnectAuthorizeRequest) TargetPartition() string {
|
|
|
|
return req.PartitionOrDefault()
|
|
|
|
}
|