Skip to content
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
68 changes: 63 additions & 5 deletions iam/v1/iam.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import "api/rbac.proto";
import "google/api/annotations.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/alphauslabs/blueapi/iam";
option java_package = "cloud.alphaus.api.iam";
Expand Down Expand Up @@ -298,14 +299,29 @@ service Iam {
body: "*"
};
}


// Gets experimental UI preferences for the authenticated MSP.
rpc GetExperimentalUIPreferences(GetExperimentalUIPreferencesRequest) returns (GetExperimentalUIPreferencesResponse) {
option (google.api.http) = {
get: "/iam/v1/experimentalui/preferences"
};
}

// Creates or updates an experimental UI preference for a specific component.
rpc UpsertExperimentalUIPreference(UpsertExperimentalUIPreferenceRequest) returns (UpsertExperimentalUIPreferenceResponse) {
option (google.api.http) = {
put: "/iam/v1/experimentalui/preferences/{component_id}"
body: "*"
};
}

// WORK-IN-PROGRESS: Unlocks ripple or wave user account.
rpc UnlockUserAccount(UnlockUserAccountRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/iam/v1/{domain}/account:unlock"
body: "*"
};
}
}
}

// Request message for the Iam.WhoAmI rpc.
Expand Down Expand Up @@ -681,17 +697,59 @@ message ResetRipplePasswordResponse {
string email = 2;
}

// ExperimentalUIPreference holds the UI version preference and banner state for a single component.
message ExperimentalUIPreference {
// The component identifier this preference applies to.
string component_id = 1;

// The selected UI version for the component (e.g. "v1" or "v2").
string version = 2;

// Whether the experimental banner has been dismissed for this component.
bool banner_dismissed = 3;

// The timestamp of the last update.
google.protobuf.Timestamp updated_at = 4;
}

// Request message for the Iam.GetExperimentalUIPreferences rpc.
// The MSP identity is derived from the auth token server-side.
message GetExperimentalUIPreferencesRequest {}

// Response message for the Iam.GetExperimentalUIPreferences rpc.
message GetExperimentalUIPreferencesResponse {
// The list of experimental UI preferences for the authenticated MSP.
repeated ExperimentalUIPreference preferences = 1;
}

// Request message for the Iam.UpsertExperimentalUIPreference rpc.
message UpsertExperimentalUIPreferenceRequest {
// The component identifier to create or update a preference for.
string component_id = 1;

// The selected UI version for the component (e.g. "v1" or "v2").
string version = 2;

// Whether the experimental banner has been dismissed for this component.
bool banner_dismissed = 3;
}

// Response message for the Iam.UpsertExperimentalUIPreference rpc.
message UpsertExperimentalUIPreferenceResponse {
// The created or updated preference.
ExperimentalUIPreference preference = 1;
}

message UnlockUserAccountRequest {
// Required. Valid values are 'ripple' and 'wave'
string domain = 1;

// Required. The email of the user account to unlock.
string email = 2;

// IsRoot is true if Ripple or Wave root user, false if sub user.
bool is_root = 3;

// Required if wave sub user.
string user_name = 4;
}
}
124 changes: 124 additions & 0 deletions openapiv2/apidocs.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1924,6 +1924,69 @@
]
}
},
"/iam/v1/experimentalui/preferences": {
"get": {
"summary": "Gets experimental UI preferences for the authenticated MSP.",
"operationId": "Iam_GetExperimentalUIPreferences",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1GetExperimentalUIPreferencesResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/googlerpcStatus"
}
}
},
"tags": [
"Iam"
]
}
},
"/iam/v1/experimentalui/preferences/{component_id}": {
"put": {
"summary": "Creates or updates an experimental UI preference for a specific component.",
"operationId": "Iam_UpsertExperimentalUIPreference",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1UpsertExperimentalUIPreferenceResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/googlerpcStatus"
}
}
},
"parameters": [
{
"name": "component_id",
"description": "The component identifier to create or update a preference for.",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1UpsertExperimentalUIPreferenceRequest"
}
}
],
"tags": [
"Iam"
]
}
},
"/iam/v1/ripple/password:reset": {
"post": {
"summary": "WORK-IN-PROGRESS: Reset ripple password using code from email",
Expand Down Expand Up @@ -48562,6 +48625,67 @@
},
"title": "Response message for ResetPassword"
},
"v1ExperimentalUIPreference": {
"type": "object",
"properties": {
"component_id": {
"type": "string",
"description": "The component identifier this preference applies to."
},
"version": {
"type": "string",
"description": "The selected UI version for the component (e.g. \"v1\" or \"v2\")."
},
"banner_dismissed": {
"type": "boolean",
"description": "Whether the experimental banner has been dismissed for this component."
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "The timestamp of the last update."
}
},
"description": "RippleExperimentalPreference holds the UI version preference and banner state for a single component."
},
"v1GetExperimentalUIPreferencesResponse": {
"type": "object",
"properties": {
"preferences": {
"type": "array",
"items": {
"$ref": "#/definitions/v1ExperimentalUIPreference"
},
"description": "The list of experimental UI preferences for the authenticated MSP."
}
}
},
"v1UpsertExperimentalUIPreferenceRequest": {
"type": "object",
"properties": {
"component_id": {
"type": "string",
"description": "The component identifier to create or update a preference for."
},
"version": {
"type": "string",
"description": "The selected UI version for the component (e.g. \"v1\" or \"v2\")."
},
"banner_dismissed": {
"type": "boolean",
"description": "Whether the experimental banner has been dismissed for this component."
}
}
},
"v1UpsertExperimentalUIPreferenceResponse": {
"type": "object",
"properties": {
"preference": {
"$ref": "#/definitions/v1ExperimentalUIPreference",
"description": "The created or updated preference."
}
}
},
"v1ResetRipplePasswordRequest": {
"type": "object",
"properties": {
Expand Down
Loading