Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Louketo Proxy --tags CLI flag not ingested #589

Open
abstractj opened this issue Apr 28, 2020 · 0 comments
Open

Louketo Proxy --tags CLI flag not ingested #589

abstractj opened this issue Apr 28, 2020 · 0 comments
Labels

Comments

@abstractj
Copy link

abstractj commented Apr 28, 2020

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.

Reference:

@abstractj abstractj changed the title Keycloak Gatekeeper --tags CLI flag not ingested Louketo Proxy --tags CLI flag not ingested Jun 4, 2020
@abstractj abstractj removed the triage label Jun 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant