carddb 0.4.2 → 0.4.5

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.
@@ -1961,91 +1961,12 @@ module CardDB
1961
1961
  def updated_at = parse_time(data['updatedAt'])
1962
1962
  end
1963
1963
 
1964
- # Wrapper for deck preview token metadata
1965
- class DeckPreviewToken < Resource
1966
- def id
1967
- data['id']
1968
- end
1969
-
1970
- def deck_id
1971
- data['deckId']
1972
- end
1973
-
1974
- def label
1975
- data['label']
1976
- end
1977
-
1978
- def expires_at
1979
- parse_time(data['expiresAt'])
1980
- end
1981
-
1982
- def revoked_at
1983
- parse_time(data['revokedAt'])
1984
- end
1985
-
1986
- def last_used_at
1987
- parse_time(data['lastUsedAt'])
1988
- end
1989
-
1990
- def created_at
1991
- parse_time(data['createdAt'])
1992
- end
1993
-
1994
- def updated_at
1995
- parse_time(data['updatedAt'])
1996
- end
1997
-
1998
- private
1999
-
2000
- def parse_time(value)
2001
- return nil unless value
2002
-
2003
- Time.parse(value)
2004
- rescue ArgumentError
2005
- value
2006
- end
2007
- end
2008
-
2009
- # Wrapper for deck preview token creation payloads
2010
- class DeckPreviewTokenCreatePayload < Resource
2011
- def token
2012
- data['token']
2013
- end
2014
-
2015
- def preview_token
2016
- @preview_token ||= data['previewToken'] ? DeckPreviewToken.new(data['previewToken'], client: client) : nil
2017
- end
2018
- end
2019
-
2020
- class DeckEmbedToken < Resource
1964
+ class DeckTokenIssuer < Resource
2021
1965
  def id = data['id']
2022
- def deck_id = data['deckId']
2023
1966
  def api_application_id = data['apiApplicationId']
2024
1967
  def label = data['label']
2025
- def read_mode = data['readMode']
2026
- def allowed_origins = data['allowedOrigins'] || []
2027
- def external_subject = data['externalSubject']
2028
- def expires_at = parse_time(data['expiresAt'])
2029
- def revoked_at = parse_time(data['revokedAt'])
2030
- def last_used_at = parse_time(data['lastUsedAt'])
2031
- def created_at = parse_time(data['createdAt'])
2032
- def updated_at = parse_time(data['updatedAt'])
2033
- end
2034
-
2035
- class DeckEmbedTokenCreatePayload < Resource
2036
- def token = data['token']
2037
-
2038
- def embed_token
2039
- @embed_token ||= data['embedToken'] ? DeckEmbedToken.new(data['embedToken'], client: client) : nil
2040
- end
2041
- end
2042
-
2043
- class DeckAccessTokenIssuer < Resource
2044
- def id = data['id']
2045
- def deck_id = data['deckId']
2046
- def api_application_id = data['apiApplicationId']
2047
- def label = data['label']
2048
- def read_modes = data['readModes'] || []
1968
+ def allowed_scopes = data['allowedScopes'] || []
1969
+ def allowed_representations = data['allowedRepresentations'] || []
2049
1970
  def max_token_lifetime_seconds = data['maxTokenLifetimeSeconds']
2050
1971
  def direct_signing_alg = data['directSigningAlg']
2051
1972
  def direct_signing_key_id = data['directSigningKeyId']
@@ -2056,36 +1977,15 @@ module CardDB
2056
1977
  def updated_at = parse_time(data['updatedAt'])
2057
1978
  end
2058
1979
 
2059
- class DeckAccessToken < Resource
1980
+ class DeckToken < Resource
2060
1981
  def id = data['id']
2061
- def deck_id = data['deckId']
2062
1982
  def api_application_id = data['apiApplicationId']
2063
1983
  def issuer_id = data['issuerId']
2064
- def read_mode = data['readMode']
2065
- def external_subject = data['externalSubject']
2066
- def expires_at = parse_time(data['expiresAt'])
2067
- def revoked_at = parse_time(data['revokedAt'])
2068
- def last_used_at = parse_time(data['lastUsedAt'])
2069
- def created_at = parse_time(data['createdAt'])
2070
- def updated_at = parse_time(data['updatedAt'])
2071
- end
2072
-
2073
- class DeckAccessTokenExchangePayload < Resource
2074
- def token = data['token']
2075
-
2076
- def access_token
2077
- @access_token ||= data['accessToken'] ? DeckAccessToken.new(data['accessToken'], client: client) : nil
2078
- end
2079
- end
2080
-
2081
- class DeckSessionToken < Resource
2082
- def id = data['id']
2083
- def account_id = data['accountId']
2084
- def api_application_id = data['apiApplicationId']
1984
+ def deck_id = data['deckId']
2085
1985
  def game_id = data['gameId']
2086
- def environment = data['environment']
2087
1986
  def external_subject = data['externalSubject']
2088
1987
  def scopes = data['scopes'] || []
1988
+ def representation = data['representation']
2089
1989
  def expires_at = parse_time(data['expiresAt'])
2090
1990
  def revoked_at = parse_time(data['revokedAt'])
2091
1991
  def last_used_at = parse_time(data['lastUsedAt'])
@@ -2093,11 +1993,11 @@ module CardDB
2093
1993
  def updated_at = parse_time(data['updatedAt'])
2094
1994
  end
2095
1995
 
2096
- class DeckSessionTokenExchangePayload < Resource
1996
+ class DeckTokenExchangePayload < Resource
2097
1997
  def token = data['token']
2098
1998
 
2099
- def session_token
2100
- @session_token ||= data['sessionToken'] ? DeckSessionToken.new(data['sessionToken'], client: client) : nil
1999
+ def deck_token
2000
+ @deck_token ||= data['deckToken'] ? DeckToken.new(data['deckToken'], client: client) : nil
2101
2001
  end
2102
2002
  end
2103
2003
 
@@ -6,25 +6,19 @@ require 'json'
6
6
  require 'openssl'
7
7
 
8
8
  module CardDB
9
- # Server-side helpers for minting direct signed deck access tokens.
9
+ # Server-side helpers for minting direct signed deck tokens.
10
10
  module DeckTokens
11
- TOKEN_USE = 'carddb.deck_access.v1'
12
- AUDIENCE = 'carddb.deck_access'
11
+ TOKEN_USE = 'carddb.deck_token.v1'
12
+ AUDIENCE = 'carddb.deck'
13
13
  ED25519_PKCS8_PREFIX = [
14
14
  '302e020100300506032b657004220420'
15
15
  ].pack('H*').freeze
16
- READ_MODES = {
17
- 'PUBLIC' => 'public',
18
- 'EMBED' => 'embed',
19
- 'FULL' => 'full'
20
- }.freeze
21
- private_constant :READ_MODES
22
16
 
23
17
  class << self
24
- # Generate an Ed25519 keypair for CardDB direct deck access token signing.
18
+ # Generate an Ed25519 keypair for CardDB direct deck token signing.
25
19
  #
26
20
  # @return [Hash{Symbol => String}] Includes a PEM private key and the base64-encoded raw public key
27
- def generate_direct_access_key_pair
21
+ def generate_direct_key_pair
28
22
  signing_key = Ed25519::SigningKey.generate
29
23
 
30
24
  {
@@ -33,43 +27,31 @@ module CardDB
33
27
  }
34
28
  end
35
29
 
36
- # Sign a direct deck access token that CardDB can verify with the issuer public key.
30
+ # Sign a direct deck token that CardDB can verify with the issuer public key.
37
31
  #
38
32
  # @param issuer_id [String]
39
- # @param deck_id [String]
40
33
  # @param api_application_id [String]
41
34
  # @param key_id [String]
42
35
  # @param private_key [OpenSSL::PKey::PKey, String] Ed25519 private key as an OpenSSL key or PEM/DER string
43
- # @param read_mode [String] PUBLIC, EMBED, or FULL
36
+ # @param deck_id [String, nil]
37
+ # @param publisher_slug [String, nil]
38
+ # @param game_key [String, nil]
39
+ # @param external_subject [String, nil]
40
+ # @param scopes [Array<String>]
41
+ # @param representation [String, nil]
44
42
  # @param subject [String, nil]
45
43
  # @param token_id [String, nil]
46
44
  # @param issued_at [Time]
47
45
  # @param expires_at [Time]
48
46
  # @return [String]
49
47
  # @raise [ArgumentError]
50
- def sign_direct_access_token(issuer_id:, deck_id:, api_application_id:, key_id:, private_key:, read_mode:,
51
- expires_at:, subject: nil, token_id: nil, issued_at: Time.now)
52
- issued_at, expires_at = validate_signing_input!(
53
- issuer_id: issuer_id,
54
- deck_id: deck_id,
55
- api_application_id: api_application_id,
56
- key_id: key_id,
57
- issued_at: issued_at,
58
- expires_at: expires_at
59
- )
60
- normalized_read_mode = normalize_read_mode!(read_mode)
61
- key = normalize_private_key!(private_key)
62
- header = { alg: 'EdDSA', kid: key_id.strip }
63
- payload = build_payload(
64
- issuer_id: issuer_id,
65
- deck_id: deck_id,
66
- api_application_id: api_application_id,
67
- read_mode: normalized_read_mode,
68
- subject: subject,
69
- token_id: token_id,
70
- issued_at: issued_at,
71
- expires_at: expires_at
72
- )
48
+ def sign_direct_token(**attributes)
49
+ attributes = validate_signing_input!(attributes)
50
+ normalized_scopes = normalize_scopes!(attributes[:scopes])
51
+ validate_token_target!(attributes)
52
+ key = normalize_private_key!(attributes[:private_key])
53
+ header = { alg: 'EdDSA', kid: attributes[:key_id].strip }
54
+ payload = build_payload(attributes.merge(scopes: normalized_scopes))
73
55
 
74
56
  encoded_header = base64url_encode(JSON.generate(header))
75
57
  encoded_payload = base64url_encode(JSON.generate(payload))
@@ -81,33 +63,52 @@ module CardDB
81
63
 
82
64
  private
83
65
 
84
- def validate_signing_input!(issuer_id:, deck_id:, api_application_id:, key_id:, issued_at:, expires_at:)
85
- validate_required_string!(issuer_id, 'issuer_id')
86
- validate_required_string!(deck_id, 'deck_id')
87
- validate_required_string!(api_application_id, 'api_application_id')
88
- validate_required_string!(key_id, 'key_id')
66
+ def validate_signing_input!(attributes)
67
+ validate_known_keys!(attributes)
68
+ attributes = { issued_at: Time.now }.merge(attributes)
69
+ validate_required_string!(attributes[:issuer_id], 'issuer_id')
70
+ validate_required_string!(attributes[:api_application_id], 'api_application_id')
71
+ validate_required_string!(attributes[:key_id], 'key_id')
89
72
 
90
- issued_at = normalize_time!(issued_at, 'issued_at')
91
- expires_at = normalize_time!(expires_at, 'expires_at')
73
+ issued_at = normalize_time!(attributes[:issued_at], 'issued_at')
74
+ expires_at = normalize_time!(attributes[:expires_at], 'expires_at')
92
75
  raise ArgumentError, 'expires_at must be after issued_at' unless expires_at > issued_at
93
76
 
94
- [issued_at, expires_at]
77
+ attributes.merge(issued_at: issued_at, expires_at: expires_at)
95
78
  end
96
79
 
97
- def build_payload(issuer_id:, deck_id:, api_application_id:, read_mode:, subject:, token_id:, issued_at:,
98
- expires_at:)
80
+ def validate_known_keys!(attributes)
81
+ allowed_keys = %i[
82
+ issuer_id api_application_id key_id private_key scopes expires_at deck_id publisher_slug game_key
83
+ external_subject representation subject token_id issued_at
84
+ ]
85
+ unknown_keys = attributes.keys - allowed_keys
86
+ return if unknown_keys.empty?
87
+
88
+ raise ArgumentError, "unknown keyword: :#{unknown_keys.first}"
89
+ end
90
+
91
+ def build_payload(attributes)
99
92
  payload = {
100
93
  token_use: TOKEN_USE,
101
- deck_id: deck_id.strip,
102
- app_id: api_application_id.strip,
103
- read_mode: read_mode,
104
- iss: issuer_id.strip,
94
+ app_id: attributes[:api_application_id].strip,
95
+ scopes: attributes[:scopes],
96
+ iss: attributes[:issuer_id].strip,
105
97
  aud: AUDIENCE,
106
- iat: issued_at.to_i,
107
- exp: expires_at.to_i
98
+ iat: attributes[:issued_at].to_i,
99
+ exp: attributes[:expires_at].to_i
108
100
  }
109
- add_optional_claim!(payload, :sub, subject)
110
- add_optional_claim!(payload, :jti, token_id)
101
+ {
102
+ deck_id: :deck_id,
103
+ publisher_slug: :publisher_slug,
104
+ game_key: :game_key,
105
+ external_subject: :external_subject,
106
+ representation: :representation,
107
+ sub: :subject,
108
+ jti: :token_id
109
+ }.each do |claim, key|
110
+ add_optional_claim!(payload, claim, attributes[key])
111
+ end
111
112
  payload
112
113
  end
113
114
 
@@ -120,18 +121,32 @@ module CardDB
120
121
  raise ArgumentError, "#{name} is required" unless value.is_a?(String) && !value.strip.empty?
121
122
  end
122
123
 
124
+ def normalize_scopes!(scopes)
125
+ raise ArgumentError, 'scopes must include at least one DeckTokenScope' unless scopes.is_a?(Array) && !scopes.empty?
126
+
127
+ scopes.map do |scope|
128
+ validate_required_string!(scope, 'scope')
129
+ scope.strip
130
+ end
131
+ end
132
+
133
+ def validate_token_target!(attributes)
134
+ return if string_present?(attributes[:deck_id])
135
+ return if %i[publisher_slug game_key external_subject].all? { |key| string_present?(attributes[key]) }
136
+
137
+ raise ArgumentError, 'deck_id or publisher_slug, game_key, and external_subject are required'
138
+ end
139
+
140
+ def string_present?(value)
141
+ value&.strip&.length&.positive?
142
+ end
143
+
123
144
  def normalize_time!(value, name)
124
145
  raise ArgumentError, "#{name} must be a Time" unless value.is_a?(Time)
125
146
 
126
147
  value
127
148
  end
128
149
 
129
- def normalize_read_mode!(read_mode)
130
- READ_MODES.fetch(read_mode.to_s.upcase) do
131
- raise ArgumentError, 'read_mode must be PUBLIC, EMBED, or FULL'
132
- end
133
- end
134
-
135
150
  def normalize_private_key!(private_key)
136
151
  return private_key if private_key.is_a?(OpenSSL::PKey::PKey)
137
152
 
@@ -968,8 +968,8 @@ module CardDB
968
968
 
969
969
  def deck
970
970
  <<~GRAPHQL
971
- query Deck($id: UUID!) {
972
- deck(id: $id) {
971
+ query Deck($id: UUID!, $readState: DeckReadState!, $version: DeckPublishedVersionSelector) {
972
+ deck(id: $id, readState: $readState, version: $version) {
973
973
  #{deck_fields}
974
974
  }
975
975
  }
@@ -1021,8 +1021,8 @@ module CardDB
1021
1021
 
1022
1022
  def deck_by_external_ref
1023
1023
  <<~GRAPHQL
1024
- query DeckByExternalRef($externalRef: String!) {
1025
- deckByExternalRef(externalRef: $externalRef) {
1024
+ query DeckByExternalRef($externalRef: String!, $readState: DeckReadState!, $version: DeckPublishedVersionSelector) {
1025
+ deckByExternalRef(externalRef: $externalRef, readState: $readState, version: $version) {
1026
1026
  #{deck_fields}
1027
1027
  }
1028
1028
  }
@@ -1053,37 +1053,6 @@ module CardDB
1053
1053
  GRAPHQL
1054
1054
  end
1055
1055
 
1056
- # Builds a deckPreview query
1057
- def deck_preview
1058
- <<~GRAPHQL
1059
- query DeckPreview($token: String!) {
1060
- deckPreview(token: $token) {
1061
- #{deck_fields}
1062
- }
1063
- }
1064
- GRAPHQL
1065
- end
1066
-
1067
- def deck_embed
1068
- <<~GRAPHQL
1069
- query DeckEmbed($token: String!) {
1070
- deckEmbed(token: $token) {
1071
- #{deck_fields}
1072
- }
1073
- }
1074
- GRAPHQL
1075
- end
1076
-
1077
- def deck_access
1078
- <<~GRAPHQL
1079
- query DeckAccess($token: String!) {
1080
- deckAccess(token: $token) {
1081
- #{deck_fields}
1082
- }
1083
- }
1084
- GRAPHQL
1085
- end
1086
-
1087
1056
  def deck_draft_diff
1088
1057
  <<~GRAPHQL
1089
1058
  query DeckDraftDiff($id: UUID!) {
@@ -1163,37 +1132,6 @@ module CardDB
1163
1132
  GRAPHQL
1164
1133
  end
1165
1134
 
1166
- # Builds a deckPreviewTokens query
1167
- def deck_preview_tokens
1168
- <<~GRAPHQL
1169
- query DeckPreviewTokens($deckId: UUID!) {
1170
- deckPreviewTokens(deckId: $deckId) {
1171
- #{deck_preview_token_fields}
1172
- }
1173
- }
1174
- GRAPHQL
1175
- end
1176
-
1177
- def deck_embed_tokens
1178
- <<~GRAPHQL
1179
- query DeckEmbedTokens($deckId: UUID!) {
1180
- deckEmbedTokens(deckId: $deckId) {
1181
- #{deck_embed_token_fields}
1182
- }
1183
- }
1184
- GRAPHQL
1185
- end
1186
-
1187
- def deck_access_token_issuers
1188
- <<~GRAPHQL
1189
- query DeckAccessTokenIssuers($deckId: UUID!) {
1190
- deckAccessTokenIssuers(deckId: $deckId) {
1191
- #{deck_access_token_issuer_fields}
1192
- }
1193
- }
1194
- GRAPHQL
1195
- end
1196
-
1197
1135
  def deck_api_application_accesses
1198
1136
  <<~GRAPHQL
1199
1137
  query DeckApiApplicationAccesses($deckId: UUID!, $includeRevoked: Boolean) {
@@ -1485,119 +1423,51 @@ module CardDB
1485
1423
  GRAPHQL
1486
1424
  end
1487
1425
 
1488
- # Builds a deckPreviewTokenCreate mutation
1489
- def create_deck_preview_token
1490
- <<~GRAPHQL
1491
- mutation DeckPreviewTokenCreate($input: DeckPreviewTokenCreateInput!) {
1492
- deckPreviewTokenCreate(input: $input) {
1493
- token
1494
- previewToken {
1495
- #{deck_preview_token_fields}
1496
- }
1497
- }
1498
- }
1499
- GRAPHQL
1500
- end
1501
-
1502
- # Builds a deckPreviewTokenRevoke mutation
1503
- def revoke_deck_preview_token
1504
- <<~GRAPHQL
1505
- mutation DeckPreviewTokenRevoke($id: UUID!) {
1506
- deckPreviewTokenRevoke(id: $id)
1507
- }
1508
- GRAPHQL
1509
- end
1510
-
1511
- def create_deck_embed_token
1512
- <<~GRAPHQL
1513
- mutation DeckEmbedTokenCreate($input: DeckEmbedTokenCreateInput!) {
1514
- deckEmbedTokenCreate(input: $input) {
1515
- token
1516
- embedToken {
1517
- #{deck_embed_token_fields}
1518
- }
1519
- }
1520
- }
1521
- GRAPHQL
1522
- end
1523
-
1524
- def revoke_deck_embed_token
1525
- <<~GRAPHQL
1526
- mutation DeckEmbedTokenRevoke($id: UUID!) {
1527
- deckEmbedTokenRevoke(id: $id)
1528
- }
1529
- GRAPHQL
1530
- end
1531
-
1532
- def create_deck_access_token_issuer
1426
+ def create_deck_token_issuer
1533
1427
  <<~GRAPHQL
1534
- mutation DeckAccessTokenIssuerCreate($input: DeckAccessTokenIssuerCreateInput!) {
1535
- deckAccessTokenIssuerCreate(input: $input) {
1536
- #{deck_access_token_issuer_fields}
1428
+ mutation DeckTokenIssuerCreate($input: DeckTokenIssuerCreateInput!) {
1429
+ deckTokenIssuerCreate(input: $input) {
1430
+ #{deck_token_issuer_fields}
1537
1431
  }
1538
1432
  }
1539
1433
  GRAPHQL
1540
1434
  end
1541
1435
 
1542
- def revoke_deck_access_token_issuer
1436
+ def revoke_deck_token_issuer
1543
1437
  <<~GRAPHQL
1544
- mutation DeckAccessTokenIssuerRevoke($id: UUID!) {
1545
- deckAccessTokenIssuerRevoke(id: $id)
1438
+ mutation DeckTokenIssuerRevoke($id: UUID!) {
1439
+ deckTokenIssuerRevoke(id: $id)
1546
1440
  }
1547
1441
  GRAPHQL
1548
1442
  end
1549
1443
 
1550
- def revoke_deck_access_token_issuer_signing_key
1444
+ def revoke_deck_token_issuer_signing_key
1551
1445
  <<~GRAPHQL
1552
- mutation DeckAccessTokenIssuerSigningKeyRevoke($id: UUID!) {
1553
- deckAccessTokenIssuerSigningKeyRevoke(id: $id) {
1554
- #{deck_access_token_issuer_fields}
1446
+ mutation DeckTokenIssuerSigningKeyRevoke($id: UUID!) {
1447
+ deckTokenIssuerSigningKeyRevoke(id: $id) {
1448
+ #{deck_token_issuer_fields}
1555
1449
  }
1556
1450
  }
1557
1451
  GRAPHQL
1558
1452
  end
1559
1453
 
1560
- def exchange_deck_access_token
1454
+ def exchange_deck_token
1561
1455
  <<~GRAPHQL
1562
- mutation DeckAccessTokenExchange($input: DeckAccessTokenExchangeInput!) {
1563
- deckAccessTokenExchange(input: $input) {
1456
+ mutation DeckTokenExchange($input: DeckTokenExchangeInput!) {
1457
+ deckTokenExchange(input: $input) {
1564
1458
  token
1565
- accessToken {
1566
- #{deck_access_token_fields}
1459
+ deckToken {
1460
+ #{deck_token_fields}
1567
1461
  }
1568
1462
  }
1569
1463
  }
1570
1464
  GRAPHQL
1571
1465
  end
1572
1466
 
1573
- def exchange_deck_session_token
1467
+ def revoke_deck_token
1574
1468
  <<~GRAPHQL
1575
- mutation DeckSessionTokenExchange($input: DeckSessionTokenExchangeInput!) {
1576
- deckSessionTokenExchange(input: $input) {
1577
- token
1578
- sessionToken {
1579
- id
1580
- accountId
1581
- apiApplicationId
1582
- gameId
1583
- environment
1584
- externalSubject
1585
- scopes
1586
- expiresAt
1587
- revokedAt
1588
- lastUsedAt
1589
- createdAt
1590
- updatedAt
1591
- }
1592
- }
1593
- }
1594
- GRAPHQL
1595
- end
1596
-
1597
- def revoke_deck_access_token
1598
- <<~GRAPHQL
1599
- mutation DeckAccessTokenRevoke($id: UUID!) {
1600
- deckAccessTokenRevoke(id: $id)
1469
+ mutation DeckTokenRevoke($id: UUID!) {
1470
+ deckTokenRevoke(id: $id)
1601
1471
  }
1602
1472
  GRAPHQL
1603
1473
  end
@@ -2938,43 +2808,13 @@ module CardDB
2938
2808
  FIELDS
2939
2809
  end
2940
2810
 
2941
- def deck_preview_token_fields
2942
- <<~FIELDS
2943
- id
2944
- deckId
2945
- label
2946
- expiresAt
2947
- revokedAt
2948
- lastUsedAt
2949
- createdAt
2950
- updatedAt
2951
- FIELDS
2952
- end
2953
-
2954
- def deck_embed_token_fields
2811
+ def deck_token_issuer_fields
2955
2812
  <<~FIELDS
2956
2813
  id
2957
- deckId
2958
2814
  apiApplicationId
2959
2815
  label
2960
- readMode
2961
- allowedOrigins
2962
- externalSubject
2963
- expiresAt
2964
- revokedAt
2965
- lastUsedAt
2966
- createdAt
2967
- updatedAt
2968
- FIELDS
2969
- end
2970
-
2971
- def deck_access_token_issuer_fields
2972
- <<~FIELDS
2973
- id
2974
- deckId
2975
- apiApplicationId
2976
- label
2977
- readModes
2816
+ allowedScopes
2817
+ allowedRepresentations
2978
2818
  maxTokenLifetimeSeconds
2979
2819
  directSigningAlg
2980
2820
  directSigningKeyId
@@ -2986,14 +2826,16 @@ module CardDB
2986
2826
  FIELDS
2987
2827
  end
2988
2828
 
2989
- def deck_access_token_fields
2829
+ def deck_token_fields
2990
2830
  <<~FIELDS
2991
2831
  id
2992
- deckId
2993
2832
  apiApplicationId
2994
2833
  issuerId
2995
- readMode
2834
+ deckId
2835
+ gameId
2996
2836
  externalSubject
2837
+ scopes
2838
+ representation
2997
2839
  expiresAt
2998
2840
  revokedAt
2999
2841
  lastUsedAt