Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 6 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,35 +169,20 @@
<artifactId>sts</artifactId>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>2.6.0</version>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client</artifactId>
<version>1.45.0</version>
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-compute</artifactId>
<version>v1-rev20221205-2.0.0</version>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client-gson</artifactId>
<version>1.45.0</version>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-oauth2-http</artifactId>
<version>1.30.0</version>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-credentials</artifactId>
<version>1.30.0</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-logging</artifactId>
<version>3.15.12</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.25.5</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-security-attestation</artifactId>
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/com/uid2/shared/Const.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ public static class Config {

public static final String UidInstanceIdPrefixProp = "uid_instance_id_prefix";

// GCP
public static final String GoogleCredentialsProp = "google_credentials";
public static final String GcpEnclaveParamsProp = "gcp_enclave_params";

// Azure
public static final String MaaServerBaseUrlProp = "maa_server_base_url";

Expand Down
6 changes: 0 additions & 6 deletions src/main/java/com/uid2/shared/attest/AttestationFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ public static IAttestationProvider getNitroAttestation() throws Exception {
return (IAttestationProvider) c.newInstance();
}

public static IAttestationProvider getGcpVmidAttestation() throws Exception {
Class<?> cls = Class.forName("com.uid2.attestation.gcp.VmidAttestationProvider");
Constructor<?> c = cls.getConstructor();
return (IAttestationProvider) c.newInstance();
}

public static IAttestationProvider getGcpOidcAttestation() throws Exception {
Class<?> cls = Class.forName("com.uid2.attestation.gcp.OidcAttestationProvider");
Constructor<?> c = cls.getConstructor();
Expand Down
41 changes: 0 additions & 41 deletions src/main/java/com/uid2/shared/cloud/CloudUtils.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
package com.uid2.shared.cloud;

import com.google.api.services.compute.ComputeScopes;
import com.google.auth.oauth2.GoogleCredentials;
import com.uid2.shared.Const;
import com.uid2.shared.Utils;
import io.vertx.core.json.JsonObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.ByteArrayInputStream;
import java.net.*;
import java.nio.file.Path;
import java.util.Collections;

public class CloudUtils {
private static final Logger LOGGER = LoggerFactory.getLogger(CloudUtils.class);
Expand Down Expand Up @@ -49,42 +44,6 @@ public static TaggableCloudStorage createStorage(String cloudBucket) {
);
}

public static GoogleCredentials getGoogleCredentialsFromConfig(JsonObject jsonConfig) {
GoogleCredentials credentials = getGoogleCredentialsFromConfigInternal(jsonConfig);
if (credentials != null && credentials.createScopedRequired()) {
// only needs compute readonly scope
LOGGER.info("Requesting scope: " + ComputeScopes.COMPUTE_READONLY);
credentials.createScoped(Collections.singletonList(ComputeScopes.COMPUTE_READONLY));
}
return credentials;
}

private static GoogleCredentials getGoogleCredentialsFromConfigInternal(JsonObject jsonConfig) {
if (System.getenv("GOOGLE_APPLICATION_CREDENTIALS") != null) {
try {
GoogleCredentials ret = GoogleCredentials.getApplicationDefault();
LOGGER.info("Using GOOGLE_APPLICATION_CREDENTIALS from environment");
return ret;

} catch (Exception ex) {
LOGGER.error("Unable to read google credentials " + ex.getMessage(), ex);
return null;
}
}

try {
String encodedCreds = jsonConfig.getString(Const.Config.GoogleCredentialsProp);
if (encodedCreds == null) return null;
byte[] credentials = Utils.decodeBase64String(encodedCreds);
if (credentials == null) return null;
GoogleCredentials ret = GoogleCredentials.fromStream(new ByteArrayInputStream(credentials));
LOGGER.info("Using google_credentials provided through vertx-config (env or config)");
return ret;
} catch (Exception ex) {
LOGGER.error("Unable to read google credentials " + ex.getMessage(), ex);
return null;
}
}

public static String normalizeFilePath(Path path) {
return normalizFilePath(path.toString());
Expand Down

This file was deleted.

82 changes: 0 additions & 82 deletions src/main/java/com/uid2/shared/secure/gcp/InstanceDocument.java

This file was deleted.

This file was deleted.

Loading
Loading