Skip to content

Commit

Permalink
feat: add readmes
Browse files Browse the repository at this point in the history
Signed-off-by: Roy Scheeren <[email protected]>
  • Loading branch information
royscheeren committed Aug 1, 2024
1 parent 2f6b082 commit 3fe91cf
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
run: npm install --prefix ./packages/docs.siwt.xyz

- run: npx nx format:check
- run: npx nx run-many --target=test --parallel=3 --exclude=smart-contracts,discord,ory-hydra --skip-nx-cache
- run: npx nx run-many --target=test --parallel=3 --exclude=smart-contracts,discord,ory-hydra,oidc-client,oidc-bridge --skip-nx-cache
3 changes: 3 additions & 0 deletions packages/oidc-bridge/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
OIDC_ADMIN_URL=
SESSION_SECRET=
OIDC_PROVIDER_CLIENT_URL=
32 changes: 32 additions & 0 deletions packages/oidc-bridge/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# OIDC Bridge

The OIDC Bridge contains the api endpoints required to complete the sign in process.

## Requirements

Copy `.env.example` into `.env` and update the variables. The `OIDC_ADMIN_URL` is the url to the admin port of the `ory-hydra` package. The `SESSION_SECRET` is a random secret string and the `OIDC_PROVIDER_CLIENT_URL` is the url where the `oidc-client` package is running.

```
- node > 18
- npm
```

Make sure you run

```
npm install
```

in the root of the project

## Run in development mode

To run de demo site locally run

```
npx nx serve oidc-bridge
```

from the root of the project.


2 changes: 2 additions & 0 deletions packages/oidc-client/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_API_URL=http://localhost:3000
SSL_CERTIFICATE_ARN=
38 changes: 38 additions & 0 deletions packages/oidc-client/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# OIDC Client

The OIDC Client is the interface used to request the wallet details from the user.

## Requirements

Copy `.env.example` into `.env` and update the variables. The `VITE_API_URL` is the url of where the `oidc-bridge` has been deployed. For deployment on AWS you'll need a certificate from AWS and have the `SSL_CERTIFICATE_ARN` filled out with its ARN.

```
- node > 18
- npm
```

Make sure you run

```
npm install
```

in the root of the project

## Run in development mode

To run de demo site locally run

```
npx nx serve oidc-client
```

from the root of the project.

## Deployment to AWS

Update the required variables in `stacks/OIDCClient.ts` and run

```
AWS_PROFILE={your profile} npx nx deploy:{staging|production} oidc-client
```
35 changes: 35 additions & 0 deletions packages/ory-hydra/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Ory Hydra

Ory Hydra is the most advanced OAuth 2.0 and OIDC Certified® Server, and the only one that is open source. It integrates with any login system and allows you to interface with any application, anywhere.

[Read more](https://www.ory.sh/hydra/)

## Requirements
- Docker
- Docker Compose

Full functionality relies on having the `oidc-client`, `oidc-server` and `ory-hydra` packages running simultanously.

## Run locally

### Environment
Copy the `.env.example` file into `.env.development`. Update the variables where necessary.

Update `./config/development.yml` where necessary. The `login` and `logout` properties should point to the address of where you're running the `oidc-client` packages.

### Start Ory Hydra provider

```
npx nx run:local:container ory-hydra
```

to create a client run:

```
npx nx run:local:testClient ory-hydra
```

## Deployment

Refer to the production documentation at https://www.ory.sh/docs/hydra/self-hosted/production.

5 changes: 4 additions & 1 deletion packages/siwt.xyz/components/Try/Try.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { AccessControlQuery } from '@siwt/acq/lib/types'
import { NETWORK_IDS, createMessagePayload } from '@siwt/sdk'
import { validateContractAddress } from '@taquito/utils'
import clsx from 'clsx'
import { assoc, concat, ifElse, includes, isEmpty, map, pipe, propEq, reject, split, test, uniq, without } from 'ramda'
import { assoc, concat, ifElse, includes, isEmpty, isNil, map, pipe, propEq, reject, split, test, uniq, without } from 'ramda'
import React, { ChangeEvent, useEffect, useState } from 'react'

import { useBeacon } from '../../common/hooks/useBeacon'
Expand Down Expand Up @@ -79,6 +79,9 @@ export const Try = () => {
}, [])

useEffect(() => {
if (isNil(activeAccount?.address)) {
return
}
setAcq({ ...acq, parameters: { pkh: activeAccount?.address } })
}, [activeAccount, acq])

Expand Down

0 comments on commit 3fe91cf

Please sign in to comment.