Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL handling for security.config-file on access-control.properties #195

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions charts/trino/templates/configmap-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,27 @@ data:
{{- .Values.server.coordinatorExtraConfig | nindent 4 }}
{{- end }}

{{- if .Values.accessControl }}{{- if eq .Values.accessControl.type "configmap" }}
{{ if .Values.accessControl }}
{{- if and (eq .Values.accessControl.type "remote") (.Values.accessControl.url) }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{- if and (eq .Values.accessControl.type "remote") (.Values.accessControl.url) }}
{{- if eq .Values.accessControl.type "remote" }}
{{- if not .Values.accessControl.url }}
{{- fail "`.accessControl.url` is required when `.accessControl.type` is set to `remote`" }}
{{- end }}

access-control.properties: |
access-control.name=file
{{- if .Values.accessControl.refreshPeriod }}
security.refresh-period={{ .Values.accessControl.refreshPeriod }}
{{- end }}
security.config-file={{ .Values.accessControl.url }}
{{- if .Values.accessControl.jsonPointer }}
security.json-pointer={{ .Values.accessControl.jsonPointer }}
{{- end }}
{{- end }}
{{- if eq .Values.accessControl.type "configmap" }}
access-control.properties: |
access-control.name=file
{{- if .Values.accessControl.refreshPeriod }}
security.refresh-period={{ .Values.accessControl.refreshPeriod }}
{{- end }}
security.config-file={{ .Values.server.config.path }}/access-control/{{ .Values.accessControl.configFile | default "rules.json" }}
{{- end }}{{- end }}
{{- end }}
{{- end }}

{{- if .Values.resourceGroups }}
resource-groups.properties: |
Expand Down
11 changes: 10 additions & 1 deletion charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ accessControl: {}
# accessControl -- [System access
# control](https://trino.io/docs/current/security/built-in-system-access-control.html)
# configuration.
# type can be either 'configmap' when using a local file or 'remote' when using a file from an http/https URL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All docs should be correct sentences, start with a capital letter.

Suggested change
# type can be either 'configmap' when using a local file or 'remote' when using a file from an http/https URL
# Type can be either `configmap` when using a local file, or `remote` when using a file from an URL.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, see the repository README on how to run pre-commit hooks to regenerate the Chart's README.

# @raw
# Example:
# Example with configmap:
# ```yaml
# type: configmap
# refreshPeriod: 60s
Expand Down Expand Up @@ -144,6 +145,14 @@ accessControl: {}
# ]
# }
# ```
# Example with remote:
# ```yaml
# type: "remote"
# refreshPeriod: "60s"
# url: "http://trino-test/config"
# jsonPointer: "/data"
# # Rules file is mounted to /etc/trino/access-control
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# # Rules file is mounted to /etc/trino/access-control

# ```

resourceGroups: {}
# resourceGroups -- Resource groups file is mounted to /etc/trino/resource-groups/resource-groups.json
Expand Down