Skip to content

Commit a24ba12

Browse files
feat(front): UI for saml autoprovisioning and group mapping (#109)
## 📝 Description - Adds option to enable SAML JIT user provisioning and Group mapping page - Adds implementation of the internal_api okta service ![image](https://github.com/user-attachments/assets/eb56c66a-0451-4aef-a55a-92088756ce57) ![image](https://github.com/user-attachments/assets/38c8bc33-8a48-474a-b52e-9702a05c7ab6) ![image](https://github.com/user-attachments/assets/f1119f24-3a27-4f88-a900-a5baac96c819) ## ✅ Checklist - [x] I have tested this change - [ ] This change requires documentation update --------- Co-authored-by: VeljkoMaksimovic <[email protected]>
1 parent f043ba4 commit a24ba12

35 files changed

+1651
-175
lines changed

ee/rbac/lib/internal_api/guard.pb.ex

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,25 @@ defmodule InternalApi.Guard.Operation.Name do
6565
field(:ManageDeploymentTargets, 22)
6666
end
6767

68+
defmodule InternalApi.Guard.ChangeEmailRequest do
69+
@moduledoc false
70+
71+
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
72+
73+
field(:requester_id, 1, type: :string, json_name: "requesterId")
74+
field(:user_id, 2, type: :string, json_name: "userId")
75+
field(:email, 3, type: :string)
76+
end
77+
78+
defmodule InternalApi.Guard.ChangeEmailResponse do
79+
@moduledoc false
80+
81+
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
82+
83+
field(:email, 1, type: :string)
84+
field(:msg, 2, type: :string)
85+
end
86+
6887
defmodule InternalApi.Guard.ResetPasswordRequest do
6988
@moduledoc false
7089

@@ -536,6 +555,8 @@ defmodule InternalApi.Guard.Guard.Service do
536555
InternalApi.Guard.ResetPasswordRequest,
537556
InternalApi.Guard.ResetPasswordResponse
538557
)
558+
559+
rpc(:ChangeEmail, InternalApi.Guard.ChangeEmailRequest, InternalApi.Guard.ChangeEmailResponse)
539560
end
540561

541562
defmodule InternalApi.Guard.Guard.Stub do

ee/rbac/lib/internal_api/okta.pb.ex

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ defmodule InternalApi.Okta.OktaIntegration do
1111
field(:idempotency_token, 6, type: :string, json_name: "idempotencyToken")
1212
field(:saml_issuer, 7, type: :string, json_name: "samlIssuer")
1313
field(:sso_url, 8, type: :string, json_name: "ssoUrl")
14+
field(:jit_provisioning_enabled, 9, type: :bool, json_name: "jitProvisioningEnabled")
1415
end
1516

1617
defmodule InternalApi.Okta.SetUpRequest do
@@ -24,6 +25,7 @@ defmodule InternalApi.Okta.SetUpRequest do
2425
field(:saml_certificate, 4, type: :string, json_name: "samlCertificate")
2526
field(:saml_issuer, 5, type: :string, json_name: "samlIssuer")
2627
field(:sso_url, 6, type: :string, json_name: "ssoUrl")
28+
field(:jit_provisioning_enabled, 7, type: :bool, json_name: "jitProvisioningEnabled")
2729
end
2830

2931
defmodule InternalApi.Okta.SetUpResponse do
@@ -50,6 +52,48 @@ defmodule InternalApi.Okta.GenerateScimTokenResponse do
5052
field(:token, 1, type: :string)
5153
end
5254

55+
defmodule InternalApi.Okta.SetUpGroupMappingRequest do
56+
@moduledoc false
57+
58+
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
59+
60+
field(:org_id, 1, type: :string, json_name: "orgId")
61+
field(:default_role_id, 2, type: :string, json_name: "defaultRoleId")
62+
field(:mappings, 3, repeated: true, type: InternalApi.Okta.GroupMapping)
63+
end
64+
65+
defmodule InternalApi.Okta.SetUpGroupMappingResponse do
66+
@moduledoc false
67+
68+
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
69+
end
70+
71+
defmodule InternalApi.Okta.DescribeGroupMappingRequest do
72+
@moduledoc false
73+
74+
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
75+
76+
field(:org_id, 1, type: :string, json_name: "orgId")
77+
end
78+
79+
defmodule InternalApi.Okta.DescribeGroupMappingResponse do
80+
@moduledoc false
81+
82+
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
83+
84+
field(:default_role_id, 1, type: :string, json_name: "defaultRoleId")
85+
field(:mappings, 2, repeated: true, type: InternalApi.Okta.GroupMapping)
86+
end
87+
88+
defmodule InternalApi.Okta.GroupMapping do
89+
@moduledoc false
90+
91+
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
92+
93+
field(:semaphore_group_id, 1, type: :string, json_name: "semaphoreGroupId")
94+
field(:okta_group_id, 2, type: :string, json_name: "oktaGroupId")
95+
end
96+
5397
defmodule InternalApi.Okta.ListRequest do
5498
@moduledoc false
5599

@@ -115,6 +159,18 @@ defmodule InternalApi.Okta.Okta.Service do
115159
rpc(:ListUsers, InternalApi.Okta.ListUsersRequest, InternalApi.Okta.ListUsersResponse)
116160

117161
rpc(:Destroy, InternalApi.Okta.DestroyRequest, InternalApi.Okta.DestroyResponse)
162+
163+
rpc(
164+
:SetUpGroupMapping,
165+
InternalApi.Okta.SetUpGroupMappingRequest,
166+
InternalApi.Okta.SetUpGroupMappingResponse
167+
)
168+
169+
rpc(
170+
:DescribeGroupMapping,
171+
InternalApi.Okta.DescribeGroupMappingRequest,
172+
InternalApi.Okta.DescribeGroupMappingResponse
173+
)
118174
end
119175

120176
defmodule InternalApi.Okta.Okta.Stub do

ee/rbac/lib/internal_api/organization.pb.ex

Lines changed: 0 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,6 @@ defmodule InternalApi.Organization.Member.Role do
2727
field(:ADMIN, 2)
2828
end
2929

30-
defmodule InternalApi.Organization.Quota.Type do
31-
@moduledoc false
32-
33-
use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
34-
35-
field(:MAX_PEOPLE_IN_ORG, 0)
36-
field(:MAX_PARALELLISM_IN_ORG, 1)
37-
field(:MAX_PROJECTS_IN_ORG, 7)
38-
field(:MAX_PARALLEL_E1_STANDARD_2, 2)
39-
field(:MAX_PARALLEL_E1_STANDARD_4, 3)
40-
field(:MAX_PARALLEL_E1_STANDARD_8, 4)
41-
field(:MAX_PARALLEL_A1_STANDARD_4, 5)
42-
field(:MAX_PARALLEL_A1_STANDARD_8, 6)
43-
end
44-
4530
defmodule InternalApi.Organization.OrganizationContact.ContactType do
4631
@moduledoc false
4732

@@ -129,23 +114,6 @@ defmodule InternalApi.Organization.CreateResponse do
129114
field(:organization, 2, type: InternalApi.Organization.Organization)
130115
end
131116

132-
defmodule InternalApi.Organization.CreateWithQuotasRequest do
133-
@moduledoc false
134-
135-
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
136-
137-
field(:organization, 1, type: InternalApi.Organization.Organization)
138-
field(:quotas, 2, repeated: true, type: InternalApi.Organization.Quota)
139-
end
140-
141-
defmodule InternalApi.Organization.CreateWithQuotasResponse do
142-
@moduledoc false
143-
144-
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
145-
146-
field(:organization, 1, type: InternalApi.Organization.Organization)
147-
end
148-
149117
defmodule InternalApi.Organization.UpdateRequest do
150118
@moduledoc false
151119

@@ -420,7 +388,6 @@ defmodule InternalApi.Organization.Organization do
420388
field(:allowed_id_providers, 13, repeated: true, type: :string, json_name: "allowedIdProviders")
421389
field(:deny_member_workflows, 14, type: :bool, json_name: "denyMemberWorkflows")
422390
field(:deny_non_member_workflows, 15, type: :bool, json_name: "denyNonMemberWorkflows")
423-
field(:quotas, 8, repeated: true, type: InternalApi.Organization.Quota)
424391
field(:settings, 16, repeated: true, type: InternalApi.Organization.OrganizationSetting)
425392
end
426393

@@ -450,15 +417,6 @@ defmodule InternalApi.Organization.Member do
450417
field(:github_uid, 8, type: :string, json_name: "githubUid")
451418
end
452419

453-
defmodule InternalApi.Organization.Quota do
454-
@moduledoc false
455-
456-
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
457-
458-
field(:type, 1, type: InternalApi.Organization.Quota.Type, enum: true)
459-
field(:value, 2, type: :uint32)
460-
end
461-
462420
defmodule InternalApi.Organization.OrganizationSetting do
463421
@moduledoc false
464422

@@ -468,40 +426,6 @@ defmodule InternalApi.Organization.OrganizationSetting do
468426
field(:value, 2, type: :string)
469427
end
470428

471-
defmodule InternalApi.Organization.GetQuotasRequest do
472-
@moduledoc false
473-
474-
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
475-
476-
field(:org_id, 1, type: :string, json_name: "orgId")
477-
field(:types, 2, repeated: true, type: InternalApi.Organization.Quota.Type, enum: true)
478-
end
479-
480-
defmodule InternalApi.Organization.GetQuotaResponse do
481-
@moduledoc false
482-
483-
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
484-
485-
field(:quotas, 1, repeated: true, type: InternalApi.Organization.Quota)
486-
end
487-
488-
defmodule InternalApi.Organization.UpdateQuotasRequest do
489-
@moduledoc false
490-
491-
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
492-
493-
field(:org_id, 1, type: :string, json_name: "orgId")
494-
field(:quotas, 2, repeated: true, type: InternalApi.Organization.Quota)
495-
end
496-
497-
defmodule InternalApi.Organization.UpdateQuotasResponse do
498-
@moduledoc false
499-
500-
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
501-
502-
field(:quotas, 1, repeated: true, type: InternalApi.Organization.Quota)
503-
end
504-
505429
defmodule InternalApi.Organization.RepositoryIntegratorsRequest do
506430
@moduledoc false
507431

@@ -719,12 +643,6 @@ defmodule InternalApi.Organization.OrganizationService.Service do
719643

720644
rpc(:Create, InternalApi.Organization.CreateRequest, InternalApi.Organization.CreateResponse)
721645

722-
rpc(
723-
:CreateWithQuotas,
724-
InternalApi.Organization.CreateWithQuotasRequest,
725-
InternalApi.Organization.CreateWithQuotasResponse
726-
)
727-
728646
rpc(:Update, InternalApi.Organization.UpdateRequest, InternalApi.Organization.UpdateResponse)
729647

730648
rpc(:IsValid, InternalApi.Organization.Organization, InternalApi.Organization.IsValidResponse)
@@ -781,18 +699,6 @@ defmodule InternalApi.Organization.OrganizationService.Service do
781699
InternalApi.Organization.ListSuspensionsResponse
782700
)
783701

784-
rpc(
785-
:UpdateQuotas,
786-
InternalApi.Organization.UpdateQuotasRequest,
787-
InternalApi.Organization.UpdateQuotasResponse
788-
)
789-
790-
rpc(
791-
:GetQuotas,
792-
InternalApi.Organization.GetQuotasRequest,
793-
InternalApi.Organization.GetQuotaResponse
794-
)
795-
796702
rpc(:Destroy, InternalApi.Organization.DestroyRequest, Google.Protobuf.Empty)
797703

798704
rpc(

ee/rbac/lib/internal_api/projecthub.pb.ex

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ defmodule InternalApi.Projecthub.Project.Status.State do
7878
field(:INITIALIZING, 0)
7979
field(:READY, 1)
8080
field(:ERROR, 2)
81+
field(:ONBOARDING, 3)
8182
end
8283

8384
defmodule InternalApi.Projecthub.ListKeysetRequest.Direction do
@@ -472,6 +473,7 @@ defmodule InternalApi.Projecthub.CreateRequest do
472473

473474
field(:metadata, 1, type: InternalApi.Projecthub.RequestMeta)
474475
field(:project, 2, type: InternalApi.Projecthub.Project)
476+
field(:skip_onboarding, 3, type: :bool, json_name: "skipOnboarding")
475477
end
476478

477479
defmodule InternalApi.Projecthub.CreateResponse do
@@ -699,6 +701,23 @@ defmodule InternalApi.Projecthub.GithubAppSwitchResponse do
699701
field(:metadata, 1, type: InternalApi.Projecthub.ResponseMeta)
700702
end
701703

704+
defmodule InternalApi.Projecthub.FinishOnboardingRequest do
705+
@moduledoc false
706+
707+
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
708+
709+
field(:metadata, 1, type: InternalApi.Projecthub.RequestMeta)
710+
field(:id, 2, type: :string)
711+
end
712+
713+
defmodule InternalApi.Projecthub.FinishOnboardingResponse do
714+
@moduledoc false
715+
716+
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
717+
718+
field(:metadata, 1, type: InternalApi.Projecthub.ResponseMeta)
719+
end
720+
702721
defmodule InternalApi.Projecthub.ProjectCreated do
703722
@moduledoc false
704723

@@ -810,6 +829,12 @@ defmodule InternalApi.Projecthub.ProjectService.Service do
810829
InternalApi.Projecthub.GithubAppSwitchRequest,
811830
InternalApi.Projecthub.GithubAppSwitchResponse
812831
)
832+
833+
rpc(
834+
:FinishOnboarding,
835+
InternalApi.Projecthub.FinishOnboardingRequest,
836+
InternalApi.Projecthub.FinishOnboardingResponse
837+
)
813838
end
814839

815840
defmodule InternalApi.Projecthub.ProjectService.Stub do

ee/rbac/lib/internal_api/rbac.pb.ex

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,16 +247,18 @@ end
247247

248248
defmodule InternalApi.RBAC.CountMembersRequest do
249249
@moduledoc false
250-
use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto3
250+
251+
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
251252

252253
field(:org_id, 1, type: :string, json_name: "orgId")
253254
end
254255

255256
defmodule InternalApi.RBAC.CountMembersResponse do
256257
@moduledoc false
257-
use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto3
258258

259-
field(:members, 1, type: :int32, json_name: "members")
259+
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
260+
261+
field(:members, 1, type: :int32)
260262
end
261263

262264
defmodule InternalApi.RBAC.SubjectRoleBinding do

0 commit comments

Comments
 (0)