-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(oauth-provider): internalize oauth-provider-client-uri and A…
…TPROTO spec rules
- Loading branch information
1 parent
618fb69
commit 5bd0771
Showing
28 changed files
with
491 additions
and
575 deletions.
There are no files selected for viewing
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
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,17 @@ | ||
import { isAbsolute, relative } from 'node:path' | ||
|
||
export function isSubUrl(reference: URL, url: URL): boolean { | ||
if (url.origin !== reference.origin) return false | ||
if (url.username !== reference.username) return false | ||
if (url.password !== reference.password) return false | ||
|
||
return ( | ||
reference.pathname === url.pathname || | ||
isSubPath(reference.pathname, url.pathname) | ||
) | ||
} | ||
|
||
function isSubPath(reference: string, path: string): boolean { | ||
const rel = relative(reference, path) | ||
return !rel.startsWith('..') && !isAbsolute(rel) | ||
} |
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,8 @@ | ||
export function buildWellknownUrl(url: URL, name: string): URL { | ||
const path = | ||
url.pathname === '/' | ||
? `/.well-known/${name}` | ||
: `${url.pathname.replace(/\/+$/, '')}/${name}` | ||
|
||
return new URL(path, url) | ||
} |
Oops, something went wrong.