Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@octokit/auth

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/auth - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

package.json
{
"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",

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc