Skip to content

Commit

Permalink
add auth role routing
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalii-codefresh committed May 29, 2024
1 parent dc067d0 commit 9619068
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/internal-gateway/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: v0.0.0
description: A Helm chart for Codefresh Internal Gateway
name: internal-gateway
version: 0.6.0
version: 0.7.0
home: https://github.com/codefresh-io/helm-charts
keywords:
- codefresh
Expand Down
2 changes: 1 addition & 1 deletion charts/internal-gateway/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# internal-gateway

![Version: 0.6.0](https://img.shields.io/badge/Version-0.6.0-informational?style=flat-square) ![AppVersion: v0.0.0](https://img.shields.io/badge/AppVersion-v0.0.0-informational?style=flat-square)
![Version: 0.7.0](https://img.shields.io/badge/Version-0.6.0-informational?style=flat-square) ![AppVersion: v0.0.0](https://img.shields.io/badge/AppVersion-v0.0.0-informational?style=flat-square)

A Helm chart for Codefresh Internal Gateway

Expand Down
3 changes: 3 additions & 0 deletions charts/internal-gateway/templates/_default_values.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{{- define "internal-gateway.default-values" }}
codefresh:
serviceEndpoints:
cfapi-auth:
svc: '{{ .Release.Name }}-{{ index .Values.codefresh "cfapi-auth-svc" }}.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}'
port: {{ index .Values.codefresh "cfapi-auth-port" }}
cfapi-endpoints:
svc: '{{ .Release.Name }}-{{ index .Values.codefresh "cfapi-endpoints-svc" }}.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}'
port: {{ index .Values.codefresh "cfapi-endpoints-port" }}
Expand Down
14 changes: 12 additions & 2 deletions charts/internal-gateway/templates/_location_map.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ nginx:
/api/auth/authenticate:
enabled: true
proxy:
host: {{ index $endpoints.serviceEndpoints "cfapi-endpoints" "svc" }}
port: {{ index $endpoints.serviceEndpoints "cfapi-endpoints" "port" }}
host: {{ index $endpoints.serviceEndpoints "cfapi-auth" "svc" }}
port: {{ index $endpoints.serviceEndpoints "cfapi-auth" "port" }}
proxyPassSnippet: |
proxy_pass_request_body off;
locationSnippet: |
Expand All @@ -130,6 +130,16 @@ nginx:
locationDirectives:
{{- $presets.locationDirectives | toYaml | nindent 10 }}

/api/auth/:
enabled: true
proxy:
host: {{ index $endpoints.serviceEndpoints "cfapi-auth" "svc" }}
port: {{ index $endpoints.serviceEndpoints "cfapi-auth" "port" }}
locationSnippet:
{{- $presets.locationSnippet | toYaml | nindent 10 }}
locationDirectives:
{{- $presets.locationDirectives | toYaml | nindent 10 }}

/api/:
enabled: true
proxy:
Expand Down
3 changes: 3 additions & 0 deletions charts/internal-gateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ libraryMode: true
# List of services endpoints and port
# @default -- See below
codefresh:
cfapi-auth-svc: cfapi-auth
cfapi-auth-port: 80

cfapi-endpoints-svc: cfapi-endpoints
cfapi-endpoints-port: 80

Expand Down

0 comments on commit 9619068

Please sign in to comment.