-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Pawel Psztyc <[email protected]>
- Loading branch information
Showing
14 changed files
with
12,556 additions
and
1,971 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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,7 @@ | ||
{ | ||
"name": "@advanced-rest-client/oauth", | ||
"description": "The OAuth library for the Advanced REST Client", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"license": "Apache-2.0", | ||
"main": "index.js", | ||
"module": "index.js", | ||
|
@@ -20,18 +20,13 @@ | |
"url": "https://github.com/advanced-rest-client/oauth/issues", | ||
"email": "[email protected]" | ||
}, | ||
"dependencies": { | ||
"@advanced-rest-client/events": "^0.2.28" | ||
}, | ||
"peerDependencies": { | ||
"jsrsasign": "^10.4.0" | ||
}, | ||
"devDependencies": { | ||
"lit-element": "^2.5.1", | ||
"lit-html": "^1.4.1", | ||
"@advanced-rest-client/arc-mock": "^5.0.0", | ||
"@commitlint/cli": "^13.2.1", | ||
"@commitlint/config-conventional": "^13.2.0", | ||
"lit": "^2.2.6", | ||
"@commitlint/cli": "^17.0.2", | ||
"@commitlint/config-conventional": "^17.0.2", | ||
"@open-wc/eslint-config": "^7.0.0", | ||
"@open-wc/testing": "^3.0.2", | ||
"@web/dev-server": "^0.1.25", | ||
|
@@ -40,12 +35,12 @@ | |
"eslint": "^8.0.1", | ||
"eslint-config-prettier": "^8.3.0", | ||
"get-port": "^6.0.0", | ||
"husky": "^7.0.2", | ||
"husky": "^8.0.1", | ||
"jsrsasign": "^10.4.1", | ||
"koa-proxies": "^0.12.1", | ||
"lint-staged": "^11.2.6", | ||
"oauth2-mock-server": "^3.2.0", | ||
"sinon": "^11.1.2", | ||
"lint-staged": "^13.0.2", | ||
"oauth2-mock-server": "^4.3.1", | ||
"sinon": "^14.0.0", | ||
"typescript": "^4.4.4", | ||
"typescript-lit-html-plugin": "^0.9.0" | ||
}, | ||
|
This file contains 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 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 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 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 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 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,59 @@ | ||
import { OAuth2Authorization } from "./types"; | ||
|
||
/** | ||
* Checks if the URL has valid scheme for OAuth flow. | ||
* | ||
* Do not use this to validate redirect URIs as they can use any protocol. | ||
* | ||
* @param url The url value to test | ||
* @throws {TypeError} When passed value is not set, empty, or not a string | ||
* @throws {Error} When passed value is not a valid URL for OAuth 2 flow | ||
*/ | ||
export function checkUrl(url: string): void; | ||
|
||
/** | ||
* Checks if basic configuration of the OAuth 2 request is valid an can proceed | ||
* with authentication. | ||
* @param settings authorization settings | ||
* @throws {Error} When settings are not valid | ||
*/ | ||
export function sanityCheck(settings: OAuth2Authorization): void; | ||
|
||
/** | ||
* Generates a random string of characters. | ||
* | ||
* @returns A random string. | ||
*/ | ||
export function randomString(): string; | ||
|
||
/** | ||
* Replaces `-` or `_` with camel case. | ||
* @param name The string to process | ||
* @return Camel cased string or `undefined` if not transformed. | ||
*/ | ||
export function camel(name: string): string | undefined; | ||
|
||
/** | ||
* Computes the SHA256 hash ogf the given input. | ||
* @param value The value to encode. | ||
*/ | ||
export function sha256(value: string): Promise<ArrayBuffer>; | ||
|
||
/** | ||
* Encoded the array buffer to a base64 string value. | ||
*/ | ||
export function base64Buffer(buffer: ArrayBuffer): string; | ||
|
||
/** | ||
* Generates code challenge for the PKCE extension to the OAuth2 specification. | ||
* @param verifier The generated code verifier. | ||
* @returns The code challenge string | ||
*/ | ||
export function generateCodeChallenge(verifier: string): Promise<string>; | ||
|
||
/** | ||
* Generates cryptographically significant random string. | ||
* @param size The size of the generated nonce. Default to 20. | ||
* @returns A nonce (number used once). | ||
*/ | ||
export function nonceGenerator(size?: number): string; |
This file contains 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 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
Oops, something went wrong.