{"id":19957099,"url":"https://github.com/guilhermecamposo/demo_3scale","last_synced_at":"2026-02-12T18:02:09.407Z","repository":{"id":96137807,"uuid":"591368982","full_name":"GuilhermeCamposo/demo_3scale","owner":"GuilhermeCamposo","description":"Comprehensive demo about 3scale","archived":false,"fork":false,"pushed_at":"2025-11-20T17:14:12.000Z","size":1196,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-20T19:13:23.514Z","etag":null,"topics":["3scale","ansible","grafana"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GuilhermeCamposo.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-20T15:34:25.000Z","updated_at":"2025-11-19T14:56:51.000Z","dependencies_parsed_at":"2024-07-24T18:05:27.429Z","dependency_job_id":"6a4b0ecd-bc3d-45be-ad13-8842f5d4344f","html_url":"https://github.com/GuilhermeCamposo/demo_3scale","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GuilhermeCamposo/demo_3scale","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuilhermeCamposo%2Fdemo_3scale","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuilhermeCamposo%2Fdemo_3scale/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuilhermeCamposo%2Fdemo_3scale/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuilhermeCamposo%2Fdemo_3scale/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GuilhermeCamposo","download_url":"https://codeload.github.com/GuilhermeCamposo/demo_3scale/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuilhermeCamposo%2Fdemo_3scale/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29375599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3scale","ansible","grafana"],"created_at":"2024-11-13T01:36:34.431Z","updated_at":"2026-02-12T18:02:09.401Z","avatar_url":"https://github.com/GuilhermeCamposo.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Comprehensive 3scale Demo\n\nThis repository demonstrates how to use many of 3scale's features.\n\n== Demo Last Tested with\n\n- OCP 4.17\n- oc CLI 4.17\n- 3scale 2.15\n\n\n== 3scale Installation\n\n=== Parameters\n\n[options=\"header\"]\n|=======================\n| Parameter | Example Value                                      | Definition\n| token     | sha256~vFanQbthlPKfsaldJT3bdLXIyEkd7ypO_XPygY1DNtQ | access token for a user with cluster-admin privileges\n| server    | https://api.mycluster.domain.com:6443              | OpenShift cluster API URL\n|=======================\n\n===  How to run the playbook\n\nTo install all components available:\n\n----\nansible-playbook -e token=${token} -e server=${server} playbook.yml\n----\n\nIf you want to install specific components, you can use Ansible tags, like: \n\n----\nansible-playbook -e token=${token} -e server=${server} --tags \"threescale\" playbook.yml\n----\n\n\n== Manual steps\n\nAfter the installation there are some steps that need to be done using 3scale's console.\n\n=== Enable portal\n\nRemove code on: https://${3scale-admin-portal}/site/dns\n\n=== Update Provider Name\n\nadd a name for the provider here: https://${3scale-admin-portal}/p/admin/account/edit\n\n=== Update Developer Portal Website\n\nIn the `dev-portal` folder you will find an automation to update the Developer Portal in a specific environment. Run the playbook in the same way you run the installation playbook.\n\n=== Enabling Self-Service\n\nIt's possible to set how user can create applications through the portal. This configuration is done in the `Product` configuration in the Admin Portal.\nTo allow users to select how to create applications we have to: \n\n* Be sure the user is subscribed in the *Default* Service of that *Product*. You can either set the service for each user manually or let the *Default* service enable for every new sign-up. If the service is not enabled, the user won't be able to select the product. You have  to set it for every product.\n\nimage::docs/imgs/service-selection.png[service-selection]\n\n* Enable users to manage applications for the *Product*.\n\nimage::docs/imgs/enable-manage-application.png[enable-manage-application]\n\n==== Modifications\n\n* Multiple plans\n\nimage::docs/imgs/pick-plans.PNG[Multiple plans selection]\n\n* Search docs\n\nimage::docs/imgs/search-doc.PNG[Search DOC]\n\n* Select API\n\nimage::docs/imgs/select-api.PNG[Select API]\n\n== Using the 3scale CLI\n\n=== Connect to tenants\n\nexport `UAT_TOKEN`, `PROD_TOKEN` and `DOMAIN` as environment variables, then run the following command.\n\n----\n3scale remote add -k uat https://${UAT_TOKEN}@uat-admin.apps.${DOMAIN}\n3scale remote add -k prod https://${PROD_TOKEN}@prod-admin.apps.${DOMAIN}\n----\n\n=== Copy Database API Backend and Product\n\n----\n3scale backend copy -k -s prod -d uat database-backend\n3scale product copy -k -s prod -d uat database-api\n----\n\n=== Copy Database API Application Plan\n\n----\n3scale application-plan export prod database-api basic -k \u003e basic-plan.yml\n3scale application-plan import uat -f basic-plan.yml database-api -k\n----\n\n=== Create an Application for the new Environment\n\nFind an account:\n\n----\n3scale account find uat admin+test@example.com -a -k\n----\n\nCreate the application with the account information:\n\n----\n3scale application create -k uat ${ACCOUNT_ID} ${SERVICE_ID} basic 'Test App' --application-id=${APP_ID} --application-key=${USER_KEY} --redirect-url=' ' --description='some description'\n----\n\n== How to present this demo?\n\nthis demo has many different features that can me demonstrated for different purpouse. I will document here some things you may need to know.\n\n=== How to log in 3scale's console and SSO?\n\nboth are using self-generated credentials. \n\n. Look for the `system-seed` secret for the 3scale's credentials in the `demo-3scale` project\n. Look for the `credential-example-keycloak` for SSO's credentials in the `demo-rhsso` project\n\n=== How to use the Postman collection?\n\nthe Postman collection has 3 requests:\n\n. Request SSO token\n. GET Database API\n. POST Database API\n\nbefore starting using it, update the `cluster_domain` variable to reflect your OpenShift environment.\n\nTo be able to get an valid token from SSO, you need to update the *Request SSO Token* headers with the credentials generated for the application.\nGo to SSO console and retrieve the `client_id` and `client_secret` from the latest created client.\n\n=== How to present SMTP configuration?\n\nSMTP configuration is required for 3scale's notification system to be able to send emails.\nFor this demo we can mock one using https://github.com/mailhog/MailHog[Mailhog]. To access it just hit the URL:\n\n----\nURL=$(oc get route mailhog -n demo-tools -o jsonpath='{.spec.host}')\necho https://$URL\n----\n\n=== How to present 3scale and Registry integration with Tekton?\n\nThis demo comes with a pipeline that downloads an Open API spec from Registry, publish it in 3scale and creates a ConfigMap for an application to consume.\nYou can find it in the `demo-cicd` project.\nTo demonstrate that feature you need an application like the one https://github.com/GuilhermeCamposo/demo_camel_k/tree/main[here].\nYou will need to configure that API on 3scale.\n\n\n== Demo notes:\n\n. 3scale ERD\n+\nimage::docs/imgs/3scale-entities-relations.png[]\n\n. component architecture:\n+\nimage::docs/imgs/oidc_apis.png[]\n\n. env variables\n+\n-----\n $ export OIDC_PROVIDER_HOSTNAME=\u003chostname of RHBK\u003e\n $ export OIDC_TOKEN_URL=https://$OIDC_PROVIDER_HOSTNAME/auth/realms/threescale-apps/protocol/openid-connect/token\n $ export API_SSO_CLIENT_ID=\u003c3scale app id\u003e\n $ export API_SSO_CLIENT_CRED=\u003c3scale app secret\u003e\n $ export API_GW_HOSTNAME=\u003chostname of 3scale APIcast gw\u003e\n $ export API_GW_URL=https://$API_GW_HOSTNAME/backend\n-----\n\n. Retrieve tokens and parse for _access_token_ :\n+\n-----\n$ TKN=$(curl -X POST \"$OIDC_TOKEN_URL\" \\\n            -H \"Content-Type: application/x-www-form-urlencoded\" \\\n            -d \"grant_type=client_credentials\" \\\n            -d \"client_id=$API_SSO_CLIENT_ID\" \\\n            -d \"client_secret=$API_SSO_CLIENT_CRED\" \\\n            -d \"scope=openid\" \\\n            | sed 's/.*access_token\":\"//g' | sed 's/\".*//g')\n-----\n\n. Inspect token:\n+\n-----\n$ jq -R 'split(\".\") | .[] | @base64d | fromjson' \u003c\u003c\u003c $TKN | jq .\n-----\n\n. Populate _backend_ service with an _Attendee_ resource (in json representation):\n+\n-----\n$ curl -v \\\n    -H \"Authorization: Bearer $TKN\" \\\n    -H \"Content-Type: application/json\" \\\n    -X POST $API_GW_URL \\\n    -d '{\"name\": \"test\", \"email\": \"test@gmail.com\" }'\n-----\n\n. Retrieve list of _Attendee_ resources:\n+\n-----\n$ curl -v \\\n    -H \"Authorization: Bearer $TKN\" \\\n    -X GET $API_GW_URL\n-----","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguilhermecamposo%2Fdemo_3scale","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguilhermecamposo%2Fdemo_3scale","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguilhermecamposo%2Fdemo_3scale/lists"}