Skip to content

Commit e96156a

Browse files
authored
Merge pull request #174 from supertokens/fix/webauthn-review-fixes
fix: webauthn review fixes
2 parents 1b04c23 + b814eb4 commit e96156a

File tree

4 files changed

+50
-5
lines changed

4 files changed

+50
-5
lines changed

src/main/java/io/supertokens/pluginInterface/webauthn/WebAuthNStorage.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,19 @@
1919
import io.supertokens.pluginInterface.authRecipe.AuthRecipeStorage;
2020
import io.supertokens.pluginInterface.exceptions.StorageQueryException;
2121
import io.supertokens.pluginInterface.multitenancy.TenantIdentifier;
22+
import io.supertokens.pluginInterface.multitenancy.exceptions.TenantOrAppNotFoundException;
2223
import io.supertokens.pluginInterface.webauthn.exceptions.*;
2324

2425
import java.util.List;
2526

2627
public interface WebAuthNStorage extends AuthRecipeStorage {
2728

28-
WebAuthNStoredCredential saveCredentials(TenantIdentifier tenantIdentifier, WebAuthNStoredCredential credential) throws StorageQueryException;
29+
WebAuthNStoredCredential saveCredentials(TenantIdentifier tenantIdentifier, WebAuthNStoredCredential credential)
30+
throws StorageQueryException, DuplicateCredentialException, UserIdNotFoundException,
31+
TenantOrAppNotFoundException;
2932

30-
WebAuthNOptions saveGeneratedOptions(TenantIdentifier tenantIdentifier, WebAuthNOptions optionsToSave) throws StorageQueryException;
33+
WebAuthNOptions saveGeneratedOptions(TenantIdentifier tenantIdentifier, WebAuthNOptions optionsToSave)
34+
throws StorageQueryException, DuplicateOptionsIdException, TenantOrAppNotFoundException;
3135

3236
WebAuthNOptions loadOptionsById(TenantIdentifier tenantIdentifier, String optionsId) throws StorageQueryException;
3337

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2025, VRAI Labs and/or its affiliates. All rights reserved.
3+
*
4+
* This software is licensed under the Apache License, Version 2.0 (the
5+
* "License") as published by the Apache Software Foundation.
6+
*
7+
* You may not use this file except in compliance with the License. You may
8+
* obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations
14+
* under the License.
15+
*/
16+
17+
package io.supertokens.pluginInterface.webauthn.exceptions;
18+
19+
public class DuplicateCredentialException extends Exception {
20+
public DuplicateCredentialException() {}
21+
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2025, VRAI Labs and/or its affiliates. All rights reserved.
3+
*
4+
* This software is licensed under the Apache License, Version 2.0 (the
5+
* "License") as published by the Apache Software Foundation.
6+
*
7+
* You may not use this file except in compliance with the License. You may
8+
* obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations
14+
* under the License.
15+
*/
16+
17+
package io.supertokens.pluginInterface.webauthn.exceptions;
18+
19+
public class DuplicateOptionsIdException extends Exception {
20+
public DuplicateOptionsIdException() {
21+
}
22+
}

src/main/java/io/supertokens/pluginInterface/webauthn/slqStorage/WebAuthNSQLStorage.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232

3333
public interface WebAuthNSQLStorage extends WebAuthNStorage, SQLStorage {
3434

35-
WebAuthNStoredCredential saveCredentials_Transaction(TenantIdentifier tenantIdentifier, TransactionConnection con,
36-
WebAuthNStoredCredential credential) throws StorageQueryException;
37-
3835
WebAuthNOptions loadOptionsById_Transaction(TenantIdentifier tenantIdentifier, TransactionConnection con, String optionsId) throws StorageQueryException;
3936

4037
WebAuthNStoredCredential loadCredentialById_Transaction(TenantIdentifier tenantIdentifier, TransactionConnection con, String credentialId) throws StorageQueryException;

0 commit comments

Comments
 (0)