CCF
Loading...
Searching...
No Matches
audit_format.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3
4#pragma once
5#include "ccf/ds/json.h"
6
7#include <vector>
8
9namespace ccf
10{
11 enum class ActionFormat
12 {
13 COSE = 0,
14 JSON = 1
15 };
17 ActionFormat, {{ActionFormat::COSE, "COSE"}, {ActionFormat::JSON, "JSON"}});
18
19 struct AuditInfo
20 {
22 // Deliberately a string and not a ccf::UserId to allow extended usage, for
23 // example with OpenID
24 std::string user_id;
25 // Format left to the application, Verb + URL with some of kind of
26 // versioning is recommended
27 std::string action_name;
28 };
29
31 DECLARE_JSON_REQUIRED_FIELDS(AuditInfo, format, user_id, action_name)
32}
#define DECLARE_JSON_REQUIRED_FIELDS(TYPE,...)
Definition json.h:714
#define DECLARE_JSON_TYPE(TYPE)
Definition json.h:663
#define DECLARE_JSON_ENUM(TYPE,...)
Definition json.h:837
Definition app_interface.h:14
ActionFormat
Definition audit_format.h:12
Definition audit_format.h:20
std::string user_id
Definition audit_format.h:24
std::string action_name
Definition audit_format.h:27
ActionFormat format
Definition audit_format.h:21