Skip to content

Commit

Permalink
Merge branch 'main' into issue-5795
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncrypta authored Jul 18, 2022
2 parents f26daad + 2cb1226 commit e77b56b
Show file tree
Hide file tree
Showing 50 changed files with 2,942 additions and 272 deletions.
375 changes: 369 additions & 6 deletions docs/docs/auth/dbauth.md

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions docs/docs/auth/okta.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Okta

The following CLI command will install required packages and generate boilerplate code and files for Redwood Projects:

```bash
yarn rw setup auth okta
```

Update your .env file with the following setting which can be found on your Okta project's dashboard.

- `OKTA_ISSUER` The URL for your Okta organization or an Okta authentication server.
- `OKTA_CLIENT_ID` Client Id pre-registered with Okta for the OIDC authentication flow.
- `OKTA_REDIRECT_URI` The URL that is redirected to when using token.getWithRedirect. This must be listed in your Okta application's Login redirect URIs.
- `OKTA_AUDIENCE` The audience of the Okta jwt token
- `OKTA_DOMAIN` The domain for your Okta authentication server.
1 change: 1 addition & 0 deletions docs/docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ We currently support the following third-party authentication providers:
- Netlify Identity _([Repo on GitHub](https://github.com/netlify/netlify-identity-widget))_
- Netlify GoTrue-JS _([Repo on GitHub](https://github.com/netlify/gotrue-js))_
- Nhost _([Documentation Website](https://docs.nhost.io/platform/authentication))_
- Okta _([Repo on GitHub](https://github.com/okta/okta-auth-js))_
- Supabase _([Documentation Website](https://supabase.io/docs/guides/auth))_
- WalletConnect _([Repo on GitHub](https://github.com/oneclickdapp/ethereum-auth))_

Expand Down
23 changes: 5 additions & 18 deletions docs/docs/contributing-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ _Before interacting with the Redwood community, please read and understand our [
> 1. 🧭 **Overview and Orientation** (👈 you are here)
> 2. 📓 [Reference: Contributing to the Framework Packages](https://github.com/redwoodjs/redwood/blob/main/CONTRIBUTING.md)
> 3. 🪜 [Step-by-step Walkthrough](contributing-walkthrough.md) (including Video Recording)
> 4. 📈 [Current Project Status: v1 Release Board](https://github.com/orgs/redwoodjs/projects/6)
> 4. 📈 [Current Project Status](https://github.com/orgs/redwoodjs/projects/11)
> 5. 🤔 What should I work on?
> - ["Help Wanted" v1 Triage Board](https://redwoodjs.com/good-first-issue)
> - [Good First Issue](https://redwoodjs.com/good-first-issue)
> - [Discovery Process and Open Issues](#what-should-i-work-on)
## The Characteristics of a Contributor
Expand All @@ -46,27 +46,14 @@ Even if you know the mechanics, it’s hard to get started without a starting pl

There are other more direct ways to get started as well, which are outlined below.

### Roadmap to Redwood v1: Project Boards and GitHub Issues
Over the next few months, our focus is to achieve a v1.0.0 release of Redwood. You can read Tom’s important announcement about the v1 release candidate process [via this forum post](https://community.redwoodjs.com/t/what-the-1-0-release-candidate-phase-means-and-when-1-0-will-drop/2604).

> **What a v1 release candidate means:**
>
> 1. all core features are complete and
> 2. we are done making breaking changes
>
> During the release candidate cycle, we are completing all remaining tasks necessary to publish v1.0.0 GA.
The Redwood Core Team is working publicly — progress is updated daily on the [Release Project Board](https://github.com/orgs/redwoodjs/projects/6). There’s also a Triage Board, including an important tab view of Issues that are priorities but need community help.
- 👉 **Start here**: [v1 Help Wanted tab on the Triage Project Board](https://github.com/orgs/redwoodjs/projects/4) (sorted by difficulty)
### Project Boards and GitHub Issues

The Redwood Core Team is working publicly — progress is updated daily on the [Release Project Board](https://github.com/orgs/redwoodjs/projects/11).

Eventually, all this leads you back to Redwood’s GitHub Issues page. Here you’ll find open items that need help, which are organized by labels. There are four labels helpful for contributing:
1. [Good First Issue](https://github.com/redwoodjs/redwood/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22): these items are more likely to be an accessible entry point to the Framework. It’s less about skill level and more about focused scope.
2. [Help Wanted](https://github.com/redwoodjs/redwood/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22): these items especially need contribution help from the community.
3. [v1 Priority](https://github.com/redwoodjs/redwood/issues?q=is%3Aissue+is%3Aopen+label%3Av1%2Fpriority+): to reach Redwood v1.0.0, we need to close all Issues with this label.
4. [Bugs 🐛](https://github.com/redwoodjs/redwood/issues?q=is%3Aissue+is%3Aopen+label%3Abug%2Fconfirmed): Last but not least, we always need help with bugs. Some are technically less challenging than others. Sometimes the best way you can help is to attempt to reproduce the bug and confirm whether or not it’s still an issue.

**The sweet spot is a “v1 Priority” Issue that’s either a “Good First Issue” or “Help Wanted”.** Yes, please!
3. [Bugs 🐛](https://github.com/redwoodjs/redwood/issues?q=is%3Aissue+is%3Aopen+label%3Abug%2Fconfirmed): last but not least, we always need help with bugs. Some are technically less challenging than others. Sometimes the best way you can help is to attempt to reproduce the bug and confirm whether or not it’s still an issue.

### Create a New Issue
Anyone can create a new Issue. If you’re not sure that your feature or idea is something to work on, start the discussion with an Issue. Describe the idea and problem + solution as clearly as possible, including examples or pseudo code if applicable. It’s also very helpful to `@` mention a maintainer or Core Team member that shares the area of interest.
Expand Down
1 change: 1 addition & 0 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ module.exports = {
{ type: 'doc', id: 'auth/magic-link' },
{ type: 'doc', id: 'auth/netlify' },
{ type: 'doc', id: 'auth/nhost' },
{ type: 'doc', id: 'auth/okta' },
{ type: 'doc', id: 'auth/supabase' },
{ type: 'doc', id: 'auth/wallet-connect' },
],
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"resolutions": {
"@types/react": "17.0.47",
"all-contributors-cli@6.20.0": "patch:all-contributors-cli@npm:6.20.0#.yarn/patches/all-contributors-cli-npm-6.20.0-ba332c4a3e.patch",
"microtime": "3.1.0",
"prop-types": "15.8.1",
"react": "17.0.2",
"react-dom": "17.0.2",
Expand Down Expand Up @@ -71,10 +72,10 @@
"babel-plugin-auto-import": "1.1.0",
"babel-plugin-remove-code": "0.0.6",
"boxen": "5.1.2",
"core-js": "3.23.4",
"core-js": "3.23.5",
"cypress": "9.7.0",
"cypress-wait-until": "1.7.2",
"eslint": "8.19.0",
"eslint": "8.20.0",
"fast-glob": "3.2.11",
"fs-extra": "10.1.0",
"is-port-reachable": "3.1.0",
Expand All @@ -89,7 +90,7 @@
"nodemon": "2.0.19",
"npm-packlist": "5.1.1",
"nx": "14.4.3",
"octokit": "2.0.3",
"octokit": "2.0.4",
"ora": "5.4.1",
"prompts": "2.4.2",
"rimraf": "3.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/api-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"ansi-colors": "4.1.3",
"chalk": "4.1.2",
"chokidar": "3.5.3",
"core-js": "3.23.4",
"core-js": "3.23.5",
"fast-json-parse": "1.0.3",
"fastify": "3.29.1",
"fastify-raw-body": "3.2.0",
Expand Down
10 changes: 8 additions & 2 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
"dependencies": {
"@babel/runtime-corejs3": "7.16.7",
"@prisma/client": "3.15.2",
"core-js": "3.23.4",
"cross-undici-fetch": "0.4.11",
"base64url": "3.0.1",
"core-js": "3.23.5",
"cross-undici-fetch": "0.4.13",
"crypto-js": "4.1.1",
"humanize-string": "2.1.0",
"jsonwebtoken": "8.5.1",
Expand All @@ -49,6 +50,7 @@
"@babel/core": "7.16.7",
"@clerk/clerk-sdk-node": "3.8.6",
"@redwoodjs/auth": "2.1.0",
"@simplewebauthn/server": "5.2.1",
"@types/aws-lambda": "8.10.101",
"@types/crypto-js": "4.1.1",
"@types/jsonwebtoken": "8.5.8",
Expand All @@ -64,6 +66,7 @@
"peerDependencies": {
"@clerk/clerk-sdk-node": "3.8.6",
"@magic-sdk/admin": "1.4.1",
"@okta/jwt-verifier": "2.3.0",
"firebase-admin": "10.3.0"
},
"peerDependenciesMeta": {
Expand All @@ -73,6 +76,9 @@
"@magic-sdk/admin": {
"optional": true
},
"@okta/jwt-verifier": {
"optional": true
},
"firebase-admin": {
"optional": true
}
Expand Down
2 changes: 2 additions & 0 deletions packages/api/src/auth/decoders/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { firebase } from './firebase'
import { magicLink } from './magicLink'
import { netlify } from './netlify'
import { nhost } from './nhost'
import { okta } from './okta'
import { supabase } from './supabase'
import { supertokens } from './supertokens'

Expand Down Expand Up @@ -39,6 +40,7 @@ const typesToDecoders: Record<
ethereum: ethereum,
dbAuth: dbAuth,
supertokens: supertokens,
okta: okta,
custom: custom,
}

Expand Down
24 changes: 24 additions & 0 deletions packages/api/src/auth/decoders/okta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export const okta = async (
token: string
): Promise<null | Record<string, unknown>> => {
const { OKTA_DOMAIN, OKTA_AUDIENCE } = process.env

if (!OKTA_AUDIENCE || !OKTA_DOMAIN) {
throw new Error('`OKTA_DOMAIN` or `OKTA_AUDIENCE` env vars are not set.')
}

const OktaJwtVerifier = require('@okta/jwt-verifier')

const client = new OktaJwtVerifier({
issuer: `https://${OKTA_DOMAIN}/oauth2/default`,
})

return new Promise((resolve) => {
client
.verifyAccessToken(token, OKTA_AUDIENCE)
.then((res: any) => {
resolve(res.claims as Record<string, unknown>)
})
.catch((err: any) => console.warn('Token failed validation: ' + err))
})
}
Loading

0 comments on commit e77b56b

Please sign in to comment.