Repository navigation
Feat/security order clean - #238
SimonIsCoding wants to merge 2 commits into
Conversation
d-r-e
left a comment
There was a problem hiding this comment.
Thanks for working on improving the onboarding documentation!
However, changes are needed before this PR can be merged. There are several significant issues, including a hardcoded personal client ID, broken development configurations, fabricated project IDs, and a mismatch between the PR description and the actual files changed:
Key Issues:
-
Hardcoded OAuth Client ID in Version Control (
environment.ts&environment.development.ts):
A personal 42 API Client ID (u-s4t2ud-7282b484449a021720b0c6dbd86b212e0d9cd7980348786659e3ebf8f81cf718) was committed into the Angular environment files. Credentials should never be committed into the repository; placeholders (<CLIENT_UUID>) or environment variables should be used. -
PR Scope Mismatch & Unintended Code Changes:
The PR description states:"This PR only updates documentation to make local setup easier for new contributors."
However, the PR includes commit
ab311b0which touches 9 files across Angular, Nginx, Docker Compose, and JSON assets. It looks like changes from an experimental/local testing branch were bundled in. -
Fabricated Project IDs in
7-sec.json:
Artificial IDs (39001, 39002, 39003, 39004, 39005) were introduced for projects likecybersecurity,tinky-winkey,dr-quine,war, anddeath. In RNCP Planner, project IDs must correspond to actual 42 Intra project IDs so thatprojects_usersfrom the 42 API can be matched. For example,tinky-winkeyis ID 2097. Fabricating IDs breaks validation tracking for users. In addition, valid projects were removed, creating merge conflicts with recent updates onmain. -
Broken Local Dev Proxy in
nginx.conf:
Replacingproxy_pass http://angular:4200;withroot /usr/share/nginx/html;breaks the Angular live-reload development setup via Docker Compose. -
Arbitrary Callback Route in
app.routes.ts:
Addingauth/callback/:campusIdwas added to support a callback URL ending in/42. "42" is the name of the school/service, not a campus ID. The standard callback route is/auth/callback. -
Indentation / Formatting Churn in
path.component.ts:
Re-indenting the entire file generated a large diff that creates merge conflicts with recent changes merged intomain(e.g. #251). -
Markdown Formatting in
README.md:
<!-- <details> -->is commented out while<summary>is left active, which breaks the HTML accordion rendering.
Recommendation:
If your goal was solely to improve the setup documentation as described in the PR description, the cleanest approach would be:
- Rebase or start a fresh branch from current
main. - Apply only the documentation improvements to
README.md(fixing the<details>tags and using the standard/auth/callbackpath). - Force-push to this branch.
If you intended to include the other fixes, they should be split into focused PRs after addressing the issues mentioned above.
| production: false, | ||
| auth_url: | ||
| 'https://api.intra.42.fr/oauth/authorize?client_id=<CLIENT_UUID>&redirect_uri=<REDIRECT_URI>&response_type=code', | ||
| `https://api.intra.42.fr/oauth/authorize?client_id=u-s4t2ud-7282b484449a021720b0c6dbd86b212e0d9cd7980348786659e3ebf8f81cf718&redirect_uri=${redirectUri}&response_type=code`, |
There was a problem hiding this comment.
Please do not commit personal 42 OAuth client IDs to the repository. The environment files should keep placeholder values (e.g. <CLIENT_UUID>) so users configure their own credentials.
| export const environment = { | ||
| production: true, | ||
| auth_url: | ||
| `https://api.intra.42.fr/oauth/authorize?client_id=u-s4t2ud-7282b484449a021720b0c6dbd86b212e0d9cd7980348786659e3ebf8f81cf718&redirect_uri=${redirectUri}&response_type=code`, |
There was a problem hiding this comment.
A personal OAuth client ID should not be hardcoded in the production environment file either.
| { | ||
| "id": 1430, | ||
| "name": "famine", | ||
| "id": 39001, |
There was a problem hiding this comment.
These IDs (39001–39005) appear to be fabricated rather than real 42 Intra project IDs. RNCP Planner relies on actual 42 project IDs to match user validated projects from /v2/me. Using placeholder IDs breaks project tracking. Also, removing valid projects here creates conflicts with recent PRs merged into main.
| proxy_set_header Upgrade $http_upgrade; | ||
| proxy_set_header Connection "upgrade"; | ||
|
|
||
| root /usr/share/nginx/html; |
There was a problem hiding this comment.
Replacing proxy_pass http://angular:4200; with static file serving (root /usr/share/nginx/html;) breaks the local development workflow where Angular runs with live-reload on port 4200. Production static serving is handled in the commented block below and in nginx.Dockerfile.
| dockerfile: nginx.Dockerfile | ||
| ports: | ||
| - "80:80" | ||
| - "3000:80" |
There was a problem hiding this comment.
Changing port mapping from 80:80 to 3000:80 alters the documented port conventions. If port 3000 is desired for local setups, it should be coordinated with the reverse proxy configuration and documentation.
| component: LoginComponent, | ||
| }, | ||
| { | ||
| path: 'auth/callback/:campusId', |
There was a problem hiding this comment.
Adding :campusId here appears to be a workaround for setting the redirect URI to /auth/callback/42. 42 refers to the school/provider, not a campus ID parameter. The standard callback route is /auth/callback.
| 2. Replace the redirect url in the environment.ts | ||
| 3. Execute: | ||
| <!-- <details> --> | ||
| <summary>Click to expand local setup instructions</summary> |
There was a problem hiding this comment.
The opening <details> tag is commented out on line 9, leaving <summary> orphaned and breaking the expandable accordion rendering in Markdown. Either uncomment <details> and </details> (line 66), or remove <summary>.
| 2. Create a new application and use the following callback URL: | ||
|
|
||
| ```text | ||
| http://localhost:3000/auth/callback/42 |
There was a problem hiding this comment.
The callback URL should point to /auth/callback rather than /auth/callback/42 to match the standard application route.
I struggled to make it work on my local machine. I was discovering how 42 API was working. So I wrote an explicit readme.
Summary
This PR only updates documentation to make local setup easier for new contributors.
What changed
http://localhost:3000/auth/callback/42flask/.envwith the project variablesdocs/running.md.Why
New contributors (especially first-time open-source contributors) had difficulty understanding how to run the project locally.
This change makes onboarding faster and reduces setup confusion.