From 9a4736fa34b310bb2d76371a72173ad984516050 Mon Sep 17 00:00:00 2001 From: Chief-Rishab Date: Sun, 26 Nov 2023 08:12:21 +0530 Subject: [PATCH] feat(guardian): add api to list default roels while provider creation --- raystack/guardian/v1beta1/guardian.proto | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/raystack/guardian/v1beta1/guardian.proto b/raystack/guardian/v1beta1/guardian.proto index af928b59..1f19ea18 100644 --- a/raystack/guardian/v1beta1/guardian.proto +++ b/raystack/guardian/v1beta1/guardian.proto @@ -153,6 +153,15 @@ service GuardianService { }; } + rpc GetProviderRoles(GetProviderRolesRequest) returns (GetProviderRolesResponse) { + option (google.api.http) = {get: "/v1beta1/providers/{name}/roles"}; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + tags: "Providers"; + summary: "Get Provider Default Roles"; + description: "Get Provider Roles returns a list of roles supported by a provider while creating a new provider"; + }; + } + rpc CreateProvider(CreateProviderRequest) returns (CreateProviderResponse) { option (google.api.http) = { post: "/v1beta1/providers" @@ -554,6 +563,24 @@ message GetProviderTypesResponse { repeated ProviderType provider_types = 1; } +message GetProviderRolesRequest { + string name = 1 [ + (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = + {description: "Name of the provider"} + ]; + string resource_type = 2 [ + (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = + {description: "Resource type for which the roles are to be fetched"} + ]; +} + +message GetProviderRolesResponse { + repeated string roles = 1 [ + (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = + {description: "List of roles supported by the provider"} + ]; +} + message CreateProviderRequest { ProviderConfig config = 1; bool dry_run = 2;