Add /v2/directory/auth endpoint

This commit is contained in:
Chris Eager
2021-10-08 17:30:42 -07:00
committed by Chris Eager
parent 1053a47e42
commit eb86986cf4
9 changed files with 204 additions and 79 deletions

View File

@@ -0,0 +1,22 @@
/*
* Copyright 2013-2020 Signal Messenger, LLC
* SPDX-License-Identifier: AGPL-3.0-only
*/
package org.whispersystems.textsecuregcm.configuration;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.validation.constraints.NotEmpty;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
public class DirectoryV2ClientConfiguration {
@NotEmpty
@JsonProperty
private String userAuthenticationTokenSharedSecret;
public byte[] getUserAuthenticationTokenSharedSecret() throws DecoderException {
return Hex.decodeHex(userAuthenticationTokenSharedSecret.toCharArray());
}
}

View File

@@ -0,0 +1,21 @@
/*
* Copyright 2013-2020 Signal Messenger, LLC
* SPDX-License-Identifier: AGPL-3.0-only
*/
package org.whispersystems.textsecuregcm.configuration;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
public class DirectoryV2Configuration {
@JsonProperty
@NotNull
@Valid
private DirectoryV2ClientConfiguration client;
public DirectoryV2ClientConfiguration getDirectoryV2ClientConfiguration() {
return client;
}
}