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

chore: security review #4

Merged
merged 9 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Contributing to our repos

At Primer, we believe that endorsing and maintaining open source software is an important step towards building strong bonds with the wider engineering community. We appreciate and actively invite contribution from outside of our organisation.

## Our Standards

We have expectations of our own behaviour and the behaviour of others when interacting with us in our open source repos.

* Use welcoming and inclusive language at all times
* Be empathetic towards others at all times
* Be respectful of differing viewpoints and experiences
* Gracefully accept constructive criticism
* Focus on what is best for the existing members of the community

There are some behaviours and forms of language that we won't tolerate when communicating with us about our software. Again, this applies to both our organisation members and those community members external to it. These include:

* Sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting and/or derogatory comments, and personal or political attacks
* Public or private harassment of individuals or groups
* Publishing others' private information (a.k.a "doxxing"), such as a physical or electronic
address, without explicit permission from the owner
* Any other conduct that is antithetical to reasonable and polite discourse

## Our Commitments

We appreciate contributions of all forms, but we are not obliged to accept them such that we will make changes to our software or repos to accommodate them.

We will always make best efforts to discuss contributions, but are not obliged to provide timelines, contact details, or other information concerning commitments that we may or may not make to the contribution in question.


## Reporting issues

A bug 🐛 is something nobody ever wants to receive. But, they happen 🤷‍♂️.

Please read the following guidelines before you [report an issue](../issues):

1. **Use the GitHub issue search** — check if the issue has already been
reported. If it has been, please comment on the existing issue. If it is closed,
please reference the closed issue in your new issue report.

2. **Check if the issue has been fixed** — the latest `master`/`main` or
development branch may already contain a fix.

3. **Isolate the problem** — make sure that the code in the
project's repository is responsible for the issue. Create a broken-down list of steps or an
extremely simple and immediately viewable example of the issue.

4. **Include a live example** — provide a link, screenshot, video
or anything that could help us understand better the domain.

Other advice for reporting an issue:

* Please try to be as detailed as possible in your report.
* Please include: what steps will reproduce the issue, which browsers, devices and/or OS
you have recreated the issue with.
* Please state what would you expect the outcome to be.

## Pull requests

Good pull requests — patches, improvements, new features — are a fantastic
help. They should remain focused in scope and avoid containing unrelated
commits.

> [!WARNING]
> If your contribution involves a significant amount of work or substantial
> changes to any part of the project, **please open an issue to discuss it first**.

## Thank you 🙏

👉 from all of the team at Primer ❤️

You are helping us making our product better 👌, faster 🚀, stronger 💪
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- uses: actions/setup-node@v4
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version-file: '.nvmrc'

Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.gitignore
.github/CONTRIBUTING.md
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Primer API Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"lint": "concurrently npm:lint:*",
"lint:commit": "commitlint --from origin/main --to HEAD --verbose",
"lint:es": "eslint . --ignore-path .gitignore --report-unused-disable-directives --max-warnings 0",
"lint:prettier": "prettier . --ignore-path .gitignore --check",
"lint:prettier": "prettier . --check",
"lint:ts": "echo 'Ignored for now...'",
"format": "concurrently npm:format:*",
"format:es": "npm run lint:es --fix",
"format:prettier": "prettier . --ignore-path .gitignore --write"
"format:prettier": "prettier . --write"
},
"engines": {
"node": "16.x"
Expand Down
4 changes: 2 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ app.post('/client-session', async () => {
const res = await post<ClientSession>(
`${primerApiUrl}/client-session`,

// ✨ Feel free to update this 👇
// Check the API reference here: https://apiref.primer.io/reference/create_client_side_token_client_session_post
// 👀 Check the API reference here 👉 https://apiref.primer.io/reference/create_client_side_token_client_session_post
// ✨ Then, try modifying the client session below 👇
{
orderId: randomUUID(),

Expand Down