This repository was archived by the owner on Dec 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 355
This repository was archived by the owner on Dec 7, 2020. It is now read-only.
Louketo Proxy --tags CLI flag not ingested #589
Copy link
Copy link
Open
Labels
Description
What:
What is the problem?
- The tag feature of Keycloak Gatekeeper [outlined here|https://www.keycloak.org/docs/latest/securing_apps/#custom-pages], is not ingested by the CLI parameter "--tags".
What is the result?
- When presenting a custom 403 html page, the tags are not able to be set via CLI parameters referencing environment variables and are only available to be referenced from a config.yaml file from the "tags" property.
What is the error output?
- When attempting to use the "--tag" flag, receive the following error message due to referencing a misnamed command line flag "[error] invalid options, flag provided but not defined: -tag"
- Generated from [https://github.com/keycloak/keycloak-gatekeeper/blob/1b7ee69ed9ef1b471be86a18b37db82bc950a4f6/cli.go#L45|https://github.com/keycloak/keycloak-gatekeeper/blob/1b7ee69ed9ef1b471be86a18b37db82bc950a4f6/cli.go#L45]
Code references, diagnosis:
- The doc.go file [https://github.com/keycloak/keycloak-gatekeeper/blob/9c5c77dad799f5c4cf78e0a0650f327819e9190c/doc.go#L355|https://github.com/keycloak/keycloak-gatekeeper/blob/9c5c77dad799f5c4cf78e0a0650f327819e9190c/doc.go#L355] on line 355 references the Config "Tags" property definition as "yaml:"tags"".
- The cli.go file builds the command line options based on the property definition [https://github.com/keycloak/keycloak-gatekeeper/blob/1b7ee69ed9ef1b471be86a18b37db82bc950a4f6/cli.go#L107|https://github.com/keycloak/keycloak-gatekeeper/blob/1b7ee69ed9ef1b471be86a18b37db82bc950a4f6/cli.go#L107]
- The cli.go file when ingesting key value pair flags, references "tag" instead of "tags" when parsing and merging the command line flags with the config file definitions [https://github.com/keycloak/keycloak-gatekeeper/blob/1b7ee69ed9ef1b471be86a18b37db82bc950a4f6/cli.go#L193|https://github.com/keycloak/keycloak-gatekeeper/blob/1b7ee69ed9ef1b471be86a18b37db82bc950a4f6/cli.go#L193]
Potential fix:
- Provided the above diagnosis is correct, updating "tag" to "tags", linked above, in the cli.go file will result in the ability to utilize tags from the CLI flags.