Skip to content

Commit 301b1f3

Browse files
BRBussyclaude
andauthored
Add verification status method option (#183)
* Add verification_status option to MethodOptions and apply to services Introduce VerificationStatus enum on MethodOptions to enforce client verification requirements at the method level. Apply VERIFIED status to CreateLimitOrder and all AccountService methods. Fix typo in enum value (VEFRIFIED -> VERIFIED). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add GetGroupClient method and fix swapped request message comments - Add GetGroupClient RPC to ClientService for looking up a client by its owning group resource name - Fix swapped comments on GetClientRequest and CreateClientRequest message definitions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1b075be commit 301b1f3

8 files changed

Lines changed: 176 additions & 38 deletions

File tree

go/option/method_options/v1/method_options.pb.go

Lines changed: 86 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/trading/limit_order/v1/service.pb.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/wallet/account/v1/service.pb.go

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/meshtrade/compliance/client/v1/service.proto

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,23 @@ service ClientService {
4646
};
4747
}
4848

49+
// GetGroupClient retrieves the client compliance profile associated with a specific group.
50+
//
51+
// This allows fetching the compliance details of the client that is owned by
52+
// the specified group, using the group's resource name as the lookup key.
53+
rpc GetGroupClient(GetGroupClientRequest) returns (meshtrade.compliance.client.v1.Client) {
54+
option (meshtrade.option.method_options.v1.method_options) = {
55+
type: METHOD_TYPE_READ
56+
access_level: METHOD_ACCESS_LEVEL_AUTHORISED
57+
roles: [
58+
ROLE_COMPLIANCE_ADMIN,
59+
ROLE_COMPLIANCE_VIEWER,
60+
ROLE_COMPLIANCE_CLIENT_ADMIN,
61+
ROLE_COMPLIANCE_CLIENT_VIEWER
62+
]
63+
};
64+
}
65+
4966
// ListClients retrieves a collection of client compliance profiles.
5067
//
5168
// This method is useful for fetching multiple client records at once.
@@ -64,7 +81,7 @@ service ClientService {
6481
}
6582
}
6683

67-
// CreateClientRequest is the message used to create a single client resource.
84+
// GetClientRequest is the message used to request a single client resource.
6885
message GetClientRequest {
6986
// The unique resource name of the client to be retrieved.
7087
// The name serves as the primary identifier for the client resource.
@@ -78,12 +95,25 @@ message GetClientRequest {
7895
}];
7996
}
8097

81-
// GetClientRequest is the message used to request a single client resource.
98+
// CreateClientRequest is the message used to create a single client resource.
8299
message CreateClientRequest {
83100
// Client is the client resource to create.
84101
meshtrade.compliance.client.v1.Client client = 1 [(buf.validate.field) = {required: true}];
85102
}
86103

104+
// GetGroupClientRequest is the message used to request a client resource by its owning group.
105+
message GetGroupClientRequest {
106+
// The resource name of the group whose client is to be retrieved.
107+
// Format: "groups/{group_id}"
108+
string group = 1 [(buf.validate.field) = {
109+
required: true
110+
string: {
111+
len: 33
112+
pattern: "^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$"
113+
}
114+
}];
115+
}
116+
87117
// ListClientsRequest is the message used to request a list of client resources.
88118
message ListClientsRequest {}
89119

proto/meshtrade/option/method_options/v1/method_options.proto

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,22 @@ enum MethodAccessLevel {
6666
METHOD_ACCESS_LEVEL_AUTHORISED = 2;
6767
}
6868

69+
/*
70+
VerificationStatus defines what client verification status is required for access to a method.
71+
*/
72+
enum VerificationStatus {
73+
/*
74+
Default value, should not be used.
75+
*/
76+
VERIFICATION_STATUS_UNSPECIFIED = 0;
77+
78+
/*
79+
Service only accessible if the verification status of the client to which the executing (API)User
80+
is Verified.
81+
*/
82+
VERIFICATION_STATUS_VERIFIED = 1;
83+
}
84+
6985
/*
7086
MethodOptions consolidates three authorization dimensions for RPC methods.
7187
*/
@@ -84,8 +100,15 @@ message MethodOptions {
84100
/*
85101
Roles that grant access to this method.
86102
Used for access control checking if group header is required and/or given.
103+
Optional: Only required when access level is AUTHORISED.
87104
*/
88105
repeated meshtrade.iam.role.v1.Role roles = 3;
106+
107+
/*
108+
Verification status defines what client verification status is required for access to a method.
109+
Optional: If not specified on a method then the method is accessible with any verification status.
110+
*/
111+
VerificationStatus verification_status = 4;
89112
}
90113

91114
/*

proto/meshtrade/trading/limit_order/v1/service.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ service LimitOrderService {
3434
ROLE_TRADING_ADMIN,
3535
ROLE_TRADING_LIMIT_ORDER_ADMIN
3636
]
37+
verification_status: VERIFICATION_STATUS_VERIFIED
3738
};
3839
}
3940

0 commit comments

Comments
 (0)