Comments (11)
Yes, but with an underscore please instead of a dash. The use statement will be use azure_core::TokenCredential
whether the crate is named azure-core
or azure_core
and I prefer it to be consistent as well.
from azure-sdk-for-rust.
I think Python & C# provide good examples. In Python, you create a client with an implementation of azure.core.credentials.TokenCredential
. An example is the StorageManagementClient:
StorageManagementClient(credential, subscription_id, api_version=None, base_url=None, profile=<KnownProfiles.default: <azure.profiles.DefaultProfile object>>, **kwargs)
Here are a couple of examples from the How to authenticate and authorize Python apps on Azure docs that show using azure.identity
classes provided from https://pypi.org/project/azure-identity/ package:
from azure.identity import DefaultAzureCredential
credential = DefaultAzureCredential()
from azure.identity import AzureCliCredential
credential = AzureCliCredential()
(implementation of AzureCliCredential)
C# has an Azure.Core.TokenCredential abstract class in Azure.Core
package with lot of implementation from the Azure.Identity package:
Azure.Identity.AuthorizationCodeCredential
Azure.Identity.AzureCliCredential
Azure.Identity.ChainedTokenCredential
Azure.Identity.ClientCertificateCredential
Azure.Identity.ClientSecretCredential
Azure.Identity.DefaultAzureCredential
Azure.Identity.DeviceCodeCredential
Azure.Identity.EnvironmentCredential
Azure.Identity.InteractiveBrowserCredential
Azure.Identity.ManagedIdentityCredential
Azure.Identity.SharedTokenCacheCredential
Azure.Identity.UsernamePasswordCredential
Azure.Identity.VisualStudioCodeCredential
Azure.Identity.VisualStudioCredential
So, we probably want to have similar implementations in an azure_identity
crate.
from azure-sdk-for-rust.
Yes, please use JS and C# naming conventions. Go is ramping back up, but seems to have had a lull when other languages were standardizing a set of cross-cutting guidelines. But the create name would still be something like azure-identity. Classes (structs) typically take the form of *Credential, like EnvironmentCredential
.
from azure-sdk-for-rust.
In strongly-typed languages like C# and Java, we define the TokenCredential
base class in Azure.Core (where we put all things of that nature, including pipelining code, which we'll want to consider here - at least for pub types/methods) because anyone can create one. In fact, we had a couple of our own libraries define their own, but recently consolidated them to AzureKeyCredential
and added that to Azure.Core since they were all basically the same - just supply an "api-key" (or custom value name, if not "api-key"). But Azure.Identity is separate and not a direct dependency by design. At least in current implementations, it requires other libraries like MSAL or other platform-specific libraries we don't want to force customers into, especially when libraries like MSAL introduce all sorts of versioning issues.
from azure-sdk-for-rust.
A trait implementation must live in the same crate due to Rust's trait coherence and the orphan rule, so I'm struggling to figure out the right design for the dependencies in my head.
from azure-sdk-for-rust.
Can't we just define a trait like TokenCredential
in azure-core and each struct implement that create in azure-identity? I don't see how that's any different than built-in (well, std) traits.
from azure-sdk-for-rust.
Yes, since presumably almost all usage of an Azure SDK will require usage of the sdk-core crate, we can put it in there.
from azure-sdk-for-rust.
azure_sdk_core
azure_core
seems like the right place to put the TokenCredential
interface. However, that crates dependencies need to be trimmed. Or may be we should create a azure_services_core
as well. I want to take a dependency on TokenCredential
from the services.
from azure-sdk-for-rust.
I'd definitely love to take a look at the core crate and see how we can trim it down. Our old friend features might be able to help us out there.
from azure-sdk-for-rust.
The create should be "azure-core" to match all other languages' SDKs. We should be idiomatic and absolutely do what makes sense for Rust, but "module" names and, when appropriate, type/method names should be similar. See https://azure.github.io/azure-sdk/general_introduction.html#consistent. Is there some reason you don't like "azure-core"? The fact it's a client SDK should be obvious from other branding, such as crate descriptions, etc.
from azure-sdk-for-rust.
This can be closed as we have decided on azure-identity as the name.
from azure-sdk-for-rust.
Related Issues (20)
- HTTP Client DNS resolver override HOT 3
- Redact Debug printing? HOT 3
- Make sure all public APIs are documented
- Consider sccache for improving build performance
- IMDS probe requests should throw CredentialUnavailableException for any response that is not valid json
- `azure_mgmt_containerservice` is not built anymore using the current rest specs
- Consider using `async-std` over direct `tokio` when possible
- remove-dependency: pin-project
- Trim dependencies
- Remove source with incompatible copyrights
- Hash is not include in `PutBlockBuilder.into_future()`
- Allow client methods to dictate what HTTP status codes are errors or otherwise unexpected
- Add public getters to ClientOptions and ClientMethodOptions
- CI command changes
- Replace AsClientOptions, AsClientMethodOptions with derive macro-defined functions
- Azure Workload Identity - Expired token HOT 1
- Pass `--all-features` to any commands that use it, typically, e.g., linting.
- Make TelemetryOptions optional and generic, but default to the standard Azure User-Agent format for azure_core HOT 5
- Cache bearer tokens based on the authority HOT 1
- Need to allow customization of when and how auth tokens are fetched
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-sdk-for-rust.