mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 00:47:11 +02:00
Remove the ability to download service account credentials
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=224034254
This commit is contained in:
parent
879c48b079
commit
aeedc427ad
12 changed files with 32 additions and 278 deletions
|
@ -149,17 +149,6 @@ public final class InMemoryKeyring implements Keyring {
|
|||
return jsonCredential;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEncryptedData(String keyName) {
|
||||
throw new RuntimeException(
|
||||
"In-memory keyring does not support the retrieval of encrypted data.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getDecryptedData(String keyName, String encryptedData) {
|
||||
throw new RuntimeException("In-memory keyring does not support decrypting of supplied data.");
|
||||
}
|
||||
|
||||
/** Does nothing. */
|
||||
@Override
|
||||
public void close() {}
|
||||
|
|
|
@ -20,9 +20,6 @@ import dagger.Module;
|
|||
import dagger.Provides;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.util.Optional;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Qualifier;
|
||||
import org.bouncycastle.openpgp.PGPKeyPair;
|
||||
import org.bouncycastle.openpgp.PGPPrivateKey;
|
||||
|
@ -129,16 +126,4 @@ public final class KeyModule {
|
|||
static String provideJsonCredential(Keyring keyring) {
|
||||
return keyring.getJsonCredential();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Named("encryptedDataRetriever")
|
||||
static Function<String, String> provideEncryptedDataRetriever(Keyring keyring) {
|
||||
return keyring::getEncryptedData;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Named("keyringDecrypter")
|
||||
static BiFunction<String, String, byte[]> provideKeyringDecrypter(Keyring keyring) {
|
||||
return keyring::getDecryptedData;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -151,15 +151,6 @@ public interface Keyring extends AutoCloseable {
|
|||
*/
|
||||
String getJsonCredential();
|
||||
|
||||
/**
|
||||
* Returns the encrypted data for the given key name. Only use this method when decryption is not
|
||||
* required.
|
||||
*/
|
||||
String getEncryptedData(String keyName);
|
||||
|
||||
/** Decrypts the given encrypted data using the key name. */
|
||||
byte[] getDecryptedData(String keyName, String encryptedData);
|
||||
|
||||
// Don't throw so try-with-resources works better.
|
||||
@Override
|
||||
void close();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue