Skip to content

Commit 20f4e5f

Browse files
authored
feat(deployment): run development mode with dex (#1155)
Signed-off-by: Miguel <[email protected]>
1 parent 5dc73d6 commit 20f4e5f

File tree

8 files changed

+41
-52
lines changed

8 files changed

+41
-52
lines changed

app/controlplane/configs/config.devel.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ data:
5656
auth:
5757
oidc:
5858
domain: "http://0.0.0.0:5556/dex"
59-
redirect_url_scheme: "http"
6059
client_id: "chainloop-dev"
6160
client_secret: "ZXhhbXBsZS1hcHAtc2VjcmV0"
6261

app/controlplane/configs/samples/config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ server:
77
auth:
88
# Development credentials for the SSO authentication roundtrip
99
oauth:
10-
redirect_url_scheme: "http"
1110
client_id: MYID
1211
client_secret: SECRET
1312
# HMAC key used to sign the JWTs generated by the controlplane

app/controlplane/internal/conf/controlplane/config/v1/conf.pb.go

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

app/controlplane/internal/conf/controlplane/config/v1/conf.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ syntax = "proto3";
1818
package controlplane.config.v1;
1919

2020
import "buf/validate/validate.proto";
21-
import "credentials/v1/config.proto";
2221
import "controlplane/config/v1/config.proto";
22+
import "credentials/v1/config.proto";
2323
import "google/protobuf/duration.proto";
2424

2525
option go_package = "github.com/chainloop-dev/chainloop/app/controlplane/internal/conf/controlplane/config/v1;conf";
@@ -125,7 +125,6 @@ message Auth {
125125
string domain = 1;
126126
string client_id = 2;
127127
string client_secret = 3;
128-
string redirect_url_scheme = 4;
129128
// Optional login URL that will be used by the CLI to start the OIDC flow
130129
// If not provided, it will default to [controlplane domain]/login
131130
string login_url_override = 5;

deployment/chainloop/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Chainloop is an open source software supply chain control plane, a
77

88
type: application
99
# Bump the patch (not minor, not major) version on each change in the Chart Source code
10-
version: 1.83.0
10+
version: 1.83.1
1111
# Do not update appVersion, this is handled automatically by the release process
1212
appVersion: v0.95.0
1313

deployment/chainloop/README.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ Compatibility with the following Ingress Controllers has been verified, other co
2222
Deploy Chainloop in [development mode](#development) by running
2323

2424
```console
25-
helm install [RELEASE_NAME] oci://ghcr.io/chainloop-dev/charts/chainloop \
26-
--set development=true \
27-
--set controlplane.auth.oidc.url=[OIDC URL] \
28-
--set controlplane.auth.oidc.clientID=[clientID] \
29-
--set controlplane.auth.oidc.clientSecret=[clientSecret]
25+
helm install [RELEASE_NAME] oci://ghcr.io/chainloop-dev/charts/chainloop --set development=true
3026
```
3127

3228
> **CAUTION**: Do not use this mode in production, for that, use the [standard mode](#standard-default) instead.
@@ -152,25 +148,16 @@ The Helm Chart in this mode includes
152148
- Chainloop [Artifact proxy](https://github.com/chainloop-dev/chainloop/tree/main/app/artifact-cas)
153149
- A PostgreSQL dependency enabled by default
154150
- **A pre-configured Hashicorp Vault instance running in development mode (unsealed, in-memory, insecure)**
151+
- **A pre-configured Dex OIDC instance. You can find pre-setup usernames in values.yaml file**
155152

156153
> **CAUTION**: Do not use this mode in production, for that, use the [standard mode](#standard-default) instead.
157154
158-
During installation, you'll need to provide
159-
160-
- Open ID Connect Identity Provider (IDp) settings i.e [Auth0 settings](https://auth0.com/docs/get-started/applications/application-settings#basic-information)
161-
- ~~Connection settings for a secrets storage backend, either [Hashicorp Vault](https://www.vaultproject.io/) or [AWS Secrets Manager](https://aws.amazon.com/secrets-manager)~~
162-
- ~~ECDSA (ES512) key-pair used for Controlplane to CAS Authentication~~
163-
164155
#### Installation examples for development mode
165156

166157
Deploy by leveraging built-in Vault and PostgreSQL instances
167158

168159
```console
169-
helm install [RELEASE_NAME] oci://ghcr.io/chainloop-dev/charts/chainloop \
170-
--set development=true \
171-
--set controlplane.auth.oidc.url=[OIDC URL] \
172-
--set controlplane.auth.oidc.clientID=[clientID] \
173-
--set controlplane.auth.oidc.clientSecret=[clientSecret]
160+
helm install [RELEASE_NAME] oci://ghcr.io/chainloop-dev/charts/chainloop --set development=true
174161
```
175162

176163
## AirGap and Relocation Support

deployment/chainloop/templates/_helpers.tpl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,31 @@ Selector labels
170170
app.kubernetes.io/component: controlplane
171171
{{- end }}
172172

173+
{{/*
174+
OIDC settings, will fallback to development settings if needed
175+
*/}}
176+
{{- define "controlplane.oidc_settings" -}}
177+
{{- if .Values.development }}
178+
{{- with .Values.controlplane.auth }}
179+
domain: "{{ coalesce .oidc.url "http://chainloop-dex:5556/dex" }}"
180+
clientID: "{{ coalesce .oidc.clientID "chainloop-dev" }}"
181+
clientSecret: "{{ coalesce .oidc.clientSecret "ZXhhbXBsZS1hcHAtc2VjcmV0" }}"
182+
{{- if .oidc.loginURLOverride }}
183+
login_url_override: "{{ .oidc.loginURLOverride }}"
184+
{{- end }}
185+
{{- end }}
186+
{{- else }}
187+
{{- with .Values.controlplane.auth }}
188+
domain: "{{ required "oidc URL endpoint required" .oidc.url }}"
189+
client_id: "{{ required "oidc clientID required" .oidc.clientID }}"
190+
client_secret: "{{ required "oidc clientSecret required" .oidc.clientSecret }}"
191+
{{- if .oidc.loginURLOverride }}
192+
login_url_override: "{{ .oidc.loginURLOverride }}"
193+
{{- end }}
194+
{{- end }}
195+
{{- end }}
196+
{{- end }}
197+
173198
{{/*
174199
Create the name of the service account to use
175200
*/}}

deployment/chainloop/templates/controlplane/config.secret.yaml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,7 @@ stringData:
5555
credentials_service: {{- include "chainloop.credentials_service_settings" . | indent 6 }}
5656
5757
auth:
58-
oidc:
59-
{{- with .Values.controlplane.auth }}
60-
redirect_url_scheme: {{ .redirectURLScheme }}
61-
domain: "{{ required "oidc URL endpoint required" .oidc.url }}"
62-
client_id: "{{ required "oidc clientID required" .oidc.clientID }}"
63-
client_secret: "{{ required "oidc clientSecret required" .oidc.clientSecret }}"
64-
{{- if .oidc.loginURLOverride }}
65-
login_url_override: "{{ .oidc.loginURLOverride }}"
66-
{{- end }}
67-
{{- end }}
58+
oidc: {{- include "controlplane.oidc_settings" . | indent 4 }}
6859
6960
# HMAC key used to sign the JWTs generated by the controlplane
7061
# The helper returns the base64 quoted value of the secret

0 commit comments

Comments
 (0)