@absolutejs/auth 0.56.1 → 0.56.2

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.
@@ -122,8 +122,9 @@ export declare const exchangeToken: <UserType>({ actorClientId, audience, config
122
122
  requestedScopes?: string[];
123
123
  subjectToken: string;
124
124
  }) => Promise<TokenExchangeResult>;
125
- export declare const issueTokenSet: <UserType>({ acr, claims, clientCertThumbprint, clientId, config, dpopJkt, nonce, now, scopes, sub }: {
125
+ export declare const issueTokenSet: <UserType>({ acr, audience, claims, clientCertThumbprint, clientId, config, dpopJkt, nonce, now, scopes, sub }: {
126
126
  acr?: string;
127
+ audience?: string;
127
128
  claims?: Record<string, unknown>;
128
129
  clientCertThumbprint?: string;
129
130
  clientId: string;
@@ -10958,6 +10958,28 @@ var createNeonDatabase = (databaseUrl) => drizzle({ client: as(databaseUrl) });
10958
10958
  var URL_LENGTH = 2048;
10959
10959
  var DEFAULT_LIST_LIMIT = 100;
10960
10960
  var ID_LENGTH = 255;
10961
+ var BACKCHANNEL_AUTH_STATUSES = new Set([
10962
+ "approved",
10963
+ "denied",
10964
+ "pending"
10965
+ ]);
10966
+ var DEVICE_AUTHORIZATION_STATUSES = new Set([
10967
+ "approved",
10968
+ "denied",
10969
+ "pending"
10970
+ ]);
10971
+ var backchannelAuthStatus = (value) => {
10972
+ for (const status of BACKCHANNEL_AUTH_STATUSES)
10973
+ if (status === value)
10974
+ return status;
10975
+ throw new Error(`Invalid persisted backchannel authorization status: ${value}`);
10976
+ };
10977
+ var deviceAuthorizationStatus = (value) => {
10978
+ for (const status of DEVICE_AUTHORIZATION_STATUSES)
10979
+ if (status === value)
10980
+ return status;
10981
+ throw new Error(`Invalid persisted device authorization status: ${value}`);
10982
+ };
10961
10983
  var oauthBackchannelAuthRequestsTable = pgTable("auth_oauth_backchannel_auth_requests", {
10962
10984
  auth_req_id: varchar("auth_req_id", { length: ID_LENGTH }).primaryKey(),
10963
10985
  binding_message: text("binding_message"),
@@ -11002,6 +11024,7 @@ var oauthClientsTable = pgTable("auth_oauth_clients", {
11002
11024
  });
11003
11025
  var oauthCodesTable = pgTable("auth_oauth_codes", {
11004
11026
  acr: varchar("acr", { length: ID_LENGTH }),
11027
+ audience: varchar("audience", { length: URL_LENGTH }),
11005
11028
  claims_json: jsonb("claims_json").$type(),
11006
11029
  client_id: varchar("client_id", { length: ID_LENGTH }).notNull(),
11007
11030
  code_challenge: varchar("code_challenge", { length: ID_LENGTH }).notNull(),
@@ -11054,6 +11077,7 @@ var oauthPushedAuthorizationRequestsTable = pgTable("auth_oauth_pushed_authoriza
11054
11077
  });
11055
11078
  var oauthRefreshTokensTable = pgTable("auth_oauth_refresh_tokens", {
11056
11079
  acr: varchar("acr", { length: ID_LENGTH }),
11080
+ audience: varchar("audience", { length: URL_LENGTH }),
11057
11081
  claims_json: jsonb("claims_json").$type(),
11058
11082
  client_id: varchar("client_id", { length: ID_LENGTH }).notNull(),
11059
11083
  created_at_ms: bigint("created_at_ms", { mode: "number" }).notNull(),
@@ -11089,6 +11113,7 @@ var toLogoutDelivery = (row) => ({
11089
11113
  });
11090
11114
  var toCode = (row) => ({
11091
11115
  acr: row.acr ?? undefined,
11116
+ audience: row.audience ?? undefined,
11092
11117
  claims: row.claims_json ?? undefined,
11093
11118
  clientId: row.client_id,
11094
11119
  codeChallenge: row.code_challenge,
@@ -11103,6 +11128,7 @@ var toCode = (row) => ({
11103
11128
  });
11104
11129
  var toCodeValues = (code) => ({
11105
11130
  acr: code.acr ?? null,
11131
+ audience: code.audience ?? null,
11106
11132
  claims_json: code.claims ?? null,
11107
11133
  client_id: code.clientId,
11108
11134
  code_challenge: code.codeChallenge,
@@ -11122,12 +11148,13 @@ var toDeviceAuth = (row) => ({
11122
11148
  expiresAt: row.expires_at_ms,
11123
11149
  intervalSeconds: row.interval_seconds,
11124
11150
  scopes: row.scopes,
11125
- status: row.status,
11151
+ status: deviceAuthorizationStatus(row.status),
11126
11152
  userCode: row.user_code,
11127
11153
  userSub: row.user_sub ?? undefined
11128
11154
  });
11129
11155
  var toRefresh = (row) => ({
11130
11156
  acr: row.acr ?? undefined,
11157
+ audience: row.audience ?? undefined,
11131
11158
  claims: row.claims_json ?? undefined,
11132
11159
  clientId: row.client_id,
11133
11160
  createdAt: row.created_at_ms,
@@ -11139,6 +11166,7 @@ var toRefresh = (row) => ({
11139
11166
  });
11140
11167
  var toRefreshValues = (token) => ({
11141
11168
  acr: token.acr ?? null,
11169
+ audience: token.audience ?? null,
11142
11170
  claims_json: token.claims ?? null,
11143
11171
  client_id: token.clientId,
11144
11172
  created_at_ms: token.createdAt,
@@ -11350,7 +11378,7 @@ var toBackchannelAuth = (row) => ({
11350
11378
  intervalSeconds: row.interval_seconds,
11351
11379
  lastPolledAt: row.last_polled_at_ms ?? undefined,
11352
11380
  scopes: row.scopes,
11353
- status: row.status,
11381
+ status: backchannelAuthStatus(row.status),
11354
11382
  userSub: row.user_sub ?? undefined
11355
11383
  });
11356
11384
  var createNeonBackchannelAuthStore = (databaseUrl) => createPostgresBackchannelAuthStore(createNeonDatabase(databaseUrl));
@@ -11405,5 +11433,5 @@ export {
11405
11433
  createNeonAuthorizationCodeStore
11406
11434
  };
11407
11435
 
11408
- //# debugId=B38CEA1B4DA2B52E64756E2164756E21
11436
+ //# debugId=C8DC7BB4A79E9FC364756E2164756E21
11409
11437
  //# sourceMappingURL=index.js.map