@@ -142,11 +142,11 @@ def extract_id_from(response)
142
142
# Add a non-resident credential using the testing API.
143
143
#
144
144
@authenticator = create_rk_disabled_ctap2_authenticator
145
- credential = Credential . create_non_resident_credential (
146
- [ 1 , 2 , 3 , 4 ] ,
147
- 'localhost' ,
148
- Base64 . urlsafe_decode64 ( base64_encoded_pk ) ,
149
- 0
145
+ credential = Credential . non_resident (
146
+ id : [ 1 , 2 , 3 , 4 ] ,
147
+ rp_id : 'localhost' ,
148
+ private_key : Credential . decode ( base64_encoded_pk ) ,
149
+ sign_count : 0
150
150
)
151
151
152
152
@authenticator . add_credential ( credential )
@@ -160,15 +160,15 @@ def extract_id_from(response)
160
160
it 'should test add non-resident credential when authenticator uses U2F protocol' do
161
161
@authenticator = create_rk_disabled_u2f_authenticator
162
162
base64_enc_pk =
163
- "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg8_zMDQDYAxlU-Q" \
164
- "hk1Dwkf0v18GZca1DMF3SaJ9HPdmShRANCAASNYX5lyVCOZLzFZzrIKmeZ2jwU" \
163
+ "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg8_zMDQDYAxlU-Q" \
164
+ "hk1Dwkf0v18GZca1DMF3SaJ9HPdmShRANCAASNYX5lyVCOZLzFZzrIKmeZ2jwU" \
165
165
"RmgsJYxGP__fWN_S-j5sN4tT15XEpN_7QZnt14YvI6uvAgO0uJEboFaZlOEB"
166
166
167
- credential = Credential . create_non_resident_credential (
168
- [ 1 , 2 , 3 , 4 ] ,
169
- 'localhost' ,
170
- Base64 . urlsafe_decode64 ( base64_enc_pk ) ,
171
- 0
167
+ credential = Credential . non_resident (
168
+ id : [ 1 , 2 , 3 , 4 ] ,
169
+ rp_id : 'localhost' ,
170
+ private_key : Credential . decode ( base64_enc_pk ) ,
171
+ sign_count : 0
172
172
)
173
173
@authenticator . add_credential ( credential )
174
174
response = get_assertion_for ( [ 1 , 2 , 3 , 4 ] )
@@ -177,12 +177,12 @@ def extract_id_from(response)
177
177
178
178
it 'should test add resident credential' do
179
179
@authenticator = create_rk_enabled_ctap2_authenticator
180
- credential = Credential . create_resident_credential (
181
- [ 1 , 2 , 3 , 4 ] ,
182
- 'localhost' ,
183
- [ 1 ] ,
184
- Base64 . urlsafe_decode64 ( base64_encoded_pk ) ,
185
- 0
180
+ credential = Credential . resident (
181
+ id : [ 1 , 2 , 3 , 4 ] ,
182
+ rp_id : 'localhost' ,
183
+ user_handle : [ 1 ] ,
184
+ private_key : Credential . decode ( base64_encoded_pk ) ,
185
+ sign_count : 0
186
186
)
187
187
@authenticator . add_credential ( credential )
188
188
#
@@ -198,16 +198,16 @@ def extract_id_from(response)
198
198
it 'should test add resident credential not supported when authenticator uses U2F protocol' do
199
199
@authenticator = create_rk_enabled_u2f_authenticator
200
200
base64_enc_pk =
201
- "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg8_zMDQDYAxlU-Q" \
202
- "hk1Dwkf0v18GZca1DMF3SaJ9HPdmShRANCAASNYX5lyVCOZLzFZzrIKmeZ2jwU" \
201
+ "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg8_zMDQDYAxlU-Q" \
202
+ "hk1Dwkf0v18GZca1DMF3SaJ9HPdmShRANCAASNYX5lyVCOZLzFZzrIKmeZ2jwU" \
203
203
"RmgsJYxGP__fWN_S-j5sN4tT15XEpN_7QZnt14YvI6uvAgO0uJEboFaZlOEB"
204
204
205
- credential = Credential . create_resident_credential (
206
- [ 1 , 2 , 3 , 4 ] ,
207
- 'localhost' ,
208
- [ 1 ] ,
209
- Base64 . urlsafe_decode64 ( base64_enc_pk ) ,
210
- 0
205
+ credential = Credential . resident (
206
+ id : [ 1 , 2 , 3 , 4 ] ,
207
+ rp_id : 'localhost' ,
208
+ user_handle : [ 1 ] ,
209
+ private_key : Credential . decode ( base64_enc_pk ) ,
210
+ sign_count : 0
211
211
)
212
212
213
213
#
@@ -266,13 +266,13 @@ def extract_id_from(response)
266
266
end
267
267
end
268
268
269
- expect ( credential1 . is_resident_credential ) . to eq ( true )
269
+ expect ( credential1 . resident_credential? ) . to eq ( true )
270
270
expect ( credential1 . private_key ) . not_to eq ( nil )
271
271
expect ( credential1 . rp_id ) . to eq ( 'localhost' )
272
272
expect ( credential1 . user_handle ) . to eq ( [ 1 ] )
273
273
expect ( credential1 . sign_count ) . to eq ( 1 )
274
274
275
- expect ( credential2 . is_resident_credential ) . to eq ( false )
275
+ expect ( credential2 . resident_credential? ) . to eq ( false )
276
276
expect ( credential2 . private_key ) . not_to eq ( nil )
277
277
#
278
278
# Non resident keys do not store raw RP IDs or user handles.
@@ -341,7 +341,7 @@ def extract_id_from(response)
341
341
#
342
342
343
343
response = driver . execute_async_script (
344
- "getCredential([{" \
344
+ "getCredential([{" \
345
345
" \" type\" : \" public-key\" ," \
346
346
" \" id\" : Int8Array.from(arguments[0])," \
347
347
"}, {" \
@@ -362,7 +362,7 @@ def extract_id_from(response)
362
362
#
363
363
364
364
response = driver . execute_async_script (
365
- "registerCredential({authenticatorSelection: {userVerification: 'required'}})" \
365
+ "registerCredential({authenticatorSelection: {userVerification: 'required'}})" \
366
366
" .then(arguments[arguments.length - 1]);"
367
367
)
368
368
expect ( response [ 'status' ] ) . to eq ( 'OK' )
0 commit comments