From 2f51f74d0ad6e2c7d99ca8eed188bdad72942b37 Mon Sep 17 00:00:00 2001 From: Alexandre de Souza Date: Mon, 7 Apr 2025 10:16:00 -0300 Subject: [PATCH] Use `AuthorizationGroup` struct instead of string --- proto/lib/livebook_proto/app_deployment.pb.ex | 8 ++++++-- proto/lib/livebook_proto/authorization_group.pb.ex | 6 ++++++ proto/lib/livebook_proto/deployment_group.pb.ex | 8 ++++++-- .../lib/livebook_proto/deployment_group_updated.pb.ex | 8 ++++++-- proto/messages.proto | 11 ++++++++--- 5 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 proto/lib/livebook_proto/authorization_group.pb.ex diff --git a/proto/lib/livebook_proto/app_deployment.pb.ex b/proto/lib/livebook_proto/app_deployment.pb.ex index 25fc48f57..05346c922 100644 --- a/proto/lib/livebook_proto/app_deployment.pb.ex +++ b/proto/lib/livebook_proto/app_deployment.pb.ex @@ -1,5 +1,5 @@ defmodule LivebookProto.AppDeployment do - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3 field :id, 1, type: :string field :title, 2, type: :string @@ -12,5 +12,9 @@ defmodule LivebookProto.AppDeployment do field :multi_session, 9, type: :bool, json_name: "multiSession" field :access_type, 10, type: :string, json_name: "accessType" field :version, 11, type: :string - field :authorization_groups, 12, repeated: true, type: :string, json_name: "authorizationGroups" + + field :authorization_groups, 12, + repeated: true, + type: LivebookProto.AuthorizationGroup, + json_name: "authorizationGroups" end diff --git a/proto/lib/livebook_proto/authorization_group.pb.ex b/proto/lib/livebook_proto/authorization_group.pb.ex new file mode 100644 index 000000000..5f685aeac --- /dev/null +++ b/proto/lib/livebook_proto/authorization_group.pb.ex @@ -0,0 +1,6 @@ +defmodule LivebookProto.AuthorizationGroup do + use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3 + + field :oidc_provider_id, 1, type: :string, json_name: "oidcProviderId" + field :group_name, 2, type: :string, json_name: "groupName" +end diff --git a/proto/lib/livebook_proto/deployment_group.pb.ex b/proto/lib/livebook_proto/deployment_group.pb.ex index a1be389aa..17de2ca14 100644 --- a/proto/lib/livebook_proto/deployment_group.pb.ex +++ b/proto/lib/livebook_proto/deployment_group.pb.ex @@ -1,5 +1,5 @@ defmodule LivebookProto.DeploymentGroup do - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3 field :id, 1, type: :string field :name, 2, type: :string @@ -17,5 +17,9 @@ defmodule LivebookProto.DeploymentGroup do json_name: "environmentVariables" field :teams_auth, 11, type: :bool, json_name: "teamsAuth" - field :authorization_groups, 12, repeated: true, type: :string, json_name: "authorizationGroups" + + field :authorization_groups, 12, + repeated: true, + type: LivebookProto.AuthorizationGroup, + json_name: "authorizationGroups" end diff --git a/proto/lib/livebook_proto/deployment_group_updated.pb.ex b/proto/lib/livebook_proto/deployment_group_updated.pb.ex index 457837597..d5c99b8d7 100644 --- a/proto/lib/livebook_proto/deployment_group_updated.pb.ex +++ b/proto/lib/livebook_proto/deployment_group_updated.pb.ex @@ -1,5 +1,5 @@ defmodule LivebookProto.DeploymentGroupUpdated do - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3 field :id, 1, type: :string field :name, 2, type: :string @@ -16,5 +16,9 @@ defmodule LivebookProto.DeploymentGroupUpdated do json_name: "environmentVariables" field :teams_auth, 10, type: :bool, json_name: "teamsAuth" - field :authorization_groups, 11, repeated: true, type: :string, json_name: "authorizationGroups" + + field :authorization_groups, 11, + repeated: true, + type: LivebookProto.AuthorizationGroup, + json_name: "authorizationGroups" end diff --git a/proto/messages.proto b/proto/messages.proto index ae72f8af1..e2d42f839 100644 --- a/proto/messages.proto +++ b/proto/messages.proto @@ -66,7 +66,7 @@ message DeploymentGroup { string url = 9; repeated EnvironmentVariable environment_variables = 10; bool teams_auth = 11; - repeated string authorization_groups = 12; + repeated AuthorizationGroup authorization_groups = 12; } message DeploymentGroupCreated { @@ -92,7 +92,7 @@ message DeploymentGroupUpdated { string url = 8; repeated EnvironmentVariable environment_variables = 9; bool teams_auth = 10; - repeated string authorization_groups = 11; + repeated AuthorizationGroup authorization_groups = 11; } message DeploymentGroupDeleted { @@ -139,7 +139,7 @@ message AppDeployment { bool multi_session = 9; string access_type = 10; string version = 11; - repeated string authorization_groups = 12; + repeated AuthorizationGroup authorization_groups = 12; } message AppDeploymentStarted { @@ -206,6 +206,11 @@ message EnvironmentVariable { string value = 2; } +message AuthorizationGroup { + string oidc_provider_id = 1; + string group_name = 2; +} + message Event { oneof type { SecretCreated secret_created = 1;