@yielded/auth 0.1.0-beta.2 → 0.1.0-beta.3
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/dist/DrizzleD1.d.mts +12 -12
- package/dist/DrizzleMysql2.d.mts +2 -2
- package/dist/DrizzlePglite.d.mts +2 -2
- package/dist/DrizzlePostgres.d.mts +14 -14
- package/dist/DrizzleSqliteBun.d.mts +8 -8
- package/dist/DrizzleSqliteNode.d.mts +2 -2
- package/dist/DrizzleSqliteWasm.d.mts +14 -14
- package/dist/GitHub.d.mts +2 -2
- package/dist/GitHub.mjs +2 -2
- package/dist/OpenIdClientConnected.d.mts +1 -1
- package/dist/drizzle/d1-oauth.d.mts +4 -4
- package/dist/oauth/github/protocol.d.mts +7 -3
- package/dist/oauth/github/protocol.mjs +22 -9
- package/dist/oauth/github/protocol.mjs.map +1 -1
- package/dist/oauth/openid-client/compatibility.d.mts +22 -1
- package/dist/oauth/openid-client/compatibility.mjs +6 -1
- package/dist/oauth/openid-client/compatibility.mjs.map +1 -1
- package/dist/oauth/openid-client/configuration.mjs +2 -0
- package/dist/oauth/openid-client/configuration.mjs.map +1 -1
- package/dist/oauth/openid-client/connected/protocol.d.mts +1 -1
- package/dist/oauth/openid-client/models.d.mts +3 -0
- package/dist/oauth/openid-client/models.mjs.map +1 -1
- package/dist/oauth/openid-client/protocol.d.mts +0 -1
- package/dist/oauth/openid-client/protocol.mjs +7 -7
- package/dist/oauth/openid-client/protocol.mjs.map +1 -1
- package/package.json +1 -1
- package/src/GitHub.ts +1 -0
- package/src/oauth/github/protocol.ts +27 -8
- package/src/oauth/openid-client/compatibility.ts +13 -0
- package/src/oauth/openid-client/configuration.ts +2 -0
- package/src/oauth/openid-client/models.ts +3 -0
- package/src/oauth/openid-client/protocol.ts +6 -22
package/dist/DrizzleD1.d.mts
CHANGED
|
@@ -321,14 +321,14 @@ declare const makeOAuthConnectedServices: <S extends AnySQLiteTable<{
|
|
|
321
321
|
};
|
|
322
322
|
}) => Effect.Effect<{
|
|
323
323
|
readonly _tag: "Rejected";
|
|
324
|
-
} | {
|
|
325
|
-
readonly _tag: "Conflict";
|
|
326
324
|
} | {
|
|
327
325
|
readonly _tag: "Target";
|
|
328
326
|
readonly cohortGeneration: string & import("effect/Brand").Brand<"effect-auth/SecurityRevision">;
|
|
329
327
|
} | {
|
|
330
328
|
readonly _tag: "Quarantine";
|
|
331
329
|
readonly cohortGeneration: string & import("effect/Brand").Brand<"effect-auth/SecurityRevision">;
|
|
330
|
+
} | {
|
|
331
|
+
readonly _tag: "Conflict";
|
|
332
332
|
}, OAuthUnavailable>;
|
|
333
333
|
readonly settle: <A>(input: {
|
|
334
334
|
readonly claim: OAuthConnectedClaim;
|
|
@@ -338,11 +338,11 @@ declare const makeOAuthConnectedServices: <S extends AnySQLiteTable<{
|
|
|
338
338
|
}, prepare: PrepareOAuthCommit<{
|
|
339
339
|
readonly _tag: "Rejected";
|
|
340
340
|
} | {
|
|
341
|
-
readonly _tag: "
|
|
341
|
+
readonly _tag: "Conflict";
|
|
342
342
|
} | {
|
|
343
343
|
readonly _tag: "Cancelled";
|
|
344
344
|
} | {
|
|
345
|
-
readonly _tag: "
|
|
345
|
+
readonly _tag: "Ambiguous";
|
|
346
346
|
} | {
|
|
347
347
|
readonly _tag: "Connected";
|
|
348
348
|
readonly grant: {
|
|
@@ -527,14 +527,14 @@ declare const makeOAuthConnectedServices: <S extends AnySQLiteTable<{
|
|
|
527
527
|
readonly retentionUntilMillis: number;
|
|
528
528
|
}, prepare: PrepareOAuthCommit<{
|
|
529
529
|
readonly _tag: "Rejected";
|
|
530
|
+
} | {
|
|
531
|
+
readonly _tag: "Conflict";
|
|
530
532
|
} | {
|
|
531
533
|
readonly _tag: "Disconnected";
|
|
532
534
|
readonly grantId: string & import("effect/Brand").Brand<"effect-auth/OAuthGrantId">;
|
|
533
535
|
readonly remoteRevocation: "Confirmed" | "Pending" | "Unknown" | "Unsupported";
|
|
534
536
|
readonly affectedGrantCount: number;
|
|
535
537
|
readonly replayed: boolean;
|
|
536
|
-
} | {
|
|
537
|
-
readonly _tag: "Conflict";
|
|
538
538
|
}, A>) => Effect.Effect<PreparedCommit<A>, OAuthUnavailable, never>;
|
|
539
539
|
readonly inspectAccess: (input: {
|
|
540
540
|
readonly authorization: OAuthConnectedUseAuthorization;
|
|
@@ -542,8 +542,6 @@ declare const makeOAuthConnectedServices: <S extends AnySQLiteTable<{
|
|
|
542
542
|
readonly profileKey: string & import("effect/Brand").Brand<"effect-auth/OAuthPermissionProfileKey">;
|
|
543
543
|
}) => Effect.Effect<{
|
|
544
544
|
readonly _tag: "Rejected";
|
|
545
|
-
} | {
|
|
546
|
-
readonly _tag: "ReauthorizationRequired";
|
|
547
545
|
} | {
|
|
548
546
|
readonly _tag: "Busy";
|
|
549
547
|
} | {
|
|
@@ -607,6 +605,8 @@ declare const makeOAuthConnectedServices: <S extends AnySQLiteTable<{
|
|
|
607
605
|
readonly ciphertext: import("effect/Redacted").Redacted<string>;
|
|
608
606
|
};
|
|
609
607
|
};
|
|
608
|
+
} | {
|
|
609
|
+
readonly _tag: "ReauthorizationRequired";
|
|
610
610
|
}, OAuthUnavailable>;
|
|
611
611
|
readonly claimRefresh: <A>(input: {
|
|
612
612
|
readonly grant: OAuthConnectedStoredGrant;
|
|
@@ -616,10 +616,10 @@ declare const makeOAuthConnectedServices: <S extends AnySQLiteTable<{
|
|
|
616
616
|
readonly lifetimeMillis: number;
|
|
617
617
|
}, prepare: PrepareOAuthCommit<{
|
|
618
618
|
readonly _tag: "Rejected";
|
|
619
|
-
} | {
|
|
620
|
-
readonly _tag: "ReauthorizationRequired";
|
|
621
619
|
} | {
|
|
622
620
|
readonly _tag: "Busy";
|
|
621
|
+
} | {
|
|
622
|
+
readonly _tag: "ReauthorizationRequired";
|
|
623
623
|
} | {
|
|
624
624
|
readonly _tag: "Claimed";
|
|
625
625
|
readonly claim: {
|
|
@@ -765,10 +765,10 @@ declare const makeOAuthConnectedServices: <S extends AnySQLiteTable<{
|
|
|
765
765
|
readonly lifetimeMillis: number;
|
|
766
766
|
}, prepare: PrepareOAuthCommit<{
|
|
767
767
|
readonly _tag: "Rejected";
|
|
768
|
-
} | {
|
|
769
|
-
readonly _tag: "ReauthorizationRequired";
|
|
770
768
|
} | {
|
|
771
769
|
readonly _tag: "Busy";
|
|
770
|
+
} | {
|
|
771
|
+
readonly _tag: "ReauthorizationRequired";
|
|
772
772
|
} | {
|
|
773
773
|
readonly _tag: "Admitted";
|
|
774
774
|
readonly admissionId: string & import("effect/Brand").Brand<"effect-auth/OAuthClaimId">;
|
package/dist/DrizzleMysql2.d.mts
CHANGED
|
@@ -802,14 +802,14 @@ declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
|
|
|
802
802
|
};
|
|
803
803
|
}) => import("effect/Effect").Effect<{
|
|
804
804
|
readonly _tag: "Rejected";
|
|
805
|
-
} | {
|
|
806
|
-
readonly _tag: "Conflict";
|
|
807
805
|
} | {
|
|
808
806
|
readonly _tag: "Target";
|
|
809
807
|
readonly cohortGeneration: string & import("effect/Brand").Brand<"effect-auth/SecurityRevision">;
|
|
810
808
|
} | {
|
|
811
809
|
readonly _tag: "Quarantine";
|
|
812
810
|
readonly cohortGeneration: string & import("effect/Brand").Brand<"effect-auth/SecurityRevision">;
|
|
811
|
+
} | {
|
|
812
|
+
readonly _tag: "Conflict";
|
|
813
813
|
}, OAuthUnavailable>;
|
|
814
814
|
readonly settle: <A>(input: {
|
|
815
815
|
readonly claim: OAuthConnectedClaim;
|
package/dist/DrizzlePglite.d.mts
CHANGED
|
@@ -801,14 +801,14 @@ declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
|
|
|
801
801
|
};
|
|
802
802
|
}) => import("effect/Effect").Effect<{
|
|
803
803
|
readonly _tag: "Rejected";
|
|
804
|
-
} | {
|
|
805
|
-
readonly _tag: "Conflict";
|
|
806
804
|
} | {
|
|
807
805
|
readonly _tag: "Target";
|
|
808
806
|
readonly cohortGeneration: string & import("effect/Brand").Brand<"effect-auth/SecurityRevision">;
|
|
809
807
|
} | {
|
|
810
808
|
readonly _tag: "Quarantine";
|
|
811
809
|
readonly cohortGeneration: string & import("effect/Brand").Brand<"effect-auth/SecurityRevision">;
|
|
810
|
+
} | {
|
|
811
|
+
readonly _tag: "Conflict";
|
|
812
812
|
}, OAuthUnavailable>;
|
|
813
813
|
readonly settle: <A>(input: {
|
|
814
814
|
readonly claim: OAuthConnectedClaim;
|
|
@@ -221,11 +221,11 @@ declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
|
|
|
221
221
|
}, prepare: PrepareOAuthCommit<{
|
|
222
222
|
readonly _tag: "Rejected";
|
|
223
223
|
} | {
|
|
224
|
-
readonly _tag: "
|
|
224
|
+
readonly _tag: "Conflict";
|
|
225
225
|
} | {
|
|
226
226
|
readonly _tag: "Cancelled";
|
|
227
227
|
} | {
|
|
228
|
-
readonly _tag: "
|
|
228
|
+
readonly _tag: "Ambiguous";
|
|
229
229
|
} | {
|
|
230
230
|
readonly _tag: "Linked";
|
|
231
231
|
readonly credential: {
|
|
@@ -801,14 +801,14 @@ declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
|
|
|
801
801
|
};
|
|
802
802
|
}) => import("effect/Effect").Effect<{
|
|
803
803
|
readonly _tag: "Rejected";
|
|
804
|
-
} | {
|
|
805
|
-
readonly _tag: "Conflict";
|
|
806
804
|
} | {
|
|
807
805
|
readonly _tag: "Target";
|
|
808
806
|
readonly cohortGeneration: string & import("effect/Brand").Brand<"effect-auth/SecurityRevision">;
|
|
809
807
|
} | {
|
|
810
808
|
readonly _tag: "Quarantine";
|
|
811
809
|
readonly cohortGeneration: string & import("effect/Brand").Brand<"effect-auth/SecurityRevision">;
|
|
810
|
+
} | {
|
|
811
|
+
readonly _tag: "Conflict";
|
|
812
812
|
}, OAuthUnavailable>;
|
|
813
813
|
readonly settle: <A>(input: {
|
|
814
814
|
readonly claim: OAuthConnectedClaim;
|
|
@@ -818,11 +818,11 @@ declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
|
|
|
818
818
|
}, prepare: PrepareOAuthCommit<{
|
|
819
819
|
readonly _tag: "Rejected";
|
|
820
820
|
} | {
|
|
821
|
-
readonly _tag: "
|
|
821
|
+
readonly _tag: "Conflict";
|
|
822
822
|
} | {
|
|
823
823
|
readonly _tag: "Cancelled";
|
|
824
824
|
} | {
|
|
825
|
-
readonly _tag: "
|
|
825
|
+
readonly _tag: "Ambiguous";
|
|
826
826
|
} | {
|
|
827
827
|
readonly _tag: "Connected";
|
|
828
828
|
readonly grant: {
|
|
@@ -1007,14 +1007,14 @@ declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
|
|
|
1007
1007
|
readonly retentionUntilMillis: number;
|
|
1008
1008
|
}, prepare: PrepareOAuthCommit<{
|
|
1009
1009
|
readonly _tag: "Rejected";
|
|
1010
|
+
} | {
|
|
1011
|
+
readonly _tag: "Conflict";
|
|
1010
1012
|
} | {
|
|
1011
1013
|
readonly _tag: "Disconnected";
|
|
1012
1014
|
readonly grantId: string & import("effect/Brand").Brand<"effect-auth/OAuthGrantId">;
|
|
1013
1015
|
readonly remoteRevocation: "Confirmed" | "Pending" | "Unknown" | "Unsupported";
|
|
1014
1016
|
readonly affectedGrantCount: number;
|
|
1015
1017
|
readonly replayed: boolean;
|
|
1016
|
-
} | {
|
|
1017
|
-
readonly _tag: "Conflict";
|
|
1018
1018
|
}, A>) => import("effect/Effect").Effect<PreparedCommit<A>, OAuthUnavailable, never>;
|
|
1019
1019
|
readonly inspectAccess: (input: {
|
|
1020
1020
|
readonly authorization: OAuthConnectedUseAuthorization;
|
|
@@ -1022,8 +1022,6 @@ declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
|
|
|
1022
1022
|
readonly profileKey: string & import("effect/Brand").Brand<"effect-auth/OAuthPermissionProfileKey">;
|
|
1023
1023
|
}) => import("effect/Effect").Effect<{
|
|
1024
1024
|
readonly _tag: "Rejected";
|
|
1025
|
-
} | {
|
|
1026
|
-
readonly _tag: "ReauthorizationRequired";
|
|
1027
1025
|
} | {
|
|
1028
1026
|
readonly _tag: "Busy";
|
|
1029
1027
|
} | {
|
|
@@ -1087,6 +1085,8 @@ declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
|
|
|
1087
1085
|
readonly ciphertext: import("effect/Redacted").Redacted<string>;
|
|
1088
1086
|
};
|
|
1089
1087
|
};
|
|
1088
|
+
} | {
|
|
1089
|
+
readonly _tag: "ReauthorizationRequired";
|
|
1090
1090
|
}, OAuthUnavailable>;
|
|
1091
1091
|
readonly claimRefresh: <A>(input: {
|
|
1092
1092
|
readonly grant: OAuthConnectedStoredGrant;
|
|
@@ -1096,10 +1096,10 @@ declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
|
|
|
1096
1096
|
readonly lifetimeMillis: number;
|
|
1097
1097
|
}, prepare: PrepareOAuthCommit<{
|
|
1098
1098
|
readonly _tag: "Rejected";
|
|
1099
|
-
} | {
|
|
1100
|
-
readonly _tag: "ReauthorizationRequired";
|
|
1101
1099
|
} | {
|
|
1102
1100
|
readonly _tag: "Busy";
|
|
1101
|
+
} | {
|
|
1102
|
+
readonly _tag: "ReauthorizationRequired";
|
|
1103
1103
|
} | {
|
|
1104
1104
|
readonly _tag: "Claimed";
|
|
1105
1105
|
readonly claim: {
|
|
@@ -1245,10 +1245,10 @@ declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
|
|
|
1245
1245
|
readonly lifetimeMillis: number;
|
|
1246
1246
|
}, prepare: PrepareOAuthCommit<{
|
|
1247
1247
|
readonly _tag: "Rejected";
|
|
1248
|
-
} | {
|
|
1249
|
-
readonly _tag: "ReauthorizationRequired";
|
|
1250
1248
|
} | {
|
|
1251
1249
|
readonly _tag: "Busy";
|
|
1250
|
+
} | {
|
|
1251
|
+
readonly _tag: "ReauthorizationRequired";
|
|
1252
1252
|
} | {
|
|
1253
1253
|
readonly _tag: "Admitted";
|
|
1254
1254
|
readonly admissionId: string & import("effect/Brand").Brand<"effect-auth/OAuthClaimId">;
|
|
@@ -699,12 +699,12 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
699
699
|
readonly nowMillis: number;
|
|
700
700
|
}, prepare: PrepareOAuthCommit<{
|
|
701
701
|
readonly _tag: "Rejected";
|
|
702
|
+
} | {
|
|
703
|
+
readonly _tag: "Conflict";
|
|
702
704
|
} | {
|
|
703
705
|
readonly _tag: "Cancelled";
|
|
704
706
|
} | {
|
|
705
707
|
readonly _tag: "Ambiguous";
|
|
706
|
-
} | {
|
|
707
|
-
readonly _tag: "Conflict";
|
|
708
708
|
} | {
|
|
709
709
|
readonly _tag: "Linked";
|
|
710
710
|
readonly credential: {
|
|
@@ -781,8 +781,6 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
781
781
|
readonly _tag: "Rejected";
|
|
782
782
|
} | {
|
|
783
783
|
readonly _tag: "Conflict";
|
|
784
|
-
} | {
|
|
785
|
-
readonly _tag: "LastSignInMethod";
|
|
786
784
|
} | {
|
|
787
785
|
readonly _tag: "Unlinked";
|
|
788
786
|
readonly result: {
|
|
@@ -796,6 +794,8 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
796
794
|
};
|
|
797
795
|
};
|
|
798
796
|
readonly replayed: boolean;
|
|
797
|
+
} | {
|
|
798
|
+
readonly _tag: "LastSignInMethod";
|
|
799
799
|
}, A>) => import("effect/Effect").Effect<PreparedCommit<A>, OAuthUnavailable>;
|
|
800
800
|
readonly cleanup: <A>(input: OAuthCleanupInput, prepare: PrepareOAuthCommit<{
|
|
801
801
|
readonly terminalized: number;
|
|
@@ -1070,8 +1070,6 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1070
1070
|
readonly flow: OAuthConnectedPendingFlow;
|
|
1071
1071
|
readonly authorization: OAuthConnectedActionAuthorization;
|
|
1072
1072
|
}, prepare: PrepareOAuthCommit<{
|
|
1073
|
-
readonly _tag: "Rejected";
|
|
1074
|
-
} | {
|
|
1075
1073
|
readonly _tag: "Issued";
|
|
1076
1074
|
readonly flow: {
|
|
1077
1075
|
readonly context: {
|
|
@@ -1163,6 +1161,8 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1163
1161
|
};
|
|
1164
1162
|
readonly retentionUntilMillis: number;
|
|
1165
1163
|
};
|
|
1164
|
+
} | {
|
|
1165
|
+
readonly _tag: "Rejected";
|
|
1166
1166
|
}, A>) => import("effect/Effect").Effect<PreparedCommit<A>, OAuthUnavailable, never>;
|
|
1167
1167
|
readonly preflight: (input: OAuthConnectedAccess) => import("effect/Effect").Effect<OAuthConnectedPendingFlow | undefined, OAuthUnavailable>;
|
|
1168
1168
|
readonly claim: <A>(input: {
|
|
@@ -1296,12 +1296,12 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1296
1296
|
readonly nowMillis: number;
|
|
1297
1297
|
}, prepare: PrepareOAuthCommit<{
|
|
1298
1298
|
readonly _tag: "Rejected";
|
|
1299
|
+
} | {
|
|
1300
|
+
readonly _tag: "Conflict";
|
|
1299
1301
|
} | {
|
|
1300
1302
|
readonly _tag: "Cancelled";
|
|
1301
1303
|
} | {
|
|
1302
1304
|
readonly _tag: "Ambiguous";
|
|
1303
|
-
} | {
|
|
1304
|
-
readonly _tag: "Conflict";
|
|
1305
1305
|
} | {
|
|
1306
1306
|
readonly _tag: "Connected";
|
|
1307
1307
|
readonly grant: {
|
|
@@ -1280,14 +1280,14 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1280
1280
|
};
|
|
1281
1281
|
}) => import("effect/Effect").Effect<{
|
|
1282
1282
|
readonly _tag: "Rejected";
|
|
1283
|
-
} | {
|
|
1284
|
-
readonly _tag: "Conflict";
|
|
1285
1283
|
} | {
|
|
1286
1284
|
readonly _tag: "Target";
|
|
1287
1285
|
readonly cohortGeneration: string & import("effect/Brand").Brand<"effect-auth/SecurityRevision">;
|
|
1288
1286
|
} | {
|
|
1289
1287
|
readonly _tag: "Quarantine";
|
|
1290
1288
|
readonly cohortGeneration: string & import("effect/Brand").Brand<"effect-auth/SecurityRevision">;
|
|
1289
|
+
} | {
|
|
1290
|
+
readonly _tag: "Conflict";
|
|
1291
1291
|
}, OAuthUnavailable>;
|
|
1292
1292
|
readonly settle: <A>(input: {
|
|
1293
1293
|
readonly claim: OAuthConnectedClaim;
|
|
@@ -700,11 +700,11 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
700
700
|
}, prepare: PrepareOAuthCommit<{
|
|
701
701
|
readonly _tag: "Rejected";
|
|
702
702
|
} | {
|
|
703
|
-
readonly _tag: "
|
|
703
|
+
readonly _tag: "Conflict";
|
|
704
704
|
} | {
|
|
705
705
|
readonly _tag: "Cancelled";
|
|
706
706
|
} | {
|
|
707
|
-
readonly _tag: "
|
|
707
|
+
readonly _tag: "Ambiguous";
|
|
708
708
|
} | {
|
|
709
709
|
readonly _tag: "Linked";
|
|
710
710
|
readonly credential: {
|
|
@@ -1280,14 +1280,14 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1280
1280
|
};
|
|
1281
1281
|
}) => import("effect/Effect").Effect<{
|
|
1282
1282
|
readonly _tag: "Rejected";
|
|
1283
|
-
} | {
|
|
1284
|
-
readonly _tag: "Conflict";
|
|
1285
1283
|
} | {
|
|
1286
1284
|
readonly _tag: "Target";
|
|
1287
1285
|
readonly cohortGeneration: string & import("effect/Brand").Brand<"effect-auth/SecurityRevision">;
|
|
1288
1286
|
} | {
|
|
1289
1287
|
readonly _tag: "Quarantine";
|
|
1290
1288
|
readonly cohortGeneration: string & import("effect/Brand").Brand<"effect-auth/SecurityRevision">;
|
|
1289
|
+
} | {
|
|
1290
|
+
readonly _tag: "Conflict";
|
|
1291
1291
|
}, OAuthUnavailable>;
|
|
1292
1292
|
readonly settle: <A>(input: {
|
|
1293
1293
|
readonly claim: OAuthConnectedClaim;
|
|
@@ -1297,11 +1297,11 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1297
1297
|
}, prepare: PrepareOAuthCommit<{
|
|
1298
1298
|
readonly _tag: "Rejected";
|
|
1299
1299
|
} | {
|
|
1300
|
-
readonly _tag: "
|
|
1300
|
+
readonly _tag: "Conflict";
|
|
1301
1301
|
} | {
|
|
1302
1302
|
readonly _tag: "Cancelled";
|
|
1303
1303
|
} | {
|
|
1304
|
-
readonly _tag: "
|
|
1304
|
+
readonly _tag: "Ambiguous";
|
|
1305
1305
|
} | {
|
|
1306
1306
|
readonly _tag: "Connected";
|
|
1307
1307
|
readonly grant: {
|
|
@@ -1486,14 +1486,14 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1486
1486
|
readonly retentionUntilMillis: number;
|
|
1487
1487
|
}, prepare: PrepareOAuthCommit<{
|
|
1488
1488
|
readonly _tag: "Rejected";
|
|
1489
|
+
} | {
|
|
1490
|
+
readonly _tag: "Conflict";
|
|
1489
1491
|
} | {
|
|
1490
1492
|
readonly _tag: "Disconnected";
|
|
1491
1493
|
readonly grantId: string & import("effect/Brand").Brand<"effect-auth/OAuthGrantId">;
|
|
1492
1494
|
readonly remoteRevocation: "Confirmed" | "Pending" | "Unknown" | "Unsupported";
|
|
1493
1495
|
readonly affectedGrantCount: number;
|
|
1494
1496
|
readonly replayed: boolean;
|
|
1495
|
-
} | {
|
|
1496
|
-
readonly _tag: "Conflict";
|
|
1497
1497
|
}, A>) => import("effect/Effect").Effect<PreparedCommit<A>, OAuthUnavailable, never>;
|
|
1498
1498
|
readonly inspectAccess: (input: {
|
|
1499
1499
|
readonly authorization: OAuthConnectedUseAuthorization;
|
|
@@ -1501,8 +1501,6 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1501
1501
|
readonly profileKey: string & import("effect/Brand").Brand<"effect-auth/OAuthPermissionProfileKey">;
|
|
1502
1502
|
}) => import("effect/Effect").Effect<{
|
|
1503
1503
|
readonly _tag: "Rejected";
|
|
1504
|
-
} | {
|
|
1505
|
-
readonly _tag: "ReauthorizationRequired";
|
|
1506
1504
|
} | {
|
|
1507
1505
|
readonly _tag: "Busy";
|
|
1508
1506
|
} | {
|
|
@@ -1566,6 +1564,8 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1566
1564
|
readonly ciphertext: import("effect/Redacted").Redacted<string>;
|
|
1567
1565
|
};
|
|
1568
1566
|
};
|
|
1567
|
+
} | {
|
|
1568
|
+
readonly _tag: "ReauthorizationRequired";
|
|
1569
1569
|
}, OAuthUnavailable>;
|
|
1570
1570
|
readonly claimRefresh: <A>(input: {
|
|
1571
1571
|
readonly grant: OAuthConnectedStoredGrant;
|
|
@@ -1575,10 +1575,10 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1575
1575
|
readonly lifetimeMillis: number;
|
|
1576
1576
|
}, prepare: PrepareOAuthCommit<{
|
|
1577
1577
|
readonly _tag: "Rejected";
|
|
1578
|
-
} | {
|
|
1579
|
-
readonly _tag: "ReauthorizationRequired";
|
|
1580
1578
|
} | {
|
|
1581
1579
|
readonly _tag: "Busy";
|
|
1580
|
+
} | {
|
|
1581
|
+
readonly _tag: "ReauthorizationRequired";
|
|
1582
1582
|
} | {
|
|
1583
1583
|
readonly _tag: "Claimed";
|
|
1584
1584
|
readonly claim: {
|
|
@@ -1724,10 +1724,10 @@ declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1724
1724
|
readonly lifetimeMillis: number;
|
|
1725
1725
|
}, prepare: PrepareOAuthCommit<{
|
|
1726
1726
|
readonly _tag: "Rejected";
|
|
1727
|
-
} | {
|
|
1728
|
-
readonly _tag: "ReauthorizationRequired";
|
|
1729
1727
|
} | {
|
|
1730
1728
|
readonly _tag: "Busy";
|
|
1729
|
+
} | {
|
|
1730
|
+
readonly _tag: "ReauthorizationRequired";
|
|
1731
1731
|
} | {
|
|
1732
1732
|
readonly _tag: "Admitted";
|
|
1733
1733
|
readonly admissionId: string & import("effect/Brand").Brand<"effect-auth/OAuthClaimId">;
|
package/dist/GitHub.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OpenIdClientConfigurationError } from "./oauth/openid-client/models.mjs";
|
|
2
2
|
import { GitHubOAuthAppConnectedProtocolOptions, GitHubOAuthAppGeneration, GitHubOAuthAppProtocolOptions } from "./oauth/github/models.mjs";
|
|
3
|
-
import { gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol } from "./oauth/github/protocol.mjs";
|
|
3
|
+
import { gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, gitHubOAuthAppProvider, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol } from "./oauth/github/protocol.mjs";
|
|
4
4
|
import { gitHubOAuthAppProviderKey } from "./oauth/github/identity.mjs";
|
|
5
|
-
export { type GitHubOAuthAppConnectedProtocolOptions, type GitHubOAuthAppGeneration, type GitHubOAuthAppProtocolOptions, OpenIdClientConfigurationError, gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, gitHubOAuthAppProviderKey, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol };
|
|
5
|
+
export { type GitHubOAuthAppConnectedProtocolOptions, type GitHubOAuthAppGeneration, type GitHubOAuthAppProtocolOptions, OpenIdClientConfigurationError, gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, gitHubOAuthAppProvider, gitHubOAuthAppProviderKey, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol };
|
package/dist/GitHub.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { OpenIdClientConfigurationError } from "./oauth/openid-client/models.mjs";
|
|
2
2
|
import { gitHubOAuthAppProviderKey } from "./oauth/github/identity.mjs";
|
|
3
|
-
import { gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol } from "./oauth/github/protocol.mjs";
|
|
4
|
-
export { OpenIdClientConfigurationError, gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, gitHubOAuthAppProviderKey, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol };
|
|
3
|
+
import { gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, gitHubOAuthAppProvider, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol } from "./oauth/github/protocol.mjs";
|
|
4
|
+
export { OpenIdClientConfigurationError, gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, gitHubOAuthAppProvider, gitHubOAuthAppProviderKey, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpenIdClientAuthentication, OpenIdClientConfigurationError, PlainOAuthIdentity } from "./oauth/openid-client/models.mjs";
|
|
2
1
|
import { OpenIdClientConnectedOAuthProvider, OpenIdClientConnectedOidcProvider, OpenIdClientConnectedProtocolOptions, OpenIdClientConnectedRefreshExpiry, OpenIdClientConnectedRevocation } from "./oauth/openid-client/connected/models.mjs";
|
|
2
|
+
import { OpenIdClientAuthentication, OpenIdClientConfigurationError, PlainOAuthIdentity } from "./oauth/openid-client/models.mjs";
|
|
3
3
|
import { makeOpenIdClientConnectedProtocol, openIdClientConnectedProtocolLayer } from "./oauth/openid-client/connected/protocol.mjs";
|
|
4
4
|
export { type OpenIdClientAuthentication, OpenIdClientConfigurationError, type OpenIdClientConnectedOAuthProvider, type OpenIdClientConnectedOidcProvider, type OpenIdClientConnectedProtocolOptions, type OpenIdClientConnectedRefreshExpiry, type OpenIdClientConnectedRevocation, type PlainOAuthIdentity, makeOpenIdClientConnectedProtocol, openIdClientConnectedProtocolLayer };
|
|
@@ -147,12 +147,12 @@ declare const makeD1OAuthAccountsServices: <S extends SQLiteTable, O extends SQL
|
|
|
147
147
|
readonly nowMillis: number;
|
|
148
148
|
}, prepare: PrepareOAuthCommit<{
|
|
149
149
|
readonly _tag: "Rejected";
|
|
150
|
+
} | {
|
|
151
|
+
readonly _tag: "Conflict";
|
|
150
152
|
} | {
|
|
151
153
|
readonly _tag: "Cancelled";
|
|
152
154
|
} | {
|
|
153
155
|
readonly _tag: "Ambiguous";
|
|
154
|
-
} | {
|
|
155
|
-
readonly _tag: "Conflict";
|
|
156
156
|
} | {
|
|
157
157
|
readonly _tag: "Linked";
|
|
158
158
|
readonly credential: {
|
|
@@ -229,8 +229,6 @@ declare const makeD1OAuthAccountsServices: <S extends SQLiteTable, O extends SQL
|
|
|
229
229
|
readonly _tag: "Rejected";
|
|
230
230
|
} | {
|
|
231
231
|
readonly _tag: "Conflict";
|
|
232
|
-
} | {
|
|
233
|
-
readonly _tag: "LastSignInMethod";
|
|
234
232
|
} | {
|
|
235
233
|
readonly _tag: "Unlinked";
|
|
236
234
|
readonly result: {
|
|
@@ -244,6 +242,8 @@ declare const makeD1OAuthAccountsServices: <S extends SQLiteTable, O extends SQL
|
|
|
244
242
|
};
|
|
245
243
|
};
|
|
246
244
|
readonly replayed: boolean;
|
|
245
|
+
} | {
|
|
246
|
+
readonly _tag: "LastSignInMethod";
|
|
247
247
|
}, A>) => Effect.Effect<PreparedCommit<A>, OAuthUnavailable>;
|
|
248
248
|
readonly cleanup: <A>(input: OAuthCleanupInput, prepare: PrepareOAuthCommit<{
|
|
249
249
|
readonly terminalized: number;
|
|
@@ -6,10 +6,14 @@ import { OAuthCallbackId, OAuthCodeResponse, OAuthProtocolConfiguration, OAuthPr
|
|
|
6
6
|
import { OAuthConnectedConfiguration, OAuthConnectedGrantResponse, OAuthConnectedProfile, OAuthConnectedTokenContext, OAuthConnectedTokenMaterial } from "../connectedModels.mjs";
|
|
7
7
|
import { OAuthConnectedProtocol } from "../OAuthConnectedProtocol.mjs";
|
|
8
8
|
import { OAuthProtocol } from "../OAuthProtocol.mjs";
|
|
9
|
-
import { OpenIdClientConfigurationError } from "../openid-client/models.mjs";
|
|
10
|
-
import { GitHubOAuthAppConnectedProtocolOptions, GitHubOAuthAppProtocolOptions } from "./models.mjs";
|
|
9
|
+
import { OpenIdClientConfigurationError, OpenIdClientOAuthProvider } from "../openid-client/models.mjs";
|
|
10
|
+
import { GitHubOAuthAppConnectedProtocolOptions, GitHubOAuthAppGeneration, GitHubOAuthAppProtocolOptions } from "./models.mjs";
|
|
11
11
|
import { Effect, Layer } from "effect";
|
|
12
12
|
//#region src/oauth/github/protocol.d.ts
|
|
13
|
+
/** A GitHub.com OAuth App generation for the same provider list as generic OIDC.
|
|
14
|
+
* Retains GitHub receipt/error rules and requests read:user, with no repository access.
|
|
15
|
+
* Construction performs no I/O; invalid configuration throws the typed configuration error. */
|
|
16
|
+
declare const gitHubOAuthAppProvider: (registration: GitHubOAuthAppGeneration) => OpenIdClientOAuthProvider;
|
|
13
17
|
declare const makeGitHubOAuthAppProtocol: (options: GitHubOAuthAppProtocolOptions) => Effect.Effect<{
|
|
14
18
|
readonly prepareAuthorization: (input: {
|
|
15
19
|
readonly provider: OAuthProviderKey;
|
|
@@ -50,5 +54,5 @@ declare const makeGitHubOAuthAppConnectedProtocol: (options: GitHubOAuthAppConne
|
|
|
50
54
|
declare const gitHubOAuthAppProtocolLayer: (options: GitHubOAuthAppProtocolOptions) => Layer.Layer<OAuthProtocol, OAuthUnavailable | OpenIdClientConfigurationError, never>;
|
|
51
55
|
declare const gitHubOAuthAppConnectedProtocolLayer: (options: GitHubOAuthAppConnectedProtocolOptions) => Layer.Layer<OAuthConnectedProtocol, OAuthUnavailable | OpenIdClientConfigurationError, never>;
|
|
52
56
|
//#endregion
|
|
53
|
-
export { gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol };
|
|
57
|
+
export { gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, gitHubOAuthAppProvider, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol };
|
|
54
58
|
//# sourceMappingURL=protocol.d.mts.map
|
|
@@ -5,9 +5,9 @@ import { OAuthConnectedProfile } from "../connectedModels.mjs";
|
|
|
5
5
|
import { OAuthConnectedProtocol } from "../OAuthConnectedProtocol.mjs";
|
|
6
6
|
import { OAuthProtocol } from "../OAuthProtocol.mjs";
|
|
7
7
|
import { OpenIdClientConfigurationError } from "../openid-client/models.mjs";
|
|
8
|
-
import { DefiniteTokenRejection } from "../openid-client/compatibility.mjs";
|
|
8
|
+
import { DefiniteTokenRejection, tokenCompatibility } from "../openid-client/compatibility.mjs";
|
|
9
9
|
import { boundedFetch } from "../openid-client/transport.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import { makeOpenIdClientOAuthProtocol } from "../openid-client/protocol.mjs";
|
|
11
11
|
import { ProviderRevocation } from "../openid-client/ProviderRevocation.mjs";
|
|
12
12
|
import { makeConnectedProtocolWithCompatibility } from "../openid-client/connected/protocol.mjs";
|
|
13
13
|
import { decodeGitHubIdentity, gitHubOAuthAppProviderKey } from "./identity.mjs";
|
|
@@ -166,16 +166,29 @@ const revocationLayer = (options) => {
|
|
|
166
166
|
});
|
|
167
167
|
}) }));
|
|
168
168
|
};
|
|
169
|
+
/** A GitHub.com OAuth App generation for the same provider list as generic OIDC.
|
|
170
|
+
* Retains GitHub receipt/error rules and requests read:user, with no repository access.
|
|
171
|
+
* Construction performs no I/O; invalid configuration throws the typed configuration error. */
|
|
172
|
+
const gitHubOAuthAppProvider = (registration) => {
|
|
173
|
+
let saved;
|
|
174
|
+
try {
|
|
175
|
+
saved = snapshotOAuthSync(generation, registration);
|
|
176
|
+
} catch {
|
|
177
|
+
throw invalid();
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
...provider(saved),
|
|
181
|
+
scopes: ["read:user"],
|
|
182
|
+
[tokenCompatibility]: compatibility
|
|
183
|
+
};
|
|
184
|
+
};
|
|
169
185
|
const makeGitHubOAuthAppProtocol = Effect.fn("makeGitHubOAuthAppProtocol")(function* (options) {
|
|
170
186
|
const saved = yield* capture(generations, options.registrations, options);
|
|
171
187
|
if (saved.registrations.filter((item) => item.issuance === "active").length !== 1) return yield* invalid();
|
|
172
|
-
return yield*
|
|
188
|
+
return yield* makeOpenIdClientOAuthProtocol({
|
|
173
189
|
...saved,
|
|
174
|
-
providers: saved.registrations.map(
|
|
175
|
-
|
|
176
|
-
scopes: ["read:user"]
|
|
177
|
-
}))
|
|
178
|
-
}, compatibility);
|
|
190
|
+
providers: saved.registrations.map(gitHubOAuthAppProvider)
|
|
191
|
+
});
|
|
179
192
|
});
|
|
180
193
|
const makeGitHubOAuthAppConnectedProtocol = Effect.fn("makeGitHubOAuthAppConnectedProtocol")(function* (options) {
|
|
181
194
|
const saved = yield* capture(connectedGenerations, options.registrations, options);
|
|
@@ -199,6 +212,6 @@ const makeGitHubOAuthAppConnectedProtocol = Effect.fn("makeGitHubOAuthAppConnect
|
|
|
199
212
|
const gitHubOAuthAppProtocolLayer = (options) => Layer.effect(OAuthProtocol, makeGitHubOAuthAppProtocol(options));
|
|
200
213
|
const gitHubOAuthAppConnectedProtocolLayer = (options) => Layer.effect(OAuthConnectedProtocol, makeGitHubOAuthAppConnectedProtocol(options));
|
|
201
214
|
//#endregion
|
|
202
|
-
export { gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol };
|
|
215
|
+
export { gitHubOAuthAppConnectedProtocolLayer, gitHubOAuthAppProtocolLayer, gitHubOAuthAppProvider, makeGitHubOAuthAppConnectedProtocol, makeGitHubOAuthAppProtocol };
|
|
203
216
|
|
|
204
217
|
//# sourceMappingURL=protocol.mjs.map
|