@hamur/auth 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +14 -2
- package/dist/chunks/bun-index-0grce57w.js +47 -0
- package/dist/chunks/bun-index-nn9z2k40.js +92 -0
- package/dist/chunks/bun-index-pmpez2a8.js +10 -0
- package/dist/chunks/bun-index-r6757s88.js +206 -0
- package/dist/src/adapters/angular.js +63 -0
- package/dist/src/adapters/html.js +29 -0
- package/dist/src/adapters/preact.js +37 -0
- package/dist/src/adapters/react.js +32 -0
- package/dist/src/adapters/solid.js +45 -0
- package/dist/src/adapters/svelte.js +44 -0
- package/dist/src/adapters/vue.js +55 -0
- package/dist/src/index.js +688 -0
- package/dist/src/middleware.js +45 -0
- package/dist/src/route-middleware.js +42 -0
- package/dist/src/server/index.js +2971 -0
- package/dist/types/src/adapters/angular.d.ts +32 -0
- package/dist/types/src/adapters/html.d.ts +15 -0
- package/dist/types/src/adapters/preact.d.ts +19 -0
- package/dist/types/src/adapters/react.d.ts +19 -0
- package/dist/types/src/adapters/solid.d.ts +25 -0
- package/dist/types/src/adapters/svelte-session.d.ts +8 -0
- package/dist/types/src/adapters/svelte-webauthn.d.ts +8 -0
- package/dist/types/src/adapters/svelte.d.ts +5 -0
- package/dist/types/src/adapters/vue.d.ts +25 -0
- package/dist/types/src/build/access-tokens.d.ts +4 -0
- package/dist/types/src/build/client.d.ts +4 -0
- package/dist/types/src/build/dev-key.d.ts +6 -0
- package/dist/types/src/build/email.d.ts +4 -0
- package/dist/types/src/build/guards.d.ts +4 -0
- package/dist/types/src/build/module-entry.d.ts +3 -0
- package/dist/types/src/build/oauth.d.ts +8 -0
- package/dist/types/src/build/session.d.ts +6 -0
- package/dist/types/src/build/single-use.d.ts +15 -0
- package/dist/types/src/build/webauthn.d.ts +7 -0
- package/dist/types/src/client/webauthn.d.ts +37 -0
- package/dist/types/src/index.d.ts +43 -0
- package/dist/types/src/middleware.d.ts +4 -0
- package/dist/types/src/module.d.ts +3 -0
- package/dist/types/src/options.d.ts +4 -0
- package/dist/types/src/route-middleware.d.ts +2 -0
- package/dist/types/src/runtime/middleware/auth.d.ts +3 -0
- package/dist/types/src/runtime/middleware/guest.d.ts +3 -0
- package/dist/types/src/runtime/payload.d.ts +2 -0
- package/dist/types/src/runtime/plugin.d.ts +2 -0
- package/dist/types/src/runtime/store.d.ts +28 -0
- package/dist/types/src/runtime/targets.d.ts +4 -0
- package/dist/types/src/server/access-token.d.ts +27 -0
- package/dist/types/src/server/auth-link.d.ts +15 -0
- package/dist/types/src/server/door.d.ts +4 -0
- package/dist/types/src/server/endpoint.d.ts +8 -0
- package/dist/types/src/server/guard.d.ts +12 -0
- package/dist/types/src/server/hooks.d.ts +5 -0
- package/dist/types/src/server/index.d.ts +88 -0
- package/dist/types/src/server/oauth/atproto-dns.d.ts +1 -0
- package/dist/types/src/server/oauth/atproto-fetch.d.ts +13 -0
- package/dist/types/src/server/oauth/atproto-metadata.d.ts +1 -0
- package/dist/types/src/server/oauth/atproto.d.ts +36 -0
- package/dist/types/src/server/oauth/cookie.d.ts +17 -0
- package/dist/types/src/server/oauth/dpop.d.ts +4 -0
- package/dist/types/src/server/oauth/handler.d.ts +101 -0
- package/dist/types/src/server/oauth/oidc.d.ts +20 -0
- package/dist/types/src/server/oauth/providers/apple.d.ts +26 -0
- package/dist/types/src/server/oauth/providers/atlassian.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/auth0.d.ts +9 -0
- package/dist/types/src/server/oauth/providers/authentik.d.ts +9 -0
- package/dist/types/src/server/oauth/providers/azureb2c.d.ts +11 -0
- package/dist/types/src/server/oauth/providers/battledotnet.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/box.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/catalog.d.ts +12 -0
- package/dist/types/src/server/oauth/providers/cloudflare.d.ts +11 -0
- package/dist/types/src/server/oauth/providers/cognito.d.ts +9 -0
- package/dist/types/src/server/oauth/providers/discord.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/dropbox.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/facebook.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/gitea.d.ts +9 -0
- package/dist/types/src/server/oauth/providers/github.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/gitlab.d.ts +9 -0
- package/dist/types/src/server/oauth/providers/google.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/heroku.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/hubspot.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/instagram.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/keycloak.d.ts +11 -0
- package/dist/types/src/server/oauth/providers/kick.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/line.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/linear.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/linkedin.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/livechat.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/mastodon.d.ts +9 -0
- package/dist/types/src/server/oauth/providers/microsoft.d.ts +9 -0
- package/dist/types/src/server/oauth/providers/okta.d.ts +9 -0
- package/dist/types/src/server/oauth/providers/ory.d.ts +9 -0
- package/dist/types/src/server/oauth/providers/osu.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/paypal.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/polar.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/preset.d.ts +74 -0
- package/dist/types/src/server/oauth/providers/riotgames.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/roblox.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/salesforce.d.ts +9 -0
- package/dist/types/src/server/oauth/providers/seznam.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/shopifyCustomer.d.ts +9 -0
- package/dist/types/src/server/oauth/providers/slack.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/spotify.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/steam.d.ts +23 -0
- package/dist/types/src/server/oauth/providers/strava.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/tiktok.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/twitch.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/vk.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/wechat.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/workos.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/x.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/xsuaa.d.ts +9 -0
- package/dist/types/src/server/oauth/providers/yandex.d.ts +5 -0
- package/dist/types/src/server/oauth/providers/zendesk.d.ts +9 -0
- package/dist/types/src/server/oauth/providers/zitadel.d.ts +9 -0
- package/dist/types/src/server/personal.d.ts +5 -0
- package/dist/types/src/server/session.d.ts +20 -0
- package/dist/types/src/server/token-requests.d.ts +5 -0
- package/dist/types/src/server/token.d.ts +17 -0
- package/dist/types/src/server/totp.d.ts +28 -0
- package/dist/types/src/server/webauthn/cbor.d.ts +16 -0
- package/dist/types/src/server/webauthn/cose.d.ts +17 -0
- package/dist/types/src/server/webauthn/data.d.ts +20 -0
- package/dist/types/src/server/webauthn/handler.d.ts +63 -0
- package/dist/types/src/single-use.d.ts +17 -0
- package/dist/types/src/types.d.ts +88 -0
- package/package.json +122 -4
- package/src/adapters/AuthState.svelte +14 -0
- package/src/adapters/angular.ts +80 -0
- package/src/adapters/html.ts +39 -0
- package/src/adapters/preact.ts +53 -0
- package/src/adapters/react.ts +49 -0
- package/src/adapters/solid.ts +64 -0
- package/src/adapters/svelte-session.ts +21 -0
- package/src/adapters/svelte-webauthn.ts +20 -0
- package/src/adapters/svelte.ts +5 -0
- package/src/adapters/vue.ts +70 -0
- package/src/build/access-tokens.ts +44 -0
- package/src/build/client.ts +16 -0
- package/src/build/dev-key.ts +29 -0
- package/src/build/email.ts +32 -0
- package/src/build/guards.ts +12 -0
- package/src/build/module-entry.ts +8 -0
- package/src/build/oauth.ts +54 -0
- package/src/build/session.ts +54 -0
- package/src/build/single-use.ts +104 -0
- package/src/build/webauthn.ts +28 -0
- package/src/client/webauthn.ts +129 -0
- package/src/env.d.ts +84 -0
- package/src/index.ts +44 -0
- package/src/middleware.ts +9 -0
- package/src/module.ts +26 -0
- package/src/options.ts +241 -0
- package/src/route-middleware.ts +2 -0
- package/src/runtime/middleware/auth.ts +16 -0
- package/src/runtime/middleware/guest.ts +17 -0
- package/src/runtime/payload.ts +40 -0
- package/src/runtime/plugin.ts +12 -0
- package/src/runtime/store.ts +72 -0
- package/src/runtime/targets.ts +9 -0
- package/src/server/access-token.ts +130 -0
- package/src/server/auth-link.ts +95 -0
- package/src/server/door.ts +33 -0
- package/src/server/endpoint.ts +33 -0
- package/src/server/guard.ts +41 -0
- package/src/server/hooks.ts +13 -0
- package/src/server/index.ts +96 -0
- package/src/server/oauth/atproto-dns.ts +3 -0
- package/src/server/oauth/atproto-fetch.ts +67 -0
- package/src/server/oauth/atproto-metadata.ts +20 -0
- package/src/server/oauth/atproto.ts +292 -0
- package/src/server/oauth/cookie.ts +38 -0
- package/src/server/oauth/dpop.ts +32 -0
- package/src/server/oauth/handler.ts +377 -0
- package/src/server/oauth/oidc.ts +283 -0
- package/src/server/oauth/providers/apple.ts +108 -0
- package/src/server/oauth/providers/atlassian.ts +20 -0
- package/src/server/oauth/providers/auth0.ts +29 -0
- package/src/server/oauth/providers/authentik.ts +29 -0
- package/src/server/oauth/providers/azureb2c.ts +41 -0
- package/src/server/oauth/providers/battledotnet.ts +21 -0
- package/src/server/oauth/providers/box.ts +19 -0
- package/src/server/oauth/providers/catalog.ts +73 -0
- package/src/server/oauth/providers/cloudflare.ts +34 -0
- package/src/server/oauth/providers/cognito.ts +29 -0
- package/src/server/oauth/providers/discord.ts +19 -0
- package/src/server/oauth/providers/dropbox.ts +26 -0
- package/src/server/oauth/providers/facebook.ts +19 -0
- package/src/server/oauth/providers/gitea.ts +29 -0
- package/src/server/oauth/providers/github.ts +33 -0
- package/src/server/oauth/providers/gitlab.ts +29 -0
- package/src/server/oauth/providers/google.ts +19 -0
- package/src/server/oauth/providers/heroku.ts +28 -0
- package/src/server/oauth/providers/hubspot.ts +27 -0
- package/src/server/oauth/providers/instagram.ts +32 -0
- package/src/server/oauth/providers/keycloak.ts +31 -0
- package/src/server/oauth/providers/kick.ts +26 -0
- package/src/server/oauth/providers/line.ts +19 -0
- package/src/server/oauth/providers/linear.ts +34 -0
- package/src/server/oauth/providers/linkedin.ts +20 -0
- package/src/server/oauth/providers/livechat.ts +19 -0
- package/src/server/oauth/providers/mastodon.ts +29 -0
- package/src/server/oauth/providers/microsoft.ts +29 -0
- package/src/server/oauth/providers/okta.ts +29 -0
- package/src/server/oauth/providers/ory.ts +29 -0
- package/src/server/oauth/providers/osu.ts +19 -0
- package/src/server/oauth/providers/paypal.ts +19 -0
- package/src/server/oauth/providers/polar.ts +19 -0
- package/src/server/oauth/providers/preset.ts +206 -0
- package/src/server/oauth/providers/riotgames.ts +19 -0
- package/src/server/oauth/providers/roblox.ts +19 -0
- package/src/server/oauth/providers/salesforce.ts +29 -0
- package/src/server/oauth/providers/seznam.ts +19 -0
- package/src/server/oauth/providers/shopifyCustomer.ts +47 -0
- package/src/server/oauth/providers/slack.ts +27 -0
- package/src/server/oauth/providers/spotify.ts +19 -0
- package/src/server/oauth/providers/steam.ts +162 -0
- package/src/server/oauth/providers/strava.ts +20 -0
- package/src/server/oauth/providers/tiktok.ts +22 -0
- package/src/server/oauth/providers/twitch.ts +32 -0
- package/src/server/oauth/providers/vk.ts +36 -0
- package/src/server/oauth/providers/wechat.ts +39 -0
- package/src/server/oauth/providers/workos.ts +19 -0
- package/src/server/oauth/providers/x.ts +19 -0
- package/src/server/oauth/providers/xsuaa.ts +29 -0
- package/src/server/oauth/providers/yandex.ts +26 -0
- package/src/server/oauth/providers/zendesk.ts +29 -0
- package/src/server/oauth/providers/zitadel.ts +29 -0
- package/src/server/personal.ts +17 -0
- package/src/server/session.ts +150 -0
- package/src/server/token-requests.ts +13 -0
- package/src/server/token.ts +81 -0
- package/src/server/totp.ts +165 -0
- package/src/server/webauthn/cbor.ts +154 -0
- package/src/server/webauthn/cose.ts +95 -0
- package/src/server/webauthn/data.ts +50 -0
- package/src/server/webauthn/handler.ts +510 -0
- package/src/single-use.ts +41 -0
- package/src/types.ts +91 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type Signal } from "@angular/core";
|
|
2
|
+
import type { PublicUserSession, User } from "../index.ts";
|
|
3
|
+
import { type AuthStateSlot } from "../runtime/store.ts";
|
|
4
|
+
import { type WebAuthnCalls, type WebAuthnOptions, type WebAuthnUser } from "../client/webauthn.ts";
|
|
5
|
+
export type { AuthStateSlot };
|
|
6
|
+
export type { WebAuthnOptions, WebAuthnUser };
|
|
7
|
+
export interface UserSession {
|
|
8
|
+
ready: Signal<boolean>;
|
|
9
|
+
loggedIn: Signal<boolean>;
|
|
10
|
+
user: Signal<User | null>;
|
|
11
|
+
session: Signal<PublicUserSession | null>;
|
|
12
|
+
fetch(): Promise<void>;
|
|
13
|
+
clear(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
/** The session of the app the injector belongs to, one per request on the server; the listener ends with the injector. */
|
|
16
|
+
export declare function injectUserSession(): UserSession;
|
|
17
|
+
/**
|
|
18
|
+
* `<hamur-auth-state #auth>@if (auth.loggedIn()) { … } @else { … }</hamur-auth-state>`: the content once the session is read,
|
|
19
|
+
* the `[placeholder]` content until then.
|
|
20
|
+
*/
|
|
21
|
+
export declare class AuthState {
|
|
22
|
+
private readonly session;
|
|
23
|
+
readonly ready: Signal<boolean>;
|
|
24
|
+
readonly loggedIn: Signal<boolean>;
|
|
25
|
+
readonly user: Signal<User | null>;
|
|
26
|
+
readonly clear: () => Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
export interface WebAuthn extends WebAuthnCalls {
|
|
29
|
+
isSupported: Signal<boolean>;
|
|
30
|
+
}
|
|
31
|
+
/** `isSupported` is false in the server render and until the first render in the browser, so hydration agrees. */
|
|
32
|
+
export declare function injectWebAuthn(options: WebAuthnOptions): WebAuthn;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type UserSessionState } from "../runtime/store.ts";
|
|
2
|
+
import { type WebAuthnCalls, type WebAuthnOptions, type WebAuthnUser } from "../client/webauthn.ts";
|
|
3
|
+
export type { UserSessionState };
|
|
4
|
+
export type { WebAuthnOptions, WebAuthnUser };
|
|
5
|
+
/** The server's values: an html page does not re-render on the client, so `fetch()` and `clear()` reload; `ready` is false when the server did not read the session. */
|
|
6
|
+
export interface UserSession extends UserSessionState {
|
|
7
|
+
fetch(): Promise<void>;
|
|
8
|
+
clear(): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare function useUserSession(): UserSession;
|
|
11
|
+
export interface WebAuthn extends WebAuthnCalls {
|
|
12
|
+
isSupported: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** `isSupported` is read when called: an html page has no client render, so call it from a handler or after `app:mounted`. */
|
|
15
|
+
export declare function useWebAuthn(options: WebAuthnOptions): WebAuthn;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ComponentChildren, type VNode } from "preact";
|
|
2
|
+
import { type AuthStateSlot, type UserSessionState } from "../runtime/store.ts";
|
|
3
|
+
import { type WebAuthnCalls, type WebAuthnOptions, type WebAuthnUser } from "../client/webauthn.ts";
|
|
4
|
+
export type { AuthStateSlot, UserSessionState };
|
|
5
|
+
export type { WebAuthnOptions, WebAuthnUser };
|
|
6
|
+
export interface UserSession extends UserSessionState {
|
|
7
|
+
fetch(): Promise<void>;
|
|
8
|
+
clear(): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export interface AuthStateProps {
|
|
11
|
+
placeholder?: ComponentChildren;
|
|
12
|
+
children?: (state: AuthStateSlot) => ComponentChildren;
|
|
13
|
+
}
|
|
14
|
+
export declare function useUserSession(): UserSession;
|
|
15
|
+
export declare function AuthState({ placeholder, children }: AuthStateProps): VNode;
|
|
16
|
+
export interface WebAuthn extends WebAuthnCalls {
|
|
17
|
+
isSupported: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function useWebAuthn({ registerEndpoint, authenticateEndpoint }: WebAuthnOptions): WebAuthn;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type AuthStateSlot, type UserSessionState } from "../runtime/store.ts";
|
|
3
|
+
import { type WebAuthnCalls, type WebAuthnOptions, type WebAuthnUser } from "../client/webauthn.ts";
|
|
4
|
+
export type { AuthStateSlot, UserSessionState };
|
|
5
|
+
export type { WebAuthnOptions, WebAuthnUser };
|
|
6
|
+
export interface UserSession extends UserSessionState {
|
|
7
|
+
fetch(): Promise<void>;
|
|
8
|
+
clear(): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export interface AuthStateProps {
|
|
11
|
+
placeholder?: ReactNode;
|
|
12
|
+
children?: (state: AuthStateSlot) => ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare function useUserSession(): UserSession;
|
|
15
|
+
export declare function AuthState({ placeholder, children }: AuthStateProps): ReactNode;
|
|
16
|
+
export interface WebAuthn extends WebAuthnCalls {
|
|
17
|
+
isSupported: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function useWebAuthn({ registerEndpoint, authenticateEndpoint }: WebAuthnOptions): WebAuthn;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Accessor } from "solid-js";
|
|
2
|
+
import type { JSX } from "@solidjs/web";
|
|
3
|
+
import type { PublicUserSession, User } from "../index.ts";
|
|
4
|
+
import { type AuthStateSlot } from "../runtime/store.ts";
|
|
5
|
+
import { type WebAuthnCalls, type WebAuthnOptions, type WebAuthnUser } from "../client/webauthn.ts";
|
|
6
|
+
export type { AuthStateSlot };
|
|
7
|
+
export type { WebAuthnOptions, WebAuthnUser };
|
|
8
|
+
export interface UserSession {
|
|
9
|
+
ready: Accessor<boolean>;
|
|
10
|
+
loggedIn: Accessor<boolean>;
|
|
11
|
+
user: Accessor<User | null>;
|
|
12
|
+
session: Accessor<PublicUserSession | null>;
|
|
13
|
+
fetch(): Promise<void>;
|
|
14
|
+
clear(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export interface AuthStateProps {
|
|
17
|
+
placeholder?: JSX.Element;
|
|
18
|
+
children?: (state: AuthStateSlot) => JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
export declare function useUserSession(): UserSession;
|
|
21
|
+
export declare function AuthState(props: AuthStateProps): JSX.Element;
|
|
22
|
+
export interface WebAuthn extends WebAuthnCalls {
|
|
23
|
+
isSupported: Accessor<boolean>;
|
|
24
|
+
}
|
|
25
|
+
export declare function useWebAuthn(options: WebAuthnOptions): WebAuthn;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type UserSessionState } from "../runtime/store.ts";
|
|
2
|
+
/** A store in Svelte's contract (`$session.user`), with the two actions beside `subscribe`. */
|
|
3
|
+
export interface UserSession {
|
|
4
|
+
subscribe(run: (state: UserSessionState) => void): () => void;
|
|
5
|
+
fetch(): Promise<void>;
|
|
6
|
+
clear(): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare function useUserSession(): UserSession;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type WebAuthnCalls, type WebAuthnOptions } from "../client/webauthn.ts";
|
|
2
|
+
/** `isSupported` is a store in Svelte's contract (`$isSupported`): `false` first, so the server render and the hydration agree, then the browser's answer. */
|
|
3
|
+
export interface WebAuthn extends WebAuthnCalls {
|
|
4
|
+
isSupported: {
|
|
5
|
+
subscribe(run: (supported: boolean) => void): () => void;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export declare function useWebAuthn(options: WebAuthnOptions): WebAuthn;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as AuthState } from "./AuthState.svelte";
|
|
2
|
+
export { useUserSession, type UserSession } from "./svelte-session.ts";
|
|
3
|
+
export { useWebAuthn, type WebAuthn } from "./svelte-webauthn.ts";
|
|
4
|
+
export type { AuthStateSlot, UserSessionState } from "../runtime/store.ts";
|
|
5
|
+
export type { WebAuthnOptions, WebAuthnUser } from "../client/webauthn.ts";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Ref, type ComputedRef, type SlotsType, type VNode } from "vue";
|
|
2
|
+
import type { PublicUserSession, User } from "../index.ts";
|
|
3
|
+
import { type AuthStateSlot } from "../runtime/store.ts";
|
|
4
|
+
import { type WebAuthnCalls, type WebAuthnOptions, type WebAuthnUser } from "../client/webauthn.ts";
|
|
5
|
+
export type { AuthStateSlot };
|
|
6
|
+
export type { WebAuthnOptions, WebAuthnUser };
|
|
7
|
+
export interface UserSession {
|
|
8
|
+
ready: ComputedRef<boolean>;
|
|
9
|
+
loggedIn: ComputedRef<boolean>;
|
|
10
|
+
user: ComputedRef<User | null>;
|
|
11
|
+
session: ComputedRef<PublicUserSession | null>;
|
|
12
|
+
fetch(): Promise<void>;
|
|
13
|
+
clear(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export declare function useUserSession(): UserSession;
|
|
16
|
+
export declare const AuthState: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, SlotsType<{
|
|
19
|
+
default?: (state: AuthStateSlot) => VNode[];
|
|
20
|
+
placeholder?: () => VNode[];
|
|
21
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
22
|
+
export interface WebAuthn extends WebAuthnCalls {
|
|
23
|
+
isSupported: Readonly<Ref<boolean>>;
|
|
24
|
+
}
|
|
25
|
+
export declare function useWebAuthn(options: WebAuthnOptions): WebAuthn;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type HamurContext } from "hamur/kit";
|
|
2
|
+
import type { ResolvedAuthOptions } from "../types.ts";
|
|
3
|
+
/** The database and the user file the access tokens read, and the build check of their table. */
|
|
4
|
+
export declare function setupAccessTokens({ accessTokens }: ResolvedAuthOptions, hamur: HamurContext): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type HamurContext } from "hamur/kit";
|
|
2
|
+
import type { ResolvedAuthOptions } from "../types.ts";
|
|
3
|
+
/** The render payload of the session and the client plugin that fetches it after hydration. */
|
|
4
|
+
export declare function setupClient(options: ResolvedAuthOptions, hamur: HamurContext): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Under `hamur dev`, with no `HAMUR_KEY` in the environment or set to a value in `<rootDir>/.env`, writes one to
|
|
3
|
+
* `.env` (in place of an empty `HAMUR_KEY=` line, else appended) and sets it in this process, so the dev handler and its SSR
|
|
4
|
+
* workers (which inherit the environment) use it from this start on.
|
|
5
|
+
*/
|
|
6
|
+
export declare function ensureDevKey(rootDir: string): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type HamurContext } from "hamur/kit";
|
|
2
|
+
import type { ResolvedAuthOptions } from "../types.ts";
|
|
3
|
+
/** What `sendAuthLink` reads, with `@hamur/mail` behind it when the app has the module, and the build check of its import. */
|
|
4
|
+
export declare function setupEmail(options: ResolvedAuthOptions, hamur: HamurContext): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type HamurContext } from "hamur/kit";
|
|
2
|
+
import type { ResolvedAuthOptions } from "../types.ts";
|
|
3
|
+
/** The redirect targets `requireUser` and the `auth` and `guest` route middleware (`@hamur/auth/route-middleware`) read. */
|
|
4
|
+
export declare function setupGuards(options: ResolvedAuthOptions, hamur: HamurContext): void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type HamurContext } from "hamur/kit";
|
|
2
|
+
/** The file of `specifier`, an entry of the installed module `name`. A layer may install it where the app's root does not reach, so it is resolved from the module's own file. */
|
|
3
|
+
export declare function moduleEntry(hamur: HamurContext, name: string, specifier: string): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type HamurContext } from "hamur/kit";
|
|
2
|
+
import type { ResolvedAuthOptions } from "../types.ts";
|
|
3
|
+
type ServerRoutes = HamurContext["serverRoutes"];
|
|
4
|
+
export declare function keepAtprotoMetadata(routes: ServerRoutes): void;
|
|
5
|
+
export declare function atprotoModule(hamur: HamurContext): string;
|
|
6
|
+
/** `auth.oauth` for the presets, Apple's origin on each `oauthApple` route without a parameter, and the AT Protocol metadata route and checks. */
|
|
7
|
+
export declare function setupOAuth(options: ResolvedAuthOptions, hamur: HamurContext): void;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type HamurContext } from "hamur/kit";
|
|
2
|
+
import type { ResolvedAuthOptions } from "../types.ts";
|
|
3
|
+
/** The message for a storage mount the build does not resolve on its preset. */
|
|
4
|
+
export declare function unmountedStorage(name: string, preset: string): string;
|
|
5
|
+
/** The session endpoint door, its hooks, the app-key check, typegen and the build checks. */
|
|
6
|
+
export declare function setupSession(options: ResolvedAuthOptions, hamur: HamurContext): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type HamurContext } from "hamur/kit";
|
|
2
|
+
/** The app source files under `dir`, without tests, declaration files, `node_modules` and dot folders. */
|
|
3
|
+
export declare function sourceFiles(dir: string): string[];
|
|
4
|
+
declare const TRANSPILERS: {
|
|
5
|
+
ts: Bun.Transpiler;
|
|
6
|
+
tsx: Bun.Transpiler;
|
|
7
|
+
jsx: Bun.Transpiler;
|
|
8
|
+
};
|
|
9
|
+
/** `text` imports `name` from `@hamur/auth/server` as a value: by name, or through a namespace it reads it from; comments and strings do not count. `kind` is the file's loader. */
|
|
10
|
+
export declare function importsAuthName(name: string, text: string, kind?: keyof typeof TRANSPILERS): boolean;
|
|
11
|
+
/** `name` is imported from `@hamur/auth/server` in a server file of the app or of a layer. */
|
|
12
|
+
export declare function serverImports(hamur: HamurContext): (name: string) => boolean;
|
|
13
|
+
/** The build check of the `session` mount for single-use challenges and tokens, and what the first call and the start read. */
|
|
14
|
+
export declare function setupSingleUse(hamur: HamurContext): void;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type HamurContext } from "hamur/kit";
|
|
2
|
+
import type { SingleUseName } from "../single-use.ts";
|
|
3
|
+
import type { ResolvedAuthOptions } from "../types.ts";
|
|
4
|
+
/** The passkey helpers the app's handlers are written as a call of (`handler: webAuthnRegister({ … })`). */
|
|
5
|
+
export declare function usedHandlers(hamur: HamurContext): SingleUseName[];
|
|
6
|
+
/** The relying party the handlers read and the start checks' inputs; the `session` mount's check is `setupSingleUse`'s. */
|
|
7
|
+
export declare function setupWebAuthn(options: ResolvedAuthOptions, hamur: HamurContext): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface WebAuthnOptions {
|
|
2
|
+
registerEndpoint: string;
|
|
3
|
+
authenticateEndpoint: string;
|
|
4
|
+
}
|
|
5
|
+
export interface WebAuthnUser {
|
|
6
|
+
userName: string;
|
|
7
|
+
displayName?: string;
|
|
8
|
+
}
|
|
9
|
+
/** What every adapter's `useWebAuthn` calls; `isSupported` is the adapter's own reactive value. */
|
|
10
|
+
export interface WebAuthnCalls {
|
|
11
|
+
register(user: WebAuthnUser): Promise<unknown>;
|
|
12
|
+
authenticate(userName?: string): Promise<unknown>;
|
|
13
|
+
}
|
|
14
|
+
type Json = Record<string, any>;
|
|
15
|
+
interface Statics {
|
|
16
|
+
parseCreationOptionsFromJSON?(json: Json): unknown;
|
|
17
|
+
parseRequestOptionsFromJSON?(json: Json): unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface WebAuthnEnv {
|
|
20
|
+
post(url: string, body: unknown): Promise<unknown>;
|
|
21
|
+
credentials: {
|
|
22
|
+
create(options: {
|
|
23
|
+
publicKey: unknown;
|
|
24
|
+
}): Promise<unknown>;
|
|
25
|
+
get(options: {
|
|
26
|
+
publicKey: unknown;
|
|
27
|
+
}): Promise<unknown>;
|
|
28
|
+
};
|
|
29
|
+
PublicKeyCredential?: Statics;
|
|
30
|
+
}
|
|
31
|
+
/** A secure context that has `PublicKeyCredential`. */
|
|
32
|
+
export declare function webAuthnSupported(): boolean;
|
|
33
|
+
export declare function toBase64Url(bytes: ArrayBuffer | ArrayBufferView): string;
|
|
34
|
+
export declare function fromBase64Url(text: string): Uint8Array<ArrayBuffer>;
|
|
35
|
+
/** The two steps of `webAuthnRegister` and `webAuthnAuthenticate`, `options` then `verify`. A refused step rejects with the `FetchError` of its answer. */
|
|
36
|
+
export declare function webAuthn(options: WebAuthnOptions, env?: WebAuthnEnv): WebAuthnCalls;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { HamurEvent } from "hamur/server";
|
|
2
|
+
import type { AuthConfig } from "./types.ts";
|
|
3
|
+
export { default } from "./module.ts";
|
|
4
|
+
export type { AuthConfig, AuthLoadStrategy, AuthSessionConfig } from "./types.ts";
|
|
5
|
+
/** The signed-in user; an app adds its fields with `declare module "@hamur/auth" { interface User { … } }`. */
|
|
6
|
+
export interface User {
|
|
7
|
+
}
|
|
8
|
+
/** Fields of the user session besides `user` and `secure`, added the same way. */
|
|
9
|
+
export interface UserSession {
|
|
10
|
+
}
|
|
11
|
+
/** Fields kept in the session that never leave the server: not in the session endpoint, not in the payload. */
|
|
12
|
+
export interface SecureSessionData {
|
|
13
|
+
}
|
|
14
|
+
export type UserSessionData = UserSession & {
|
|
15
|
+
user?: User;
|
|
16
|
+
secure?: SecureSessionData;
|
|
17
|
+
};
|
|
18
|
+
/** The user session as the session endpoint answers it: without `id` and `secure`. */
|
|
19
|
+
export type PublicUserSession = Omit<UserSessionData, "secure">;
|
|
20
|
+
/** The access token of the request, as `requireAccessToken` puts it on `event.context`. */
|
|
21
|
+
export interface AccessToken {
|
|
22
|
+
id: string;
|
|
23
|
+
scopes: string[];
|
|
24
|
+
}
|
|
25
|
+
declare module "hamur" {
|
|
26
|
+
interface HamurModuleOptions {
|
|
27
|
+
auth?: AuthConfig;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
declare module "hamur/server" {
|
|
31
|
+
interface HamurEventContext {
|
|
32
|
+
/** Set by `requireAccessToken`, with the token's user as `user`. */
|
|
33
|
+
accessToken?: AccessToken;
|
|
34
|
+
}
|
|
35
|
+
interface ServerHooks {
|
|
36
|
+
/** Before `GET <baseURL>_hamur/auth/session` answers a session with keys; may add fields, and a throw is the answer. */
|
|
37
|
+
"auth:session:fetch": (session: PublicUserSession, event: HamurEvent) => void | Promise<void>;
|
|
38
|
+
/** Before `clearUserSession` (and `DELETE <baseURL>_hamur/auth/session`) clears the session. */
|
|
39
|
+
"auth:session:clear": (session: UserSessionData & {
|
|
40
|
+
id: string;
|
|
41
|
+
}, event: HamurEvent) => void | Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** The user session or the 401, and `{ user, session }` on the context; in a request list a document request goes to `auth.redirect.login` instead. */
|
|
2
|
+
export declare const requireUser: import("hamur/server").FunctionMiddleware<{}, import("./server/guard.ts").RequiredUser>;
|
|
3
|
+
/** The user and the scopes of the request's access token, or the 401; a session cookie does not stand in for the token. */
|
|
4
|
+
export declare const requireAccessToken: import("hamur/server").FunctionMiddleware<{}, import("./server/access-token.ts").RequiredAccessToken>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ResolvedAuthOptions } from "./types.ts";
|
|
2
|
+
export declare const DEFAULT_MAX_AGE = 604800;
|
|
3
|
+
/** The `auth` key checked, with the defaults; a password is never printed in a message. */
|
|
4
|
+
export declare function resolveOptions(input: unknown): ResolvedAuthOptions;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type AppContext } from "hamur/app";
|
|
2
|
+
import type { PublicUserSession, User } from "../index.ts";
|
|
3
|
+
export declare const SESSION_PATH = "/_hamur/auth/session";
|
|
4
|
+
/** What `useUserSession` shows; `ready` is false until the session was read on the server or fetched. */
|
|
5
|
+
export interface UserSessionState {
|
|
6
|
+
ready: boolean;
|
|
7
|
+
loggedIn: boolean;
|
|
8
|
+
user: User | null;
|
|
9
|
+
session: PublicUserSession | null;
|
|
10
|
+
}
|
|
11
|
+
/** What `AuthState` hands its children once `ready`. */
|
|
12
|
+
export interface AuthStateSlot {
|
|
13
|
+
loggedIn: boolean;
|
|
14
|
+
user: User | null;
|
|
15
|
+
clear(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export interface AuthStore {
|
|
18
|
+
get(): UserSessionState;
|
|
19
|
+
subscribe(listener: () => void): () => void;
|
|
20
|
+
fetch(): Promise<void>;
|
|
21
|
+
clear(): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
/** `{ session }` under `auth`, `null` when the server read the cookie and found an empty session; absent when it did not read it. */
|
|
24
|
+
export interface AuthPayload {
|
|
25
|
+
session: PublicUserSession | null;
|
|
26
|
+
}
|
|
27
|
+
/** One store per app context, started from the module payload, so the server render and the hydration read the same state. */
|
|
28
|
+
export declare function authStore(app: AppContext): AuthStore;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** A path on this origin: `/` and then not `/` or `\`, so no scheme and no host; no control character, which a browser drops before it reads the URL. */
|
|
2
|
+
export declare function isAppPath(value: unknown): value is string;
|
|
3
|
+
/** `auth.redirect.login` with `redirect=<the app path asked for>` added to its query. */
|
|
4
|
+
export declare function loginTarget(login: string, path: string): string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type FunctionMiddleware, type HamurEvent } from "hamur/server";
|
|
2
|
+
import type { AccessToken, User } from "../index.ts";
|
|
3
|
+
export interface AccessTokenOptions {
|
|
4
|
+
/** What the user calls the token, such as `"deploy script"`. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Seconds until the token stops working, a positive integer; without it the token works until it is revoked. */
|
|
7
|
+
expiresIn?: number;
|
|
8
|
+
/** What the token may be used for, such as `["reports:read"]`; the app's policies and handlers read them. Default `[]`. */
|
|
9
|
+
scopes?: string[];
|
|
10
|
+
}
|
|
11
|
+
/** What `requireAccessToken` puts on the context. */
|
|
12
|
+
export interface RequiredAccessToken {
|
|
13
|
+
accessToken: AccessToken;
|
|
14
|
+
user: User;
|
|
15
|
+
}
|
|
16
|
+
/** A token for the session's user, returned here once; only the SHA-256 of its secret part is stored. */
|
|
17
|
+
export declare function createAccessToken(event: HamurEvent, options: AccessTokenOptions): Promise<{
|
|
18
|
+
id: string;
|
|
19
|
+
token: string;
|
|
20
|
+
}>;
|
|
21
|
+
/** Deletes the token `id` of the session's user; another user's token and an unknown id are left as they are. */
|
|
22
|
+
export declare function revokeAccessToken(event: HamurEvent, id: string): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* The `server` part of `requireAccessToken`. `authorize` and `principal` get the event, so `event.context` holds the token too,
|
|
25
|
+
* for this call alone; in a request list, whose `context` is `event.context`, `next({ context })` would leave it there.
|
|
26
|
+
*/
|
|
27
|
+
export declare const accessTokenGuard: NonNullable<FunctionMiddleware<{}, RequiredAccessToken>["server"]>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type HamurEvent } from "hamur/server";
|
|
2
|
+
import type { AuthLinkPurpose } from "../types.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Mails `email` a link of `auth.email.<purpose>` with a single-use token; the page posts the token to a handler that calls
|
|
5
|
+
* `consumeAuthToken(event, token, purpose)`, which gives `{ email, data, next }`. It looks no account up: the app decides whether to send.
|
|
6
|
+
*/
|
|
7
|
+
export declare function sendAuthLink(event: HamurEvent, options: {
|
|
8
|
+
purpose: AuthLinkPurpose;
|
|
9
|
+
/** One bare address, such as `"ada@example.com"`. */
|
|
10
|
+
email: string;
|
|
11
|
+
/** Sealed into the token. */
|
|
12
|
+
data?: unknown;
|
|
13
|
+
/** An app path, sealed into the token. */
|
|
14
|
+
next?: string;
|
|
15
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type HamurEvent } from "hamur/server";
|
|
2
|
+
import type { PublicUserSession } from "../index.ts";
|
|
3
|
+
/** The session without `id` and `secure`, after `auth:session:fetch` when it has keys; the endpoint and the render payload send it. */
|
|
4
|
+
export declare function publicSession(event: HamurEvent): Promise<PublicUserSession>;
|
|
5
|
+
export declare const authSession: import("hamur/server").Handler<unknown, {
|
|
6
|
+
user?: {} | undefined;
|
|
7
|
+
}, unknown, PublicUserSession, {}>;
|
|
8
|
+
export declare const authSessionClear: import("hamur/server").Handler<unknown, Response, unknown, Response, {}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type FunctionMiddleware } from "hamur/server";
|
|
2
|
+
import type { User, UserSessionData } from "../index.ts";
|
|
3
|
+
/** What `requireUser` puts on the context. */
|
|
4
|
+
export interface RequiredUser {
|
|
5
|
+
user: User;
|
|
6
|
+
session: UserSessionData & {
|
|
7
|
+
user: User;
|
|
8
|
+
id: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/** The `server` part of `requireUser`. In a request list (its `context` is `event.context`) a document request goes to the login page; anything else is the 401. */
|
|
12
|
+
export declare const guard: NonNullable<FunctionMiddleware<{}, RequiredUser>["server"]>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Hooks } from "hamur/kit";
|
|
2
|
+
import type { ServerHooks } from "hamur/server";
|
|
3
|
+
/** The door's plugin hands over the server's hooks at start, before any request. */
|
|
4
|
+
export declare function setServerHooks(hooks: Hooks<ServerHooks>): void;
|
|
5
|
+
export declare function serverHooks(): Hooks<ServerHooks> | undefined;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export { clearUserSession, getUserSession, replaceUserSession, requireUserSession, setUserSession } from "./session.ts";
|
|
2
|
+
export { createAccessToken, revokeAccessToken } from "./access-token.ts";
|
|
3
|
+
export type { AccessTokenOptions } from "./access-token.ts";
|
|
4
|
+
export { sendAuthLink } from "./auth-link.ts";
|
|
5
|
+
export { consumeAuthToken, createAuthToken } from "./token.ts";
|
|
6
|
+
export type { AuthTokenOptions } from "./token.ts";
|
|
7
|
+
export { createRecoveryCodes, createTotp, matchRecoveryCode, verifyTotp } from "./totp.ts";
|
|
8
|
+
export type { TotpOptions, VerifyTotpOptions } from "./totp.ts";
|
|
9
|
+
export { oauthHandler } from "./oauth/handler.ts";
|
|
10
|
+
export type { OAuthError, OAuthHandlerOptions, OAuthTokens } from "./oauth/handler.ts";
|
|
11
|
+
export { oauthOIDC } from "./oauth/oidc.ts";
|
|
12
|
+
export type { OAuthOIDCOptions } from "./oauth/oidc.ts";
|
|
13
|
+
export { oauthAtproto } from "./oauth/atproto.ts";
|
|
14
|
+
export type { AtprotoClientMetadata, AtprotoResult, OAuthAtprotoOptions } from "./oauth/atproto.ts";
|
|
15
|
+
export type { OAuthPresetBaseOptions, OAuthPresetOptions } from "./oauth/providers/preset.ts";
|
|
16
|
+
export { oauthApple } from "./oauth/providers/apple.ts";
|
|
17
|
+
export type { AppleConfig, AppleUser } from "./oauth/providers/apple.ts";
|
|
18
|
+
export { oauthDiscord } from "./oauth/providers/discord.ts";
|
|
19
|
+
export { oauthGitHub } from "./oauth/providers/github.ts";
|
|
20
|
+
export { oauthGitLab } from "./oauth/providers/gitlab.ts";
|
|
21
|
+
export type { GitLabConfig } from "./oauth/providers/gitlab.ts";
|
|
22
|
+
export { oauthGoogle } from "./oauth/providers/google.ts";
|
|
23
|
+
export { oauthMicrosoft } from "./oauth/providers/microsoft.ts";
|
|
24
|
+
export type { MicrosoftConfig } from "./oauth/providers/microsoft.ts";
|
|
25
|
+
export { oauthSteam } from "./oauth/providers/steam.ts";
|
|
26
|
+
export type { SteamOptions, SteamUser } from "./oauth/providers/steam.ts";
|
|
27
|
+
export { oauthAtlassian } from "./oauth/providers/atlassian.ts";
|
|
28
|
+
export { oauthAuth0 } from "./oauth/providers/auth0.ts";
|
|
29
|
+
export type { Auth0Config } from "./oauth/providers/auth0.ts";
|
|
30
|
+
export { oauthAuthentik } from "./oauth/providers/authentik.ts";
|
|
31
|
+
export type { AuthentikConfig } from "./oauth/providers/authentik.ts";
|
|
32
|
+
export { oauthBattleDotNet } from "./oauth/providers/battledotnet.ts";
|
|
33
|
+
export { oauthBox } from "./oauth/providers/box.ts";
|
|
34
|
+
export { oauthDropbox } from "./oauth/providers/dropbox.ts";
|
|
35
|
+
export { oauthFacebook } from "./oauth/providers/facebook.ts";
|
|
36
|
+
export { oauthGitea } from "./oauth/providers/gitea.ts";
|
|
37
|
+
export type { GiteaConfig } from "./oauth/providers/gitea.ts";
|
|
38
|
+
export { oauthHeroku } from "./oauth/providers/heroku.ts";
|
|
39
|
+
export { oauthKeycloak } from "./oauth/providers/keycloak.ts";
|
|
40
|
+
export type { KeycloakConfig } from "./oauth/providers/keycloak.ts";
|
|
41
|
+
export { oauthKick } from "./oauth/providers/kick.ts";
|
|
42
|
+
export { oauthLine } from "./oauth/providers/line.ts";
|
|
43
|
+
export { oauthLinear } from "./oauth/providers/linear.ts";
|
|
44
|
+
export { oauthLinkedIn } from "./oauth/providers/linkedin.ts";
|
|
45
|
+
export { oauthMastodon } from "./oauth/providers/mastodon.ts";
|
|
46
|
+
export type { MastodonConfig } from "./oauth/providers/mastodon.ts";
|
|
47
|
+
export { oauthOkta } from "./oauth/providers/okta.ts";
|
|
48
|
+
export type { OktaConfig } from "./oauth/providers/okta.ts";
|
|
49
|
+
export { oauthOry } from "./oauth/providers/ory.ts";
|
|
50
|
+
export type { OryConfig } from "./oauth/providers/ory.ts";
|
|
51
|
+
export { oauthOsu } from "./oauth/providers/osu.ts";
|
|
52
|
+
export { oauthPayPal } from "./oauth/providers/paypal.ts";
|
|
53
|
+
export { oauthPolar } from "./oauth/providers/polar.ts";
|
|
54
|
+
export { oauthRiotGames } from "./oauth/providers/riotgames.ts";
|
|
55
|
+
export { oauthRoblox } from "./oauth/providers/roblox.ts";
|
|
56
|
+
export { oauthSalesforce } from "./oauth/providers/salesforce.ts";
|
|
57
|
+
export type { SalesforceConfig } from "./oauth/providers/salesforce.ts";
|
|
58
|
+
export { oauthSeznam } from "./oauth/providers/seznam.ts";
|
|
59
|
+
export { oauthSlack } from "./oauth/providers/slack.ts";
|
|
60
|
+
export { oauthSpotify } from "./oauth/providers/spotify.ts";
|
|
61
|
+
export { oauthTwitch } from "./oauth/providers/twitch.ts";
|
|
62
|
+
export { oauthX } from "./oauth/providers/x.ts";
|
|
63
|
+
export { oauthYandex } from "./oauth/providers/yandex.ts";
|
|
64
|
+
export { oauthZendesk } from "./oauth/providers/zendesk.ts";
|
|
65
|
+
export type { ZendeskConfig } from "./oauth/providers/zendesk.ts";
|
|
66
|
+
export { oauthZitadel } from "./oauth/providers/zitadel.ts";
|
|
67
|
+
export type { ZitadelConfig } from "./oauth/providers/zitadel.ts";
|
|
68
|
+
export { oauthAzureB2C } from "./oauth/providers/azureb2c.ts";
|
|
69
|
+
export type { AzureB2CConfig } from "./oauth/providers/azureb2c.ts";
|
|
70
|
+
export { oauthCloudflare } from "./oauth/providers/cloudflare.ts";
|
|
71
|
+
export type { CloudflareConfig } from "./oauth/providers/cloudflare.ts";
|
|
72
|
+
export { oauthCognito } from "./oauth/providers/cognito.ts";
|
|
73
|
+
export type { CognitoConfig } from "./oauth/providers/cognito.ts";
|
|
74
|
+
export { oauthHubSpot } from "./oauth/providers/hubspot.ts";
|
|
75
|
+
export { oauthInstagram } from "./oauth/providers/instagram.ts";
|
|
76
|
+
export { oauthLiveChat } from "./oauth/providers/livechat.ts";
|
|
77
|
+
export { oauthShopifyCustomer } from "./oauth/providers/shopifyCustomer.ts";
|
|
78
|
+
export type { ShopifyCustomerConfig } from "./oauth/providers/shopifyCustomer.ts";
|
|
79
|
+
export { oauthStrava } from "./oauth/providers/strava.ts";
|
|
80
|
+
export { oauthTikTok } from "./oauth/providers/tiktok.ts";
|
|
81
|
+
export { oauthVK } from "./oauth/providers/vk.ts";
|
|
82
|
+
export { oauthWeChat } from "./oauth/providers/wechat.ts";
|
|
83
|
+
export { oauthWorkOS } from "./oauth/providers/workos.ts";
|
|
84
|
+
export { oauthXsuaa } from "./oauth/providers/xsuaa.ts";
|
|
85
|
+
export type { XsuaaConfig } from "./oauth/providers/xsuaa.ts";
|
|
86
|
+
export { webAuthnAuthenticate, webAuthnRegister } from "./webauthn/handler.ts";
|
|
87
|
+
export type { WebAuthnAlgorithm, WebAuthnAuthenticateOptions, WebAuthnCredential, WebAuthnCredentialDescriptor, WebAuthnRegisterOptions, WebAuthnUser, WebAuthnUserVerification, } from "./webauthn/handler.ts";
|
|
88
|
+
export type { UserSessionData } from "../index.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const hostFetch: ((url: string, init: RequestInit) => Promise<Response>) | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { hostProblem, urlProblem } from "hamur/server/internal";
|
|
2
|
+
export declare const FETCH_TIMEOUT = 5000;
|
|
3
|
+
export declare const MAX_BODY = 65536;
|
|
4
|
+
/** `message` is the reason, logged and never sent. */
|
|
5
|
+
export declare class AtprotoResolveError extends Error {
|
|
6
|
+
}
|
|
7
|
+
export interface AtprotoAnswer {
|
|
8
|
+
status: number;
|
|
9
|
+
ok: boolean;
|
|
10
|
+
headers: Headers;
|
|
11
|
+
text: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function atprotoFetch(url: string, init?: RequestInit): Promise<AtprotoAnswer>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const atprotoClientMetadata: import("hamur/server").Handler<unknown, Response, unknown, Response, {}>;
|