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

Dev environment: keycloak integration #1439

Merged
merged 2 commits into from
Jan 29, 2024
Merged

Conversation

eguzki
Copy link
Member

@eguzki eguzki commented Jan 22, 2024

What

New development environment to test integration between APIcast and Keycloak

Based on Keycloak 23.0.4

Note: The policy chain includes the token introspection policy, but this is not a requirement for testing keycloak integration.

Verification Steps

  • Build docker image from this git branch
make runtime-image IMAGE_NAME=apicast-test
  • Run keycloak dev environment
cd dev-environments/keycloak-env/
make gateway IMAGE_NAME=apicast-test
  • Keycloak provisioning. Create realm, clients, users
make keycloak-data

Admin web app available at http://127.0.0.1:9090, user: admin, pass: adminpass.

Access to the Keycloak CLI

docker compose -p keycloak-env exec keycloak /bin/bash      

Use the CLI

/opt/keycloak/bin/kcadm.sh --help                           
  • Get JWT
export ACCESS_TOKEN=$(make token)
  • Run request to echo endpoint
curl -v --resolve stg.example.com:8080:127.0.0.1 -H "Authorization: Bearer ${ACCESS_TOKEN}" "http://stg.example.com:8080"

The response should be HTTP/1.1 200 OK

@eguzki eguzki force-pushed the dev-environment-keycloak branch 2 times, most recently from a476e38 to f328829 Compare January 23, 2024 15:29
@eguzki eguzki marked this pull request as ready for review January 26, 2024 15:49
@eguzki eguzki requested a review from a team as a code owner January 26, 2024 15:49
@eguzki eguzki requested a review from tkan145 January 26, 2024 15:49
Copy link
Contributor

@tkan145 tkan145 left a comment

Choose a reason for hiding this comment

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

LGTM

Just nitpicking but maybe we should remove unnecessary fields from the apicast-config.json file?

@eguzki
Copy link
Member Author

eguzki commented Jan 29, 2024

Just nitpicking but maybe we should remove unnecessary fields from the apicast-config.json file?

I copied it from a real 3scale API response body, then updated some fields with specific values for this dev env and cleaned up a bit not relevant sensitive field's values. I wanted to keep structure and fields to make sure integration works.

@tkan145
Copy link
Contributor

tkan145 commented Jan 29, 2024

Not a big issue to me so feel free to merge when you are ready.

@eguzki eguzki merged commit a7453dd into master Jan 29, 2024
13 checks passed
@eguzki eguzki deleted the dev-environment-keycloak branch January 29, 2024 12:46
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

Successfully merging this pull request may close these issues.

2 participants