Use authorization group struct instead of string (#2981)

This commit is contained in:
Alexandre de Souza 2025-04-07 22:12:21 -03:00 committed by GitHub
parent 3899b897f3
commit 710957b265
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 73 additions and 42 deletions

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.Agent 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

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.AgentConnected do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :name, 2, type: :string
field :public_key, 3, type: :string, json_name: "publicKey"

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.AgentJoined do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :agent, 1, type: LivebookProto.Agent
end

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.AgentKey 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 :key, 2, type: :string

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.AgentLeft 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
end

View file

@ -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

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.AppDeploymentStarted do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :app_deployment, 1, type: LivebookProto.AppDeployment, json_name: "appDeployment"
end

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.AppDeploymentStatus 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 :deployment_group_id, 2, type: :string, json_name: "deploymentGroupId"

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.AppDeploymentStatusReport do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :app_deployment_statuses, 1,
repeated: true,

View file

@ -1,5 +1,13 @@
defmodule LivebookProto.AppDeploymentStatusType do
use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
@moduledoc """
We're only using Enum in this case because
the Client is the source of the information,
and the Server will always be up-to-date.
Otherwise, it shouldn't be used.
"""
use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :preparing, 0
field :available, 1

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.AppDeploymentStopped 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
end

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.AppDeploymentUpdated do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :app_deployment, 1, type: LivebookProto.AppDeployment, json_name: "appDeployment"
end

View file

@ -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

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.BillingStatus do
use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto3
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
oneof :type, 0

View file

@ -1,3 +1,3 @@
defmodule LivebookProto.BillingStatusCanceled do
use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto3
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
end

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.BillingStatusCanceling do
use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto3
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :cancel_at, 1, type: :int64, json_name: "cancelAt"
end

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.BillingStatusTrialEnded do
use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto3
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :trial_ends_at, 1, type: :int64, json_name: "trialEndsAt"
end

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.BillingStatusTrialing do
use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto3
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :trial_ends_at, 1, type: :int64, json_name: "trialEndsAt"
end

View file

@ -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

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.DeploymentGroupCreated 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

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.DeploymentGroupDeleted 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
end

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.DeploymentGroupSecret do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :name, 1, type: :string
field :value, 2, type: :string

View file

@ -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

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.EnvironmentVariable do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :name, 1, type: :string
field :value, 2, type: :string

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.Error do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :details, 1, type: :string
end

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.Event do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
oneof :type, 0

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.FileSystem 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

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.FileSystemCreated 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

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.FileSystemDeleted 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
end

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.FileSystemUpdated 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

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.OrgUpdated do
use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto3
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :id, 1, type: :string
field :billing_status, 3, type: LivebookProto.BillingStatus, json_name: "billingStatus"

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.Secret do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :name, 1, type: :string
field :value, 2, type: :string

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.SecretCreated do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :name, 1, type: :string
field :value, 2, type: :string

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.SecretDeleted do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :name, 1, type: :string
end

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.SecretUpdated do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :name, 1, type: :string
field :value, 2, type: :string

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.UserConnected do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :name, 1, type: :string
field :secrets, 2, repeated: true, type: LivebookProto.Secret

View file

@ -1,5 +1,5 @@
defmodule LivebookProto.UserDeleted 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
end

View file

@ -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;