opendal icon indicating copy to clipboard operation
opendal copied to clipboard

new feature: `Operator` built with `Azblob::sas_token` should support token refresh

Open bonsairobo opened this issue 3 months ago • 3 comments

Feature Description

I'd like to be able to continue using the same Operator through SAS token updates.

Problem and Solution

Right now, if I want to refresh a SAS token, I would need to build a new Operator, because Azblob::sas_token takes a &str.

I believe the solution is to provide an Arc<RwLock<String>> (or equivalent wrapper) instead, so that the token can be updated externally.

Additional Context

No response

Are you willing to contribute to the development of this feature?

  • [x] Yes, I am willing to contribute to the development of this feature.

bonsairobo avatar Sep 21 '25 05:09 bonsairobo

After digging into the code a bit, I see that reqsign 0.17.0 has a ProvideCredential trait that should satisfy my use case. I assume the upgrade work is happening in https://github.com/apache/opendal/issues/6553.

@Xuanwo As part of the upgrade, will the AzblobBuilder allow passing in an arbitrary ProvideCredential?

bonsairobo avatar Sep 23 '25 08:09 bonsairobo

FWIW I hacked in the API I needed on a fork.

I will probably patch this into my project while waiting for the better upstream solution.

bonsairobo avatar Sep 23 '25 08:09 bonsairobo

After digging into the code a bit, I see that reqsign 0.17.0 has a ProvideCredential trait that should satisfy my use case. I assume the upgrade work is happening in #6553.

@Xuanwo As part of the upgrade, will the AzblobBuilder allow passing in an arbitrary ProvideCredential?

Yes! That's our goal.

Xuanwo avatar Sep 23 '25 16:09 Xuanwo