-
Notifications
You must be signed in to change notification settings - Fork 327
add refresh credentials property to loadTableResult #1164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 16 commits
63c7dc7
a885ffb
7912eca
aa6f1b1
9c1c283
0241b80
c1f2cbe
b0057d4
97b8990
d8e55c0
13d33a5
7961dc2
f2f3fd1
348f1ee
a2a4640
ab02a2d
87d8358
07f9dc1
7002409
aec31d7
bcea6c6
6ccc3e1
54ef878
315afda
d073982
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ | |
| import com.auth0.jwt.JWTVerifier; | ||
| import com.auth0.jwt.algorithms.Algorithm; | ||
| import com.auth0.jwt.interfaces.DecodedJWT; | ||
| import java.net.URI; | ||
| import java.util.Map; | ||
| import org.apache.polaris.core.PolarisCallContext; | ||
| import org.apache.polaris.core.context.CallContext; | ||
|
|
@@ -65,6 +66,11 @@ public PolarisCallContext getPolarisCallContext() { | |
| public Map<String, Object> contextVariables() { | ||
| return Map.of(); | ||
| } | ||
|
|
||
| @Override | ||
| public URI getBaseUri() { | ||
|
||
| return null; | ||
| } | ||
| }); | ||
| PolarisMetaStoreManager metastoreManager = Mockito.mock(PolarisMetaStoreManager.class); | ||
| String mainSecret = "test_secret"; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,7 @@ | |
| import org.apache.iceberg.TableMetadata; | ||
| import org.apache.iceberg.TableMetadataParser; | ||
| import org.apache.iceberg.TableOperations; | ||
| import org.apache.iceberg.aws.AwsClientProperties; | ||
| import org.apache.iceberg.catalog.Namespace; | ||
| import org.apache.iceberg.catalog.SupportsNamespaces; | ||
| import org.apache.iceberg.catalog.TableIdentifier; | ||
|
|
@@ -853,6 +854,19 @@ public Map<String, String> getCredentialConfig( | |
| storageInfo.get()); | ||
| } | ||
|
|
||
| @Override | ||
| public Map<String, String> getVendedCredentialConfig(TableIdentifier tableIdentifier) { | ||
| Map<String, String> vendedCredentialConfig = new HashMap<>(); | ||
| String credentialsEndpoint = | ||
| String.format( | ||
| "/v1/%s/namespaces/%s/tables/%s/credentials", | ||
|
||
| catalogName, tableIdentifier.namespace().toString(), tableIdentifier.name()); | ||
|
||
| vendedCredentialConfig.put(AwsClientProperties.REFRESH_CREDENTIALS_ENABLED, "true"); | ||
| vendedCredentialConfig.put( | ||
| AwsClientProperties.REFRESH_CREDENTIALS_ENDPOINT, credentialsEndpoint); | ||
|
||
| return vendedCredentialConfig; | ||
| } | ||
|
|
||
| /** | ||
| * Based on configuration settings, for callsites that need to handle potentially setting a new | ||
| * base location for a TableLike entity, produces the transformed location if applicable, or else | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ | |
| import com.google.common.collect.ImmutableMap; | ||
| import jakarta.annotation.Nonnull; | ||
| import java.lang.reflect.Method; | ||
| import java.net.URI; | ||
|
||
| import java.time.Clock; | ||
| import java.util.HashMap; | ||
| import java.util.List; | ||
|
|
@@ -149,6 +150,11 @@ public PolarisCallContext getPolarisCallContext() { | |
| public Map<String, Object> contextVariables() { | ||
| return new HashMap<>(); | ||
| } | ||
|
|
||
| @Override | ||
| public URI getBaseUri() { | ||
| return null; | ||
| } | ||
| }; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |
| import com.google.auth.oauth2.AccessToken; | ||
| import com.google.auth.oauth2.GoogleCredentials; | ||
| import jakarta.ws.rs.core.SecurityContext; | ||
| import java.net.URI; | ||
|
||
| import java.security.Principal; | ||
| import java.time.Clock; | ||
| import java.time.Instant; | ||
|
|
@@ -158,6 +159,11 @@ public PolarisCallContext getPolarisCallContext() { | |
| public Map<String, Object> contextVariables() { | ||
| return new HashMap<>(); | ||
| } | ||
|
|
||
| @Override | ||
| public URI getBaseUri() { | ||
| return null; | ||
| } | ||
| }; | ||
|
|
||
| FileIOFactory fileIOFactory = | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been removed