| #ifndef THIRD_PARTY_MILOTIC_EXTERNAL_CC_AUTHZ_PEER_IDENTITY_H_ |
| #define THIRD_PARTY_MILOTIC_EXTERNAL_CC_AUTHZ_PEER_IDENTITY_H_ |
| |
| #include <optional> |
| #include <string> |
| |
| #include "absl/strings/str_cat.h" |
| |
| namespace milotic::authz { |
| |
| // Peer's identity. |
| // Defined in third_party/milotic/internal/auth_config/schema. |
| // |
| // Lives in its own header (rather than config_parser.h) so that dependency- |
| // lean consumers -- RedfishAuthorizerInterface and the HFT service core -- |
| // can name the type without pulling in the JSON-based configuration |
| // machinery. |
| struct PeerSpiffeIdentity { |
| std::string spiffe_id; |
| std::optional<std::string> fqdn; |
| |
| std::string DebugString() const { |
| return absl::StrCat("|spiffe_id|='", spiffe_id, "'; |fqdn|='", |
| fqdn.value_or(""), "'"); |
| } |
| }; |
| |
| } // namespace milotic::authz |
| |
| #endif // THIRD_PARTY_MILOTIC_EXTERNAL_CC_AUTHZ_PEER_IDENTITY_H_ |