apps 0.0.1-beta.14 → 0.0.1-beta.15

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.
@@ -0,0 +1,89 @@
1
+ /** OAuth declarations frozen for host protocols 1 through 5. */
2
+ import { Schema } from "effect";
3
+ /** How an OAuth client authenticates at the token endpoint; raw Basic is an explicit provider compatibility option. */
4
+ export declare const OAuthClientAuth: Schema.Literals<readonly ["none", "client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>;
5
+ export type OAuthClientAuth = typeof OAuthClientAuth.Type;
6
+ /** Machine clients always authenticate; public clients cannot use the client-credentials grant. */
7
+ export declare const OAuthSecretClientAuth: Schema.Literals<readonly ["client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>;
8
+ /** Parameters the host sets on every authorization request; a declaration cannot replace them. */
9
+ export declare const reservedAuthorizationParams: readonly ["response_type", "client_id", "redirect_uri", "state", "scope", "code_challenge", "code_challenge_method", "nonce", "resource", "request", "request_uri"];
10
+ /** A protocol parameter only the host sets on the authorization request. */
11
+ export type ReservedAuthorizationParam = (typeof reservedAuthorizationParams)[number];
12
+ /**
13
+ * Extra authorization request parameters, such as `access_type: "offline"`. RFC 6749 §3.1
14
+ * lets services define their own; the protocol and security parameters stay host-owned.
15
+ */
16
+ export declare const OAuthAuthorizationParams: Schema.$Record<Schema.String, Schema.String>;
17
+ /** How the token endpoint reads requests. RFC 6749 uses a form; some services want JSON. */
18
+ export declare const OAuthTokenRequestFormat: Schema.Literals<readonly ["form", "json"]>;
19
+ export type OAuthTokenRequestFormat = typeof OAuthTokenRequestFormat.Type;
20
+ /**
21
+ * Where a service nests the grant in its token response, as a dot-separated member path. Slack
22
+ * returns a user token under `authed_user`.
23
+ */
24
+ export declare const OAuthTokenResponse: Schema.Struct<{
25
+ readonly path: Schema.String;
26
+ }>;
27
+ export type OAuthTokenResponse = typeof OAuthTokenResponse.Type;
28
+ /**
29
+ * OAuth endpoints and protocol choices. Omitted grant means authorization code; clients remain
30
+ * host-owned. Declared endpoints may name an RFC 7009 `revocationUrl`; discovery reads the
31
+ * server's `revocation_endpoint` metadata instead.
32
+ */
33
+ export declare const OAuth2Config: Schema.Union<readonly [Schema.Struct<{
34
+ readonly discover: Schema.String;
35
+ readonly authorizationUrl: Schema.optionalKey<Schema.Never>;
36
+ readonly tokenUrl: Schema.optionalKey<Schema.Never>;
37
+ readonly revocationUrl: Schema.optionalKey<Schema.Never>;
38
+ readonly scopes: Schema.optionalKey<Schema.$Array<Schema.String>>;
39
+ readonly tokenResponse: Schema.optionalKey<Schema.Struct<{
40
+ readonly path: Schema.String;
41
+ }>>;
42
+ readonly grant: Schema.optionalKey<Schema.Literal<"authorization_code">>;
43
+ readonly authorizationParams: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
44
+ readonly tokenEndpointAuthMethod: Schema.optionalKey<Schema.Literals<readonly ["none", "client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>>;
45
+ readonly resource: Schema.optionalKey<Schema.NullOr<Schema.String>>;
46
+ readonly scopeSeparator: Schema.optionalKey<Schema.String>;
47
+ readonly tokenRequestFormat: Schema.optionalKey<Schema.Literals<readonly ["form", "json"]>>;
48
+ }>, Schema.Struct<{
49
+ /** Its query is kept; it cannot set protocol parameters or repeat `authorizationParams`. */
50
+ readonly authorizationUrl: Schema.String;
51
+ readonly tokenUrl: Schema.String;
52
+ readonly revocationUrl: Schema.optionalKey<Schema.String>;
53
+ readonly scopes: Schema.$Array<Schema.String>;
54
+ /** RFC 8414 issuer identifier. Declared issuers are checked against the callback's `iss`. */
55
+ readonly issuer: Schema.optionalKey<Schema.String>;
56
+ readonly discover: Schema.optionalKey<Schema.Never>;
57
+ readonly tokenResponse: Schema.optionalKey<Schema.Struct<{
58
+ readonly path: Schema.String;
59
+ }>>;
60
+ readonly grant: Schema.optionalKey<Schema.Literal<"authorization_code">>;
61
+ readonly authorizationParams: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
62
+ readonly tokenEndpointAuthMethod: Schema.optionalKey<Schema.Literals<readonly ["none", "client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>>;
63
+ readonly resource: Schema.optionalKey<Schema.NullOr<Schema.String>>;
64
+ readonly scopeSeparator: Schema.optionalKey<Schema.String>;
65
+ readonly tokenRequestFormat: Schema.optionalKey<Schema.Literals<readonly ["form", "json"]>>;
66
+ }>, Schema.Struct<{
67
+ readonly tokenEndpointAuthMethod: Schema.Literals<readonly ["client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>;
68
+ readonly resource: Schema.optionalKey<Schema.NullOr<Schema.String>>;
69
+ readonly scopeSeparator: Schema.optionalKey<Schema.String>;
70
+ readonly tokenRequestFormat: Schema.optionalKey<Schema.Literals<readonly ["form", "json"]>>;
71
+ readonly grant: Schema.Literal<"client_credentials">;
72
+ readonly discover: Schema.String;
73
+ readonly authorizationUrl: Schema.optionalKey<Schema.Never>;
74
+ readonly tokenUrl: Schema.optionalKey<Schema.Never>;
75
+ readonly revocationUrl: Schema.optionalKey<Schema.Never>;
76
+ readonly scopes: Schema.optionalKey<Schema.$Array<Schema.String>>;
77
+ }>, Schema.Struct<{
78
+ readonly tokenEndpointAuthMethod: Schema.Literals<readonly ["client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>;
79
+ readonly resource: Schema.optionalKey<Schema.NullOr<Schema.String>>;
80
+ readonly authorizationUrl: Schema.optionalKey<Schema.Never>;
81
+ readonly discover: Schema.optionalKey<Schema.Never>;
82
+ readonly scopeSeparator: Schema.optionalKey<Schema.String>;
83
+ readonly tokenRequestFormat: Schema.optionalKey<Schema.Literals<readonly ["form", "json"]>>;
84
+ readonly grant: Schema.Literal<"client_credentials">;
85
+ readonly tokenUrl: Schema.String;
86
+ readonly revocationUrl: Schema.optionalKey<Schema.String>;
87
+ readonly scopes: Schema.$Array<Schema.String>;
88
+ }>]>;
89
+ export type OAuth2Config = typeof OAuth2Config.Type;
@@ -42,6 +42,8 @@ export type OAuthTokenResponse = typeof OAuthTokenResponse.Type;
42
42
  */
43
43
  export declare const OAuth2Config: Schema.Union<readonly [Schema.Struct<{
44
44
  readonly discover: Schema.String;
45
+ /** Fetch this exact metadata document and verify its issuer against discovery. */
46
+ readonly authorizationServerMetadataUrl: Schema.optionalKey<Schema.String>;
45
47
  readonly authorizationUrl: Schema.optionalKey<Schema.Never>;
46
48
  readonly tokenUrl: Schema.optionalKey<Schema.Never>;
47
49
  readonly revocationUrl: Schema.optionalKey<Schema.Never>;
@@ -64,6 +66,7 @@ export declare const OAuth2Config: Schema.Union<readonly [Schema.Struct<{
64
66
  /** RFC 8414 issuer identifier. Declared issuers are checked against the callback's `iss`. */
65
67
  readonly issuer: Schema.optionalKey<Schema.String>;
66
68
  readonly discover: Schema.optionalKey<Schema.Never>;
69
+ readonly authorizationServerMetadataUrl: Schema.optionalKey<Schema.Never>;
67
70
  readonly tokenResponse: Schema.optionalKey<Schema.Struct<{
68
71
  readonly path: Schema.String;
69
72
  }>>;
@@ -80,6 +83,8 @@ export declare const OAuth2Config: Schema.Union<readonly [Schema.Struct<{
80
83
  readonly tokenRequestFormat: Schema.optionalKey<Schema.Literals<readonly ["form", "json"]>>;
81
84
  readonly grant: Schema.Literal<"client_credentials">;
82
85
  readonly discover: Schema.String;
86
+ /** Fetch this exact metadata document and verify its issuer against discovery. */
87
+ readonly authorizationServerMetadataUrl: Schema.optionalKey<Schema.String>;
83
88
  readonly authorizationUrl: Schema.optionalKey<Schema.Never>;
84
89
  readonly tokenUrl: Schema.optionalKey<Schema.Never>;
85
90
  readonly revocationUrl: Schema.optionalKey<Schema.Never>;
@@ -89,6 +94,7 @@ export declare const OAuth2Config: Schema.Union<readonly [Schema.Struct<{
89
94
  readonly resource: Schema.optionalKey<Schema.NullOr<Schema.String>>;
90
95
  readonly authorizationUrl: Schema.optionalKey<Schema.Never>;
91
96
  readonly discover: Schema.optionalKey<Schema.Never>;
97
+ readonly authorizationServerMetadataUrl: Schema.optionalKey<Schema.Never>;
92
98
  readonly scopeSeparator: Schema.optionalKey<Schema.String>;
93
99
  readonly tokenRequestFormat: Schema.optionalKey<Schema.Literals<readonly ["form", "json"]>>;
94
100
  readonly grant: Schema.Literal<"client_credentials">;