Skip to content

Make the AbfsVendedTokenProvider support token renewal automatically - #1109

Merged
tdas merged 6 commits into
unitycatalog:mainfrom
openinx:1106-abfs-token-renew
Oct 14, 2025
Merged

tdas merged 6 commits into
unitycatalog:mainfrom
openinx:1106-abfs-token-renew

Conversation

@openinx

@openinx openinx commented Oct 10, 2025 •

Copy link
Copy Markdown
Collaborator

PR Checklist

  • A description of the changes is added to the description of this PR.
  • If there is a related issue, make sure it is linked to this PR.
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added or modified a feature, documentation in docs is updated

Description of changes

Solve this issue: #1106

@openinx
openinx force-pushed the 1106-abfs-token-renew branch from f15f299 to bffdfae Compare October 10, 2025 03:39
@openinx openinx changed the title Make the GcsVendedTokenProvider support token renewal automatically Make the AbfsVendedTokenProvider support token renewal automatically Oct 10, 2025
@openinx
openinx force-pushed the 1106-abfs-token-renew branch from bffdfae to c05835c Compare October 13, 2025 20:06
public GenericCredentialProvider() {
}

protected void initialize(Configuration conf) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the azure don't allow the new X(conf) constructor to initialize the token provider instance, it just use the new X() constructor , and then use the x.initialize(conf) to do the initialization.

So here I made the constructor and initialaztion into two steps for the GenericCredentialProvider

  1. no arg constructor, to new the constructor.
  2. initialize(conf) to initialze the fields.

For the AwsVendedTokenProvider, it only allows the new X(conf) to initialize the constructor. Then it should be simple, since we can call new X() then call initialize(conf) inside the constructor.

see also: https://github.com/unitycatalog/unitycatalog/pull/1109/files#diff-7e8f6bba96ad4c72fb501672ee3e863ad3ff4faf0d04bf9df3dbc4067102d807R17


public class AbfsVendedTokenProvider implements SASTokenProvider {
private Configuration conf;
protected static final String ACCESS_TOKEN_KEY = "fs.azure.sas.fixed.token";

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Override
public void initialize(Configuration configuration, String accountName) throws IOException {
this.conf = configuration;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what was this class used for before. do you know?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tdas , this class was introduced this PR #416, which was trying to introduce some kinds of the customized credential logic. But seems the work was not finished and left there.


@Test
public void testGlobalCredCache() throws Exception {
Configuration confA = newTableBasedConf("tableA");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reminder that you can address my comments in this PR
#1108 (comment)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reminder, I think this PR is the good place to address your comment. Let me do that in this PR.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done !

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about this comment? #1108 (comment)

Comment on lines +207 to +209
UCHadoopConf.AZURE_INIT_SAS_TOKEN -> azCredentials.getSasToken,
UCHadoopConf.AZURE_INIT_SAS_TOKEN_EXPIRED_TIME -> String.valueOf(
temporaryCredentials.getExpirationTime),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as i said before, we should have a spark conf for controlling whether we use the original confs or init confs + provider. when we backport these to 0.3 branch, we will maintain the default to be original confs, but in 0.4 we will set the default to init conf + provider. But in both cases, the conf gives the user to change the behavior at will.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, agreed. Then let me revert this change here, since this part is integrating the AbfsVendedTokenProvider to the spark unity catalog. Let's keep this PR focus on the AbfsVendedTokenProvider implementation, and for the next AbfsVendedTokenProvider integration test, let's do the work as you mentioned, which I think will need some flag to control whether if we need to enable the renewal provider or not here https://github.com/unitycatalog/unitycatalog/pull/1110/files#diff-d0fc1c1f6daf86a09832cfab469663dbb46d8846f4041f41d329954ede8d31b6R19 (this is the aws version, will have another abfs integration version).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done ! Please see: f76ad9a

@tdas tdas left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one main comment about integration with UCSIngleCatalog. (edited)
accidental approval, please ignore.

@tdas tdas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one main comment about integration with UCSIngleCatalog.

@tdas

tdas commented Oct 14, 2025

Copy link
Copy Markdown
Contributor

LGTM.. .but what about this past comment?
#1108 (comment)

@tdas
tdas merged commit a7ecc12 into unitycatalog:main Oct 14, 2025
timothyw553 pushed a commit to timothyw553/unitycatalog that referenced this pull request Oct 24, 2025
…nitycatalog#1109)

**PR Checklist**

- [x] A description of the changes is added to the description of this
PR.
- [x] If there is a related issue, make sure it is linked to this PR.
- [x] If you've fixed a bug or added code that should be tested, add
tests!
- [x] If you've added or modified a feature, documentation in `docs` is
updated

**Description of changes**

Solve this issue:
unitycatalog#1106

---------

Signed-off-by: Zheng Hu <[email protected]>
Signed-off-by: TimothyW553 <[email protected]>
openinx added a commit to openinx/unitycatalog that referenced this pull request Nov 10, 2025
…cally (unitycatalog#1109)

**PR Checklist**

- [x] A description of the changes is added to the description of this
PR.
- [x] If there is a related issue, make sure it is linked to this PR.
- [x] If you've fixed a bug or added code that should be tested, add
tests!
- [x] If you've added or modified a feature, documentation in `docs` is
updated

**Description of changes**

Solve this issue:
unitycatalog#1106

---------

Signed-off-by: Zheng Hu <[email protected]>
tdas pushed a commit that referenced this pull request Nov 11, 2025
…cally (#1109) (#1184)

**PR Checklist**

- [x] A description of the changes is added to the description of this
PR.
- [x] If there is a related issue, make sure it is linked to this PR.
- [x] If you've fixed a bug or added code that should be tested, add
tests!
- [x] If you've added or modified a feature, documentation in `docs` is
updated

**Description of changes**

Backport the #1109 to
branch-0.3

Signed-off-by: Zheng Hu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants