Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(frontier): APIs to filter projects explicitly added #326

Merged
merged 1 commit into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion raystack/frontier/v1beta1/admin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,19 @@ service AdminService {
description: "Adds a user to a platform.";
};
}

// Checkout
rpc DelegatedCheckout(DelegatedCheckoutRequest) returns (DelegatedCheckoutResponse) {
option (google.api.http) = {
post: "/v1beta1/admin/organizations/{org_id}/billing/{billing_id}/checkouts",
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Checkout";
summary: "Checkout a feature or subscription";
description: "Checkout a feature to buy it one time or start a subscription plan on a billing account manually. It bypasses billing engine.";
};
}
}

message ListAllUsersRequest {
Expand Down Expand Up @@ -493,4 +506,20 @@ message AddPlatformUserRequest {
];
}

message AddPlatformUserResponse {}
message AddPlatformUserResponse {}

message DelegatedCheckoutRequest {
string org_id = 1 [(validate.rules).string.min_len = 3];
// ID of the billing account to update the subscription for
string billing_id = 2 [(validate.rules).string.min_len = 1];

// Subscription to create
CheckoutSubscriptionBody subscription_body = 10;
// Feature to buy
CheckoutFeatureBody feature_body = 11;
}

message DelegatedCheckoutResponse {
// Checkout session
CheckoutSession checkout_session = 1;
}
17 changes: 8 additions & 9 deletions raystack/frontier/v1beta1/frontier.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1790,15 +1790,6 @@ message CheckFeatureEntitlementResponse {
bool status = 1;
}

message CheckoutSubscriptionBody {
string plan = 1;
int32 trail_days = 2;
}

message CheckoutFeatureBody {
string feature = 1;
}

message CreateCheckoutRequest {
string org_id = 1 [(validate.rules).string.min_len = 3];
// ID of the billing account to update the subscription for
Expand Down Expand Up @@ -2110,6 +2101,14 @@ message ListProjectsByCurrentUserRequest {
// query params are set as with_permissions=get&with_permissions=delete
// to be represented as array
repeated string with_permissions = 2;

// Note: this is a bad design and would recommend against using this filter
// It is used to list only projects which are explicitly given permission
// to user. A user could get permission to access a project either via getting
// access from organization level role or a group. But for some reason we want
// only users who could have inherited these permissions from top but we only
// want explictly added ones.
bool non_inherited = 3;
}

message ListProjectsByCurrentUserResponse {
Expand Down
9 changes: 9 additions & 0 deletions raystack/frontier/v1beta1/models.proto
Original file line number Diff line number Diff line change
Expand Up @@ -700,4 +700,13 @@ message PreferenceRequestBody {
pattern: "^[A-Za-z0-9-_]+$"
}];
string value = 3;
}

message CheckoutSubscriptionBody {
string plan = 1;
int32 trail_days = 2;
}

message CheckoutFeatureBody {
string feature = 1;
}
Loading