-
Notifications
You must be signed in to change notification settings - Fork 8
refactor: publish to JSR #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a7773f5
refactor: publish to JSR
iuioiua a6fe34e
work
iuioiua f0c813f
fixes
iuioiua 927266b
fix
iuioiua 33748ef
work
iuioiua 74d45df
ugly fix
iuioiua 0778bae
update
iuioiua 2c95070
change name
iuioiua 35469ad
fix
iuioiua 63202f8
version 2.0.0
iuioiua 60291e6
update
iuioiua 3a80107
update
iuioiua File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write # The OIDC ID token is used for authentication with JSR. | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: npx jsr publish |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,9 +30,9 @@ Currently supported OAuth 2.0 grants: | |
### GitHub API example using [oak](https://deno.land/x/oak) | ||
|
||
```ts ignore | ||
import { Application, Router } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { Session } from "https://deno.land/x/oak_sessions@v4.0.5/mod.ts"; | ||
import { OAuth2Client } from "https://deno.land/x/oauth2_client/mod.ts"; | ||
import { Application, Router } from "jsr:@oak/oak"; | ||
import { Session } from "https://deno.land/x/oak_sessions@v4.1.12/mod.ts"; | ||
import { OAuth2Client } from "jsr:@cmd-johnson/deno-oauth2-client"; | ||
|
||
const oauth2Client = new OAuth2Client({ | ||
clientId: Deno.env.get("CLIENT_ID")!, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
{ | ||
"name": "@cmd-johnson/oauth2-client", | ||
"version": "2.0.0", | ||
"imports": { | ||
"@oak/oak": "jsr:@oak/oak@^17.1.3", | ||
"@std/assert": "jsr:@std/assert@^1.0.7", | ||
"@std/encoding": "jsr:@std/encoding@^1.0.5", | ||
"@std/http": "jsr:@std/http@^1.0.9", | ||
"@std/testing": "jsr:@std/testing@^1.0.4", | ||
"https://deno.land/x/oauth2_client/": "./" | ||
}, | ||
"tasks": { | ||
"check:types": "deno check **/*.ts", | ||
"test": "deno test --parallel --trace-leaks --doc" | ||
} | ||
}, | ||
"exports": "./mod.ts" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { | ||
Cookie, | ||
type Cookie, | ||
deleteCookie, | ||
getCookies, | ||
setCookie, | ||
} from "https://deno.land/[email protected]/http/cookie.ts"; | ||
import { OAuth2Client } from "https://deno.land/x/oauth2_client/mod.ts"; | ||
} from "@std/http/cookie"; | ||
import { OAuth2Client } from "@cmd-johnson/oauth2-client"; | ||
|
||
const oauth2Client = new OAuth2Client({ | ||
clientId: Deno.env.get("CLIENT_ID")!, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { Application, Router } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { Application, Router } from "@oak/oak"; | ||
import { | ||
MemoryStore, | ||
Session, | ||
} from "https://deno.land/x/oak_sessions@v4.0.5/mod.ts"; | ||
import { OAuth2Client } from "https://deno.land/x/oauth2_client/mod.ts"; | ||
} from "https://deno.land/x/oak_sessions@v9.0.0/mod.ts"; | ||
import { OAuth2Client } from "@cmd-johnson/oauth2-client"; | ||
|
||
const oauth2Client = new OAuth2Client({ | ||
clientId: Deno.env.get("CLIENT_ID")!, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,13 @@ import { | |
assertMatch, | ||
assertNotMatch, | ||
assertRejects, | ||
} from "https://deno.land/[email protected]/assert/mod.ts"; | ||
} from "@std/assert"; | ||
import { | ||
assertSpyCall, | ||
assertSpyCallAsync, | ||
assertSpyCalls, | ||
spy, | ||
} from "https://deno.land/[email protected]/testing/mock.ts"; | ||
} from "@std/testing/mock"; | ||
|
||
import { | ||
AuthorizationResponseError, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ import { | |
assertMatch, | ||
assertNotMatch, | ||
assertRejects, | ||
} from "https://deno.land/[email protected]/assert/mod.ts"; | ||
} from "@std/assert"; | ||
|
||
import { | ||
MissingClientSecretError, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
import { | ||
assertEquals, | ||
assertThrows, | ||
} from "https://deno.land/[email protected]/assert/mod.ts"; | ||
import { assertEquals, assertThrows } from "@std/assert"; | ||
import { | ||
AuthorizationResponseError, | ||
OAuth2ResponseError, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
import { assertEquals } from "https://deno.land/[email protected]/assert/assert_equals.ts"; | ||
|
||
import { OAuth2Client, OAuth2ClientConfig } from "./oauth2_client.ts"; | ||
import { assertEquals } from "@std/assert/equals"; | ||
import { OAuth2Client, type OAuth2ClientConfig } from "./oauth2_client.ts"; | ||
import { OAuth2GrantBase } from "./grant_base.ts"; | ||
import { RequestOptions } from "./types.ts"; | ||
import type { RequestOptions } from "./types.ts"; | ||
|
||
class OAuth2Grant extends OAuth2GrantBase { | ||
public override buildRequest( | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
// deno-lint-ignore-file no-explicit-any | ||
import { | ||
assertEquals, | ||
assertRejects, | ||
} from "https://deno.land/[email protected]/assert/mod.ts"; | ||
import { assertEquals, assertRejects } from "@std/assert"; | ||
import { | ||
assertSpyCall, | ||
assertSpyCallAsync, | ||
assertSpyCalls, | ||
spy, | ||
} from "https://deno.land/[email protected]/testing/mock.ts"; | ||
} from "@std/testing/mock"; | ||
|
||
import { AuthorizationResponseError, OAuth2ResponseError } from "./errors.ts"; | ||
import { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { assert } from "https://deno.land/[email protected]/assert/assert.ts"; | ||
import { assert } from "@std/assert/assert"; | ||
|
||
import { OAuth2Client } from "./oauth2_client.ts"; | ||
import { AuthorizationCodeGrant } from "./authorization_code_grant.ts"; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { encodeBase64 } from "https://deno.land/[email protected]/encoding/base64.ts"; | ||
import { encodeBase64 } from "@std/encoding/base64"; | ||
|
||
export interface PkceChallenge { | ||
codeVerifier: string; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
import { | ||
assertEquals, | ||
assertMatch, | ||
} from "https://deno.land/[email protected]/assert/mod.ts"; | ||
import { | ||
returnsNext, | ||
stub, | ||
} from "https://deno.land/[email protected]/testing/mock.ts"; | ||
import { assertEquals, assertMatch } from "@std/assert"; | ||
import { returnsNext, stub } from "@std/testing/mock"; | ||
|
||
import { _internals as pkceInternals, createPkceChallenge } from "./pkce.ts"; | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { assertEquals } from "https://deno.land/[email protected]/assert/assert_equals.ts"; | ||
import { assertEquals } from "@std/assert/equals"; | ||
import { getOAuth2Client, mockATResponse } from "./test_utils.ts"; | ||
|
||
Deno.test("RefreshTokenGrant.refresh works without optional options", async () => { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ import { | |
assertMatch, | ||
assertNotMatch, | ||
assertRejects, | ||
} from "https://deno.land/[email protected]/assert/mod.ts"; | ||
} from "@std/assert"; | ||
|
||
import { OAuth2ResponseError, TokenResponseError } from "./errors.ts"; | ||
import { getOAuth2Client, mockATResponse } from "./test_utils.ts"; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
// deno-lint-ignore-file camelcase | ||
|
||
import { assertEquals } from "https://deno.land/[email protected]/assert/assert_equals.ts"; | ||
import { | ||
returnsNext, | ||
stub, | ||
} from "https://deno.land/[email protected]/testing/mock.ts"; | ||
import { OAuth2Client, OAuth2ClientConfig } from "./oauth2_client.ts"; | ||
import { Tokens } from "./types.ts"; | ||
import { assertEquals } from "@std/assert/equals"; | ||
import { returnsNext, stub } from "@std/testing/mock"; | ||
import { OAuth2Client, type OAuth2ClientConfig } from "./oauth2_client.ts"; | ||
import type { Tokens } from "./types.ts"; | ||
|
||
export function getOAuth2Client( | ||
overrideConfig: Partial<OAuth2ClientConfig> = {}, | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means
@cmd-johnson/deno-oauth2-client
is the only entry point. Alternatively, we could also include more specific modules. E.g.:@cmd-johnson/deno-oauth2-client/errors
@cmd-johnson/deno-oauth2-client/pkce
@cmd-johnson/deno-oauth2-client/refresh-token-grant