2023-03-28 19:39:22 +01:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-11 09:12:13 -04:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-03-28 19:39:22 +01:00
|
|
|
|
2018-03-25 14:52:26 -10:00
|
|
|
package structs
|
|
|
|
|
2022-03-12 19:55:53 -08:00
|
|
|
import "github.com/hashicorp/consul/acl"
|
|
|
|
|
2018-03-25 14:52:26 -10: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 15:51:40 -05:00
|
|
|
// EnterpriseMeta is the embedded Consul Enterprise specific metadata
|
2022-03-12 19:55:53 -08:00
|
|
|
acl.EnterpriseMeta
|
2020-01-13 15:51:40 -05:00
|
|
|
|
2018-03-28 14:29:35 -07:00
|
|
|
// ClientCertURI is a unique identifier for the requesting client. This
|
2018-03-25 14:52:26 -10: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 14:29:35 -07:00
|
|
|
ClientCertURI string
|
2018-03-25 14:52:26 -10:00
|
|
|
ClientCertSerial string
|
|
|
|
}
|
2021-06-25 16:47:47 -05:00
|
|
|
|
|
|
|
func (req *ConnectAuthorizeRequest) TargetPartition() string {
|
|
|
|
return req.PartitionOrDefault()
|
|
|
|
}
|