-
Notifications
You must be signed in to change notification settings - Fork 668
DYN-7925: make access token accessible to all package authors using static method #15868
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
DYN-7925: make access token accessible to all package authors using static method #15868
Conversation
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.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-7925
|
@mjkkirschner I am still not sure how the access token is going to be used by authors. At the node implementation level ? |
|
@pinzart90 - yes, any node author can access an execute session, from ZT, python, or NodeModels. Unfortunately @saintentropy showed me an example of the DX nodes where this implementation will not work - it's a UI node that requires auth before the graph is executed - so I will change this implementation to support that use case as well. |
So just to confirm, the token will be available to authors pre-graph execution, as opposed to what the PR description says (that you may implement that later)? |
yes, that's correct @zeusongit - I will update the PR description when this is ready for another look. |
|
@pinzart90 if you are concerned that this API may change or need some more iteration cycles we can leverage the experimental attrbiute: this will require package authors to opt-in explicitly to using this experimental feature or they will get a compile error. I personally would like to see this approach taken more often to avoid the buildup of WIP APIs we cannot remove. |
@pinzart90 @aparajit-pratap 😢 - so because the |
The only reason for netstd2 was to be compatible with net48 at the same time. If we no longer want to do releases of LibG for net48 or if we want to do multi targeting (which complicates the CICD process) then we can move it on up. |
|
@mjkkirschner what version of DynamoServices (net8 or std) will be used by nuget restore when consumed in a net8 csproj? |
I can verify, but it should be the highest matching framework target IIRC. |
confirmed @pinzart90 - it picks the right one based on the target of the referencing project. |
Purpose
https://jira.autodesk.com/browse/DYN-7925
As we have more and more packages requiring authentication and authorization it makes sense to make it simpler for package authors to retrieve the current access token.
Currently, to retrieve the current access token, a package author needs to implement an extension, get the authprovider, then introduce a static api to retrieve the token from the extension in their nodes.
Let's just skip all that - this PR adds a method to DynamoServices:
AuthServicesEvents.OnRequestAuthProvider()whichDynamoModelhandles by returning to the current auth provider if one exists.It's implemented this way to avoid needing to add new references to
DynamoServicesand to enable ZT authors to avoid referencing DynamoCore.dll etc.This should cover more use cases than the initial implementation.
This PR also starts multi targeting DynamoServices ( starts targeting net8 as well as netstd2) and adds this new target to the DynamoServices nuget package. This change was made so that we could use the
Experimentalattribute to guard the new API until we are satisfied with its design. For netstd2 builds we fallback to using theobsoleteattribute which is less fitting and is ignorable by clients. Experimental attribute requires opt in.Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
Adds a static API for accessing current auth provider.
Reviewers