@octokit/auth
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "@octokit/auth", | ||
"description": "GitHub API authentication library for browsers and Node.js", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"license": "MIT", | ||
@@ -25,3 +25,3 @@ "files": [ | ||
"@octokit/auth-action": "^1.0.1", | ||
"@octokit/auth-app": "^1.2.2", | ||
"@octokit/auth-app": "^2.0.0", | ||
"@octokit/auth-basic": "^1.0.1", | ||
@@ -28,0 +28,0 @@ "@octokit/auth-oauth-app": "^2.0.1", |
269
README.md
@@ -14,6 +14,7 @@ # auth.js | ||
- [Example usage](#example-usage) | ||
- [Comparison](#comparison) | ||
- [Token authentication](#token-authentication) | ||
- [Basic and personal access token authentication](#basic-and-personal-access-token-authentication) | ||
- [GitHub App or installation authentication](#github-app-or-installation-authentication) | ||
- [OAuth app and OAuth access token authentication](#oauth-app-and-oauth-access-token-authentication) | ||
- [Token authentication](#token-authentication) | ||
- [GitHub Action authentication](#github-action-authentication) | ||
@@ -93,3 +94,3 @@ - [License](#license) | ||
Additionally, `auth.hook()` can be used to directly hook into [`@octokit/request`](https://github.com/octokit/request.js#readme). | ||
Additionally, `auth.hook()` can be used to directly hook into [`@octokit/request`](https://github.com/octokit/request.js#readme). If multiple authentication types are supported, the right authentication type will be applied automatically based on the request URL. | ||
@@ -106,2 +107,255 @@ ```js | ||
## Comparison | ||
<table> | ||
<thead align=left valign=top> | ||
<tr> | ||
<th>Module</th> | ||
<th>Strategy Options</th> | ||
<th>Auth Options</th> | ||
<th colspan=3>Authentication objects</th> | ||
</tr> | ||
</thead> | ||
<tbody align=left valign=top><tr><td> | ||
`@octokit/auth-token` | ||
</td><td> | ||
``` | ||
token | ||
``` | ||
</td><td> | ||
``` | ||
- | ||
``` | ||
</td><td colspan=3> | ||
``` | ||
{ | ||
type: "token", | ||
token: "secret123", | ||
tokenType, "oauth" // or "installation" | ||
} | ||
``` | ||
</td></tr> | ||
<tr><td> | ||
`@octokit/auth-basic` | ||
</td><td> | ||
``` | ||
{ | ||
username*, | ||
password*, | ||
on2Fa*, | ||
token, | ||
request | ||
} | ||
``` | ||
</td><td> | ||
``` | ||
{ | ||
type*, // "basic" or "token" | ||
refresh | ||
} | ||
``` | ||
</td><td> | ||
``` | ||
{ | ||
type: "basic" | ||
username: "octocat", | ||
password: "secret", | ||
credentials: "b2N0b2NhdDpzZWNyZXQ=", | ||
totp: "123456" | ||
} | ||
``` | ||
</td><td> | ||
``` | ||
{ | ||
type: "token" | ||
tokenType: "pat", | ||
token: "secret123", | ||
id: 123, | ||
username: "octocat", | ||
scopes: [] | ||
} | ||
``` | ||
</td><td> | ||
``` | ||
{ | ||
type: "token" | ||
tokenType: "oauth", | ||
token: "secret123", | ||
id: 123, | ||
appClientId: "abc123", | ||
username: "octocat", | ||
scopes: [] | ||
} | ||
``` | ||
</td></tr> | ||
<tr><td> | ||
`@octokit/auth-app` | ||
</td><td> | ||
``` | ||
{ | ||
id*, | ||
privateKey*, | ||
installationId, | ||
cache, | ||
request | ||
} | ||
``` | ||
</td><td> | ||
``` | ||
{ | ||
type*, // "app" or "installation" | ||
installationId, | ||
repositoryIds, | ||
permissions, | ||
refresh | ||
} | ||
``` | ||
</td><td> | ||
``` | ||
{ | ||
type: "app", | ||
token: "abc.def.1234", | ||
appId: 123, | ||
expriseAt: "2019-06-11T22:22:34Z" | ||
} | ||
``` | ||
</td><td colspan=2> | ||
``` | ||
{ | ||
type: "token", | ||
tokenType: "installation", | ||
token: "v1.secret123", | ||
installationId: 1234, | ||
expriseAt: "2019-06-11T22:22:34Z", | ||
repositoryIds: [12345], | ||
permissions: { | ||
single_file: 'write' | ||
}, | ||
singleFileName: '.github/myapp.yml' | ||
} | ||
``` | ||
</td></tr> | ||
<tr><td> | ||
`@octokit/auth-oauth-app` | ||
</td><td> | ||
``` | ||
{ | ||
clientId*, | ||
clientSecret*, | ||
code, | ||
redirectUrl, | ||
state, | ||
request | ||
} | ||
``` | ||
</td><td> | ||
``` | ||
{ | ||
type*, // "oauth-app" or "token" | ||
url | ||
} | ||
``` | ||
</td><td> | ||
``` | ||
{ | ||
type: "oauth-app", | ||
clientId: "abc123", | ||
clientSecret: "abc123secret", | ||
headers: {}, | ||
query: { | ||
clientId: "abc123", | ||
clientSecret: "abc123secret" | ||
} | ||
} | ||
``` | ||
</td><td colspan=2> | ||
``` | ||
{ | ||
type: "token", | ||
tokenType: "oauth", | ||
token: "123secret", | ||
scopes: [] | ||
} | ||
``` | ||
</td></tr> | ||
<tr><td> | ||
`@octokit/auth-action` | ||
</td><td> | ||
``` | ||
- | ||
``` | ||
</td><td> | ||
``` | ||
- | ||
``` | ||
</td><td colspan=3> | ||
``` | ||
{ | ||
type: "token", | ||
tokenType: "installation", | ||
token: "v1.123secret" | ||
} | ||
``` | ||
</td></tr></tbody> | ||
</table> | ||
## Token authentication | ||
Example | ||
```js | ||
const auth = createTokenAuth("1234567890abcdef1234567890abcdef12345678"); | ||
const { token, tokenType } = await auth(); | ||
``` | ||
See [@octokit/auth-token](https://github.com/octokit/auth-token.js#readme) for more details. | ||
## Basic and personal access token authentication | ||
@@ -168,13 +422,2 @@ | ||
## Token authentication | ||
Example | ||
```js | ||
const auth = createTokenAuth("1234567890abcdef1234567890abcdef12345678"); | ||
const { token, tokenType } = await auth(); | ||
``` | ||
See [@octokit/auth-token](https://github.com/octokit/auth-token.js#readme) for more details. | ||
## GitHub Action authentication | ||
@@ -181,0 +424,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11256
434
+ Added@octokit/auth-app@2.11.0(transitive)
+ Added@types/jsonwebtoken@9.0.7(transitive)
+ Addedjsonwebtoken@9.0.2(transitive)
+ Addedlru-cache@6.0.0(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addeduniversal-github-app-jwt@1.2.0(transitive)
+ Addedyallist@4.0.0(transitive)
- Removed@octokit/auth-app@1.2.2(transitive)
- Removed@types/jsonwebtoken@8.5.9(transitive)
- Removed@types/lolex@3.1.1(transitive)
- Removedjsonwebtoken@8.5.1(transitive)
- Removedlru-cache@5.1.1(transitive)
- Removeduniversal-user-agent@3.0.0(transitive)
- Removedyallist@3.1.1(transitive)
Updated@octokit/auth-app@^2.0.0