Skip to content

Commit

Permalink
Rename sandbox to staging environment
Browse files Browse the repository at this point in the history
To match the upstream name
  • Loading branch information
AsamK committed Jan 5, 2022
1 parent 8a5f98d commit 3587d1c
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ public static ServiceEnvironmentConfig getServiceEnvironmentConfig(
LiveConfig.getUnidentifiedSenderTrustRoot(),
LiveConfig.createKeyBackupConfig(),
LiveConfig.getCdsMrenclave());
case SANDBOX -> new ServiceEnvironmentConfig(SandboxConfig.createDefaultServiceConfiguration(interceptors),
SandboxConfig.getUnidentifiedSenderTrustRoot(),
SandboxConfig.createKeyBackupConfig(),
SandboxConfig.getCdsMrenclave());
case STAGING -> new ServiceEnvironmentConfig(StagingConfig.createDefaultServiceConfiguration(interceptors),
StagingConfig.getUnidentifiedSenderTrustRoot(),
StagingConfig.createKeyBackupConfig(),
StagingConfig.getCdsMrenclave());
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

public enum ServiceEnvironment {
LIVE,
SANDBOX,
STAGING,
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import okhttp3.Dns;
import okhttp3.Interceptor;

class SandboxConfig {
class StagingConfig {

private final static byte[] UNIDENTIFIED_SENDER_TRUST_ROOT = Base64.getDecoder()
.decode("BbqY1DzohE4NUZoVF+L18oUPrK3kILllLEJh2UnPSsEx");
Expand Down Expand Up @@ -83,6 +83,6 @@ static String getCdsMrenclave() {
return CDS_MRENCLAVE;
}

private SandboxConfig() {
private StagingConfig() {
}
}
5 changes: 5 additions & 0 deletions man/signal-cli.1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ This flag must not be given for the `link` command.
It is optional for the `daemon` command.
For all other commands it is only optional if there is exactly one local user in the config directory.

*--service-environment* ENVIRONMENT
Choose the server environment to use:
- `live` (default)
- `staging`

*--dbus*::
Make request via user dbus.

Expand Down
2 changes: 1 addition & 1 deletion run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fi

run() {
set -x
"$SIGNAL_CLI" --service-environment="sandbox" $@
"$SIGNAL_CLI" --service-environment="staging" $@
set +x
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/asamk/signal/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public void init() throws CommandException {
final var serviceEnvironmentCli = ns.<ServiceEnvironmentCli>get("service-environment");
final var serviceEnvironment = serviceEnvironmentCli == ServiceEnvironmentCli.LIVE
? ServiceEnvironment.LIVE
: ServiceEnvironment.SANDBOX;
: ServiceEnvironment.STAGING;

final var trustNewIdentityCli = ns.<TrustNewIdentityCli>get("trust-new-identities");
final var trustNewIdentity = trustNewIdentityCli == TrustNewIdentityCli.ON_FIRST_USE
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/org/asamk/signal/ServiceEnvironmentCli.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ public String toString() {
return "live";
}
},
SANDBOX {
STAGING {
@Override
public String toString() {
return "staging";
}
},
@Deprecated SANDBOX {
@Override
public String toString() {
return "sandbox";
Expand Down

0 comments on commit 3587d1c

Please sign in to comment.