From 4c0454a0e55cd15750d3e007d5cc06ca6e186b6e Mon Sep 17 00:00:00 2001 From: Kush Sharma Date: Tue, 7 Nov 2023 09:15:54 +0530 Subject: [PATCH] feat(frontier): replace an existing policy - ReplacePolicy will take an id of the existing policy and replace it with the provided policy body. Signed-off-by: Kush Sharma --- raystack/frontier/v1beta1/frontier.proto | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/raystack/frontier/v1beta1/frontier.proto b/raystack/frontier/v1beta1/frontier.proto index 145b51b3..7d591abb 100644 --- a/raystack/frontier/v1beta1/frontier.proto +++ b/raystack/frontier/v1beta1/frontier.proto @@ -951,6 +951,18 @@ service FrontierService { }; } + rpc ReplacePolicy(ReplacePolicyRequest) returns (ReplacePolicyResponse) { + option (google.api.http) = { + post: "/v1beta1/policies/{id}/replace", + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + tags: "Policy"; + summary: "Replace policy"; + description: "Deletes an existing policy and create new."; + }; + } + // Relations rpc CreateRelation(CreateRelationRequest) returns (CreateRelationResponse) { option (google.api.http) = { @@ -2323,6 +2335,15 @@ message DeletePolicyRequest { message DeletePolicyResponse {} +message ReplacePolicyRequest { + string id = 1; + PolicyRequestBody body = 2; +} + +message ReplacePolicyResponse { + Policy policy = 1; +} + message RelationRequestBody { reserved 2, 5;