Skip to content

Commit

Permalink
Access token per environment/workspace (#6)
Browse files Browse the repository at this point in the history
* migration to TS

* save tokens per environment

* environment / workspace tag argument added

* readme udpated

* cached state removed

* lint validation added

* eof fix
  • Loading branch information
NickRimmer authored Jul 16, 2023
1 parent 69f62e0 commit dbb2afc
Show file tree
Hide file tree
Showing 22 changed files with 3,848 additions and 175 deletions.
36 changes: 36 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"never"
]
}
}
1 change: 1 addition & 0 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm run publish-dry
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"sibiraj-s.vscode-scss-formatter",
]
}
21 changes: 21 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"editor.tabSize": 2,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.defaultFormatter": "vscode.typescript-language-features",
"eslint.validate": [
"javascript",
"typescript"
],
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"files.insertFinalNewline": true,
"[scss]": {
"editor.defaultFormatter": "sibiraj-s.vscode-scss-formatter"
},
"files.eol": "\n"
}
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,19 @@ Welcome aboard the 'oAuth 2 Mate' express! 🚀

Your passport to simpler authorization is just a click away. Happy coding! 🎉

## How to use
# Features

This 'OAuth 2 Mate' plugin comes with a handful of handy features that help simplify your Insomnia workflows. Let's dive in.

### Template Tags for Easy Token Insertion
With 'OAuth 2 Mate', it's easy to inject your access tokens straight into your global headers as bearer authorization tokens or use as a request headers, you can even put access token to request body. All you have to do is use the provided template tag `oa2_mate`, and voila — you've got your authorization sorted!

### Environment-Specific Access Tokens
Working within a specific environment and need its related access token? 'OAuth 2 Mate' has got your back. When the 'Use environment-specific access tokens only.' option is checked, the plugin will provide you with the freshest access token specific to your current environment.

<img src="npm/content/feature-environments.jpg" alt="Environment-specific token">

# How to use
This is just one of examples (;

### Step 1
Expand Down
14 changes: 14 additions & 0 deletions esbuild.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { build } from 'esbuild'

build({
bundle: true,
entryPoints: ['./src/index.ts'],
external: [
],
format: 'cjs',
outfile: './dist/index.js',
watch: Boolean(process.env.ESBUILD_WATCH),
platform: 'node',
plugins: [
],
})
44 changes: 0 additions & 44 deletions npm/content/README.md

This file was deleted.

Binary file added npm/content/feature-environments.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit dbb2afc

Please sign in to comment.