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

Provide a way to change the host used for endpoints #1785

Open
shanedell opened this issue Nov 25, 2024 · 0 comments
Open

Provide a way to change the host used for endpoints #1785

shanedell opened this issue Nov 25, 2024 · 0 comments

Comments

@shanedell
Copy link

Issue

When running using Contributing.md, once you get to running the CLI issues come up. This is due to everything running in docker so it is trying to use the keycloak docker service as a host. However, if you don't have access to the opentdf_platform and are running another docker container, the host cannot be accessed.


Possible fix

To get around this error I believe the sdk could be updated to allow the overriding of the host if specified. Meaning for example the CLI can make a new flag --endpoint-host that is passed to the New function for the SDK. Then the host is replaced with that value, or if its the same do nothing.


Steps to reproduce

Standup platform

git clone https://github.com/opentdf/platform.git
cd platform

./.github/scripts/init-temp-keys.sh -o kas-keys

docker-compose up -d --wait

cp opentdf-example.yaml opentdf.yaml

# keycloak data volue was added as the container fails to run without it
docker run --network opentdf_platform \
         -v "$(pwd)/opentdf.yaml:/home/nonroot/.opentdf/opentdf.yaml" \
         -v "$(pwd)/service/cmd/keycloak_data.yaml:/service/cmd/keycloak_data.yaml" \
         -it registry.opentdf.io/platform:nightly provision keycloak -e http://keycloak:8888/auth

docker run --network opentdf_platform \
      -d --name opentdf-platform \
      -p "127.0.0.1:8080:8080" \
      -v "$(pwd)/kas-keys/:/keys/" \
      -v "$(pwd)/opentdf.yaml:/home/nonroot/.opentdf/opentdf.yaml" \
      -it registry.opentdf.io/platform:nightly start

cd ../

Try testing with otdfctl

git clone https://github.com/opentdf/otdfctl.git
cd otdfctl

go run main.go auth client-credentials --host http://localhost:8080 opentdf secret

output received from go command:

Validating client credentials for http://localhost:8080... failed
   ERROR    An error occurred during login. Please check your credentials and try again: Get "http://keycloak:8888/auth/realms/opentdf/.well-known/openid-configuration": dial tcp: lookup keycloak: no such host
exit status 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant