Skip to content

Commit 016b6d8

Browse files
Align APIs: shared secret instead of API key.
1 parent 16c5247 commit 016b6d8

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

objectbox-java/src/main/java/io/objectbox/sync/SyncCredentials.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@
33
import io.objectbox.annotation.apihint.Experimental;
44

55
/**
6-
* Use the static helper methods to build sync credentials, for example {@link #apiKey SyncCredentials.apiKey("key")}.
6+
* Use the static helper methods to build Sync credentials,
7+
* for example {@link #sharedSecret(String) SyncCredentials.sharedSecret("secret")}.
78
*/
89
@SuppressWarnings("unused")
910
@Experimental
1011
public class SyncCredentials {
1112

1213
/**
13-
* Authenticate with a pre-shared key.
14-
*
15-
* @param apiKey will be UTF-8 encoded
14+
* Authenticate with a shared secret. This could be a passphrase, big number or randomly chosen bytes.
15+
* The string is expected to use UTF-8 characters.
1616
*/
17-
public static SyncCredentials apiKey(String apiKey) {
18-
return new SyncCredentialsToken(CredentialsType.API_KEY, apiKey);
17+
public static SyncCredentials sharedSecret(String secret) {
18+
return new SyncCredentialsToken(CredentialsType.SHARED_SECRET, secret);
1919
}
2020

2121
/**
22-
* Authenticate with a pre-shared key.
22+
* Authenticate with a shared secret. This could be a passphrase, big number or randomly chosen bytes.
2323
*/
24-
public static SyncCredentials apiKey(byte[] apiKey) {
25-
return new SyncCredentialsToken(CredentialsType.API_KEY, apiKey);
24+
public static SyncCredentials sharedSecret(byte[] secret) {
25+
return new SyncCredentialsToken(CredentialsType.SHARED_SECRET, secret);
2626
}
2727

2828
/**
@@ -34,7 +34,7 @@ public static SyncCredentials google(String idToken) {
3434
}
3535

3636
/**
37-
* No authentication, insecure. Use only for development and testing purposes.
37+
* No authentication, unsecured. Use only for development and testing purposes.
3838
*/
3939
public static SyncCredentials none() {
4040
return new SyncCredentialsToken(CredentialsType.NONE);
@@ -45,7 +45,7 @@ public enum CredentialsType {
4545

4646
NONE(0),
4747

48-
API_KEY(1),
48+
SHARED_SECRET(1),
4949

5050
GOOGLE(2);
5151

0 commit comments

Comments
 (0)