Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
release(v0.10.0): OpenFGA SDK wrapper and deprecate
Browse files Browse the repository at this point in the history
  • Loading branch information
rhamzeh committed Feb 23, 2024
1 parent 8d4473d commit 2ce6f45
Show file tree
Hide file tree
Showing 29 changed files with 1,606 additions and 7,379 deletions.
6 changes: 4 additions & 2 deletions .github/ISSUE_TEMPLATES/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ assignees: ''

**Please do not report security vulnerabilities here**. See the [Responsible Disclosure Program](https://github.com/auth0-lab/fga-js-sdk/blob/main/.github/SECURITY.md).

**Thank you in advance for helping us to improve this library!** Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible. For general support or usage questions, use the [Auth0 Community](https://community.auth0.com/) or [Auth0 Support](https://support.auth0.com/). Finally, to avoid duplicates, please search existing Issues before submitting one here.

By submitting an Issue to this repository, you agree to the terms within the [Auth0 Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md).

### Deprecation Notice

Please note that this SDK is deprecated and is no longer maintained.

### Description

> Provide a clear and concise description of the issue, including what you expected to happen.
Expand Down
30 changes: 0 additions & 30 deletions .github/ISSUE_TEMPLATES/feature_request.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
We are not accepting new Pull Requests for the time being. Please raise an issue or contact us in the [Auth0Lab Discord community](https://discord.gg/8naAwJfWN6) instead.
This repo is deprecated. We are not accepting new Pull Requests for the time being.
18 changes: 18 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
groups:
dependencies:
patterns:
- "*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
dependencies:
patterns:
- "*"
75 changes: 29 additions & 46 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,29 @@
name: Build, Test and Publish

on:
merge_group:
push:
pull_request:
workflow_dispatch:

jobs:
fossa:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
scope: '@auth0'
always-auth: false
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run FOSSA scan and upload build data
uses: fossas/fossa-action@main
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
branch: ${{ github.ref_name }}
- name: Run FOSSA tests
uses: fossas/fossa-action@main
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
run-tests: true

snyk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [14.x, 16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Set up node
uses: actions/setup-node@v3
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
Expand All @@ -69,12 +41,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Set up node
uses: actions/setup-node@v3
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: '18'
node-version: '20'
cache: 'npm'

- name: Install dependencies
Expand All @@ -92,15 +66,20 @@ jobs:
publish:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: [build, test, fossa, snyk]
needs: [build, test]
permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Set up node
uses: actions/setup-node@v3
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: '18'
node-version: '20'
registry-url: 'https://registry.npmjs.org'
scope: '@auth0'
always-auth: false
Expand All @@ -118,11 +97,15 @@ jobs:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: publish
permissions:
contents: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- uses: Roang-zero1/github-create-release-action@5cf058ddffa6fa04e5cda07c98570c757dc4a0e1
- uses: Roang-zero1/github-create-release-action@57eb9bdce7a964e48788b9e78b5ac766cb684803 # v3.0.1
with:
version_regex: ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+
env:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/semgrep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ jobs:
image: returntocorp/semgrep
if: (github.actor != 'dependabot[bot]' && github.actor != 'snyk-bot')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- run: semgrep ci
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
1 change: 0 additions & 1 deletion .openapi-generator-ignore

This file was deleted.

32 changes: 0 additions & 32 deletions .openapi-generator/FILES

This file was deleted.

1 change: 0 additions & 1 deletion .openapi-generator/VERSION

This file was deleted.

7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": false,
"trailingComma": "all",
"tabWidth": 2,
"bracketSpacing": true,
"printWidth": 120
}
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
# Changelog

## v0.10.0

### [0.10.0](https://github.com/auth0-lab/fga-js-sdk/compare/v0.9.1...v0.10.0) (2023-12-23)

This SDK is now

[Breaking]

Changed:
- `Auth0FgaApi` and `Auth0FgaClient` are now just simple wrappers on top of `OpenFgaFgaApi` and `OpenFgaFgaClient`

Chore:
- chore(ci): enable dependabot
- chore(deps): update dependencies

Note: As of this point this SDK is deprecated and should no longer be used. Please use [@openfga/sdk](https://github.com/openfga/js-sdk) instead.

We strongly recommend you use the `@openfga/sdk` directly instead with the following configuration:

For US1 (Production US) environment, use the following values:
- API URL: `https://api.us1.fga.dev`
- Credential Method: ClientCredentials
- API Token Issuer: `fga.us.auth0.com`
- API Audience: `https://api.us1.fga.dev/`

You can get the rest of the necessary variables from the FGA Dashboard. See [here](https://docs.fga.dev/intro/dashboard#create-api-credentials).

```js
const { CredentialsMethod, OpenFgaClient } = require('@openfga/sdk'); // OR import { CredentialsMethod, OpenFgaClient } from '@openfga/sdk';

const fgaClient = new OpenFgaClient({
apiUrl: "https://api.us1.fga.dev",
storeId: process.env.FGA_STORE_ID,
authorizationModelId: process.env.FGA_MODEL_ID,
credentials: {
method: CredentialsMethod.ClientCredentials,
config: {
apiTokenIssuer: "fga.us.auth0.com",
apiAudience: "https://api.us1.fga.dev/",
clientId: process.env.FGA_CLIENT_ID,
clientSecret: process.env.FGA_CLIENT_SECRET,
},
}
});
```

## v0.9.1

### [0.9.1](https://github.com/auth0-lab/fga-js-sdk/compare/v0.9.0...v0.9.1) (2023-01-23)
Expand Down
Loading

0 comments on commit 2ce6f45

Please sign in to comment.