Skip to content

Commit bc6c9ba

Browse files
BRBussyclaude
andauthored
Unified API Authentication and Method Options Architecture (#90)
* start new method options type * Fix proto syntax error and regenerate SDKs - Fix missing closing quote in api_user service.proto import statement - Regenerate Go SDK with corrected proto definitions - Add generated SDK code for new method_options package across Go, Python, and TypeScript 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Refactor all services to use unified method_options Migrate all 8 services (34 methods total) from legacy separate method_type and roles options to the new unified method_options pattern. Changes: - Replace separate imports with unified method_options import - Convert method options to consolidated format with type, access_level, and roles - Apply METHOD_ACCESS_LEVEL_AUTHORISED to all WRITE operations - Apply METHOD_ACCESS_LEVEL_AUTHENTICATED to all READ operations Services updated: - compliance/client/v1 (3 methods) - iam/group/v1 (5 methods) - iam/user/v1 (7 methods) - ledger/transaction/v1 (2 methods) - reporting/account_report/v1 (2 methods) - trading/limit_order/v1 (7 methods) - trading/market_order/v1 (1 method) - wallet/account/v1 (7 methods) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * start code generation upgrade * update code generator to generate improved service index files * add missing required: true * fix protoc-gen-meshdoc: add type column, fix required detection, support nested tables - Add Type column to method parameter documentation tables with fully qualified type names - Fix Required field detection to only use explicit required:true from buf.validate - Add support for nested tables when documenting inline message types - Update FieldInfo and FieldTemplateData structs with NestedFields for recursive parsing - Regenerate Go, Python, and TypeScript SDKs from protobuf changes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * make sidebar hideable * bump docusaurus versions * fix protoc-gen-meshdoc: add response field tables for non-resource returns Generate HTML tables with Field, Type, and Description columns for response objects (methods returning *Response types). Resource returns continue to show links to type documentation. Changes: - Add ResponseFields to MethodDocData for template rendering - Add OutputMessage reference to MethodInfo for field parsing - Parse response message fields when IsResourceReturn is false - Update method_doc.mdx.tmpl to render table for response objects - Support nested field structures with recursive table rendering Fixes documentation generation issue where response objects showed only the message name without field details. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix message type documentation to use HTML tables instead of MD tables Update protoc-gen-meshdoc message_doc.mdx.tmpl template to generate HTML tables for message type documentation files. This improves rendering in the documentation site and provides better support for complex field descriptions with proper MDX/JSX escaping. - Replace MD table syntax with semantic HTML table structure - Add accessibility attributes (scope="col") to table headers - Use normalizeTable function for proper curly brace escaping and newline normalization in descriptions - Maintain backward compatibility with enum documentation (unchanged) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Clean up after ApiUser to APIUser capitalization change Fixes all breaking changes from the protobuf service name update: - Remove duplicate documentation directories (old vs new naming) - Fix Java package structure and move files to correct api_user package - Update Python test imports to use new capitalized names - Fix Go integration tests with proper error handling - Update generated documentation examples to use NewAPIUserService All language SDKs now pass linting and tests successfully. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix auto generated docs --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 61c60e2 commit bc6c9ba

100 files changed

Lines changed: 3188 additions & 2626 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package main
2+
3+
import (
4+
"context"
5+
"log"
6+
7+
api_userv1 "github.com/meshtrade/api/go/iam/api_user/v1"
8+
)
9+
10+
func main() {
11+
ctx := context.Background()
12+
13+
// Default configuration is used and credentials come from MESH_API_CREDENTIALS
14+
// environment variable or default discovery methods. Zero config required
15+
// unless you want custom configuration.
16+
service, err := api_userv1.NewAPIUserService()
17+
if err != nil {
18+
log.Fatalf("Failed to create service: %v", err)
19+
}
20+
defer service.Close()
21+
22+
// Create request with service-specific parameters
23+
request := &api_userv1.ActivateAPIUserRequest{
24+
// FIXME: Populate service-specific request fields
25+
}
26+
27+
// Call the ActivateAPIUser method
28+
apiUser, err := service.ActivateAPIUser(ctx, request)
29+
if err != nil {
30+
log.Fatalf("ActivateAPIUser failed: %v", err)
31+
}
32+
33+
// FIXME: Add relevant response object usage
34+
log.Printf("ActivateAPIUser successful: %+v", apiUser)
35+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import co.meshtrade.api.iam.api_user.v1.ApiUserService;
2+
import co.meshtrade.api.iam.api_user.v1.Service.ActivateAPIUserRequest;
3+
import co.meshtrade.api.iam.api_user.v1.ApiUser.APIUser;
4+
5+
import java.util.Optional;
6+
7+
public class ActivateAPIUserExample {
8+
public static void main(String[] args) {
9+
// Default configuration is used and credentials come from MESH_API_CREDENTIALS
10+
// environment variable or default discovery methods. Zero config required
11+
// unless you want custom configuration.
12+
try (ApiUserService service = new ApiUserService()) {
13+
// Create request with service-specific parameters
14+
ActivateAPIUserRequest request = ActivateAPIUserRequest.newBuilder()
15+
// FIXME: Populate service-specific request fields
16+
.build();
17+
18+
// Call the ActivateAPIUser method
19+
APIUser apiUser = service.activateAPIUser(request, Optional.empty());
20+
21+
// FIXME: Add relevant response object usage
22+
System.out.println("ActivateAPIUser successful: " + apiUser);
23+
} catch (Exception e) {
24+
System.err.println("ActivateAPIUser failed: " + e.getMessage());
25+
e.printStackTrace();
26+
}
27+
}
28+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from meshtrade.iam.api_user.v1 import (
2+
ActivateAPIUserRequest,
3+
APIUserService,
4+
)
5+
6+
7+
def main():
8+
# Default configuration is used and credentials come from MESH_API_CREDENTIALS
9+
# environment variable or default discovery methods. Zero config required
10+
# unless you want custom configuration.
11+
service = APIUserService()
12+
13+
with service:
14+
# Create request with service-specific parameters
15+
request = ActivateAPIUserRequest(
16+
# FIXME: Populate service-specific request fields
17+
)
18+
19+
# Call the ActivateAPIUser method
20+
api_user = service.activate_apiuser(request)
21+
22+
# FIXME: Add relevant response object usage
23+
print("ActivateAPIUser successful:", api_user)
24+
25+
26+
if __name__ == "__main__":
27+
main()

docs/docs/api-reference/iam/api_user/v1/service/activate-api-user/example.go

Lines changed: 0 additions & 37 deletions
This file was deleted.

docs/docs/api-reference/iam/api_user/v1/service/activate-api-user/example.java

Lines changed: 0 additions & 30 deletions
This file was deleted.

docs/docs/api-reference/iam/api_user/v1/service/activate-api-user/example.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/docs/api-reference/iam/api_user/v1/service/assign-roles-to-a-p-i-user/example.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func main() {
1313
// Default configuration is used and credentials come from MESH_API_CREDENTIALS
1414
// environment variable or default discovery methods. Zero config required
1515
// unless you want custom configuration.
16-
service, err := api_userv1.NewApiUserService()
16+
service, err := api_userv1.NewAPIUserService()
1717
if err != nil {
1818
log.Fatalf("Failed to create service: %v", err)
1919
}

docs/docs/api-reference/iam/api_user/v1/service/assign-roles-to-a-p-i-user/index.mdx

Lines changed: 0 additions & 59 deletions
This file was deleted.
Binary file not shown.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package main
2+
3+
import (
4+
"context"
5+
"log"
6+
7+
api_userv1 "github.com/meshtrade/api/go/iam/api_user/v1"
8+
)
9+
10+
func main() {
11+
ctx := context.Background()
12+
13+
// Default configuration is used and credentials come from MESH_API_CREDENTIALS
14+
// environment variable or default discovery methods. Zero config required
15+
// unless you want custom configuration.
16+
service, err := api_userv1.NewAPIUserService()
17+
if err != nil {
18+
log.Fatalf("Failed to create service: %v", err)
19+
}
20+
defer service.Close()
21+
22+
// Create request with service-specific parameters
23+
request := &api_userv1.CreateAPIUserRequest{
24+
// FIXME: Populate service-specific request fields
25+
}
26+
27+
// Call the CreateAPIUser method
28+
apiUser, err := service.CreateAPIUser(ctx, request)
29+
if err != nil {
30+
log.Fatalf("CreateAPIUser failed: %v", err)
31+
}
32+
33+
// FIXME: Add relevant response object usage
34+
log.Printf("CreateAPIUser successful: %+v", apiUser)
35+
}

0 commit comments

Comments
 (0)