Skip to content

Commit ad68570

Browse files
authored
feat: option to restrict org creation (#2290)
Signed-off-by: Miguel Martinez <[email protected]>
1 parent 479c1c3 commit ad68570

File tree

26 files changed

+402
-264
lines changed

26 files changed

+402
-264
lines changed

app/controlplane/api/controlplane/v1/status.pb.go

Lines changed: 41 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/controlplane/v1/status.proto

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright 2023 The Chainloop Authors.
2+
// Copyright 2023-2025 The Chainloop Authors.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");
55
// you may not use this file except in compliance with the License.
@@ -44,6 +44,8 @@ message InfozResponse {
4444
string version = 2;
4545
// Version of the helm chart used during deployment
4646
string chart_version = 3;
47+
// Whether organization creation is restricted to admins
48+
bool restricted_org_creation = 4;
4749
}
4850

4951
message StatuszResponse {}

app/controlplane/api/controlplane/v1/status_grpc.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/gen/frontend/controlplane/v1/status.ts

Lines changed: 16 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/gen/jsonschema/controlplane.v1.InfozResponse.jsonschema.json

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/gen/jsonschema/controlplane.v1.InfozResponse.schema.json

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/cmd/wire.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ func wireApp(*conf.Bootstrap, credentials.ReaderWriter, log.Logger, sdk.Availabl
6969
)
7070
}
7171

72-
func authzConfig() *authz.Config {
73-
return &authz.Config{ManagedResources: authz.ManagedResources, RolesMap: authz.RolesMap}
72+
func authzConfig(conf *conf.Bootstrap) *authz.Config {
73+
return &authz.Config{ManagedResources: authz.ManagedResources, RolesMap: authz.RolesMap, RestrictOrgCreation: conf.RestrictOrgCreation}
7474
}
7575

7676
func newJWTConfig(conf *conf.Auth) *biz.APITokenJWTConfig {

app/controlplane/cmd/wire_gen.go

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/configs/config.devel.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ server:
1616
# certificate: "../../devel/devkeys/selfsigned/controlplane.crt"
1717
# private_key: "../../devel/devkeys/selfsigned/controlplane.key"
1818

19-
# nats_server:
20-
# uri: nats://0.0.0.0:4222
19+
nats_server:
20+
uri: nats://0.0.0.0:4222
21+
22+
# Restrict organization creation to role:instance:admin
23+
restrict_org_creation: true
2124

2225
certificate_authorities:
2326
- issuer: true
@@ -104,4 +107,4 @@ enable_profiler: true
104107

105108
# federated_authentication:
106109
# enabled: true
107-
# url: http://localhost:8002/machine-identity/verify-token
110+
# url: http://localhost:8002/machine-identity/verify-token

0 commit comments

Comments
 (0)