Skip to content

Commit

Permalink
fix(build): keycloak for local run (#954)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera committed Jul 11, 2022
1 parent ea56c40 commit 70aeeeb
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 5 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
]
}
],
"jsdoc/no-undefined-types": [1, { "definedTypes": ["html"] }],
"jsdoc/require-param-description": 0,
"jsdoc/require-property-description": 0,
"jsdoc/require-returns-description": 0,
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Contributing encompasses repository specific requirements and the global [Insigh
Before developing you'll need to install:
* [NodeJS and NPM](https://nodejs.org/)
* [Docker](https://docs.docker.com/engine/install/)
* Alternatively, you can try [Podman](https://github.com/containers/podman). [Homebrew](https://brew.sh/) can be used for the install `$ brew install podman`
* And [Yarn](https://yarnpkg.com)

### OS Support
Expand Down Expand Up @@ -342,7 +343,7 @@ If you're having trouble getting an accurate code coverage report, or it's faili
1. Start developing...
### Local Run Development Workflow
1. Confirm you've installed all recommended tooling
1. Confirm you've installed all recommended tooling, and it's running (Docker or alternative)
1. Confirm the repository name has no blank spaces in it. If it does replace that blank with a dash or underscore, Docker has issues with unescaped parameter strings.
1. Confirm you've installed resources through yarn
1. Create a local dotenv file called `.env.local` and add the following contents
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ A web user interface for subscription reporting, based on [Patternfly](https://w
Before developing for Curiosity Frontend, the basic requirements:
* Your system needs to be running [NodeJS version 14+ and NPM](https://nodejs.org/)
* [Docker](https://docs.docker.com/engine/install/)
* Alternatively, you can try [Podman](https://github.com/containers/podman).
* And [Yarn 1.22+](https://yarnpkg.com) for dependency and script management.

For in-depth tooling install guidance see the [contribution guidelines](./CONTRIBUTING.md#Install)
Expand All @@ -29,9 +30,11 @@ For in-depth tooling install guidance see the [contribution guidelines](./CONTRI
### Serving Content
This is the default context for running a local UI against mock styling.
```
$ yarn start
```
1. Start up Docker or equivalent tooling
2. Run
```
$ yarn start
```
For in-depth local run guidance review the [contribution guidelines](./CONTRIBUTING.md#Serving%20Content)
Expand Down
2 changes: 2 additions & 0 deletions config/cspell.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"ibmpower",
"ibmz",
"ipsum",
"keycloak",
"labelledby",
"lorem",
"minheight",
Expand All @@ -48,6 +49,7 @@
"rhel",
"rhosak",
"rhsm",
"samesite",
"select's",
"spandx",
"timeseries",
Expand Down
3 changes: 3 additions & 0 deletions config/spandx.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
*/
const setDevRoutes = () => ({
routes: {
'/auth': {
host: `http://localhost:5000`
},
'/api/rhsm-subscriptions': {
host: `http://localhost:5000`
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
]
},
"scripts": {
"api:dev": "mock -p 5000 -w ./src/services -w ./src/services/rhsm",
"api:dev": "mock -p 5000 -w ./src/services -w ./src/services/rhsm -w ./src/services/platform",
"api:docs": "node ./scripts/openapi.docs.js",
"api:proxy-hosts": "bash ./scripts/proxy.api.sh",
"build": "run-s -l build:pre build:js build:post test:integration",
Expand Down
17 changes: 17 additions & 0 deletions src/services/platform/platformServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ import {
PLATFORM_API_RESPONSE_USER_PERMISSION_TYPES as USER_PERMISSION_TYPES
} from './platformConstants';

/**
* @api {get} /auth/realms/redhat-external/protocol/openid-connect/3p-cookies/step1.html
* @apiDescription Mock keycloak bypass
*
* @apiSuccessExample {html} Success-Response:
* HTTP/1.1 200 OK
* <!DOCTYPE html>
* <html>
* <body>
* <script>
* document.cookie = "KEYCLOAK_3P_COOKIE_SAMESITE=; expires=Thu, 01 Jan 1970 00:00:00 GMT; secure"
* document.cookie = "KEYCLOAK_3P_COOKIE=; expires=Thu, 01 Jan 1970 00:00:00 GMT"
* window.parent.postMessage("supported", "*")
* </script>
* </body>
* </html>
*/
/**
* Basic user authentication.
*
Expand Down

0 comments on commit 70aeeeb

Please sign in to comment.