Skip to content

Commit 4b6c794

Browse files
porcellusMihaly LengyelrishabhpoddarRishabh
authored
feat: User metadata (#32)
* feat: allow transactions w/ lower isolation level * refactor: using an enum to set transaction isolation level * feat: mapping all transaction isolation level * feat(user_metadat): add support for the new usermetadata recipe * Update CHANGELOG.md Co-authored-by: Mihaly Lengyel <[email protected]> Co-authored-by: Rishabh Poddar <[email protected]> Co-authored-by: Rishabh <[email protected]>
1 parent 6d25c5d commit 4b6c794

File tree

5 files changed

+66
-2
lines changed

5 files changed

+66
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [2.13.0] - 2022-03-04
10+
11+
### Added
12+
13+
- usermetadata recipe functions
14+
915
## [2.12.0] - 2022-02-23
1016

1117
# Added

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
id 'java-library'
33
}
44

5-
version = "2.12.0"
5+
version = "2.13.0"
66

77
repositories {
88
mavenCentral()

src/main/java/io/supertokens/pluginInterface/RECIPE_ID.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
public enum RECIPE_ID {
2121

2222
EMAIL_PASSWORD("emailpassword"), THIRD_PARTY("thirdparty"), SESSION("session"),
23-
EMAIL_VERIFICATION("emailverification"), JWT("jwt"), PASSWORDLESS("passwordless");
23+
EMAIL_VERIFICATION("emailverification"), JWT("jwt"), PASSWORDLESS("passwordless"), USER_METADATA("usermetadata");
2424

2525
private final String name;
2626

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2020, 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.usermetadata;
18+
19+
import com.google.gson.JsonObject;
20+
import io.supertokens.pluginInterface.Storage;
21+
import io.supertokens.pluginInterface.exceptions.StorageQueryException;
22+
23+
public interface UserMetadataStorage extends Storage {
24+
JsonObject getUserMetadata(String userId) throws StorageQueryException;
25+
26+
int deleteUserMetadata(String userId) throws StorageQueryException;
27+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2020, 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.usermetadata.sqlStorage;
18+
19+
import com.google.gson.JsonObject;
20+
21+
import io.supertokens.pluginInterface.exceptions.StorageQueryException;
22+
import io.supertokens.pluginInterface.sqlStorage.SQLStorage;
23+
import io.supertokens.pluginInterface.sqlStorage.TransactionConnection;
24+
import io.supertokens.pluginInterface.usermetadata.UserMetadataStorage;
25+
26+
public interface UserMetadataSQLStorage extends UserMetadataStorage, SQLStorage {
27+
JsonObject getUserMetadata_Transaction(TransactionConnection con, String userId) throws StorageQueryException;
28+
29+
int setUserMetadata_Transaction(TransactionConnection con, String userId, JsonObject metadata)
30+
throws StorageQueryException;
31+
}

0 commit comments

Comments
 (0)