Skip to content
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

token annotation examples added to docs #102

Merged
merged 4 commits into from
Jul 31, 2024

Conversation

okolo
Copy link
Contributor

@okolo okolo commented Jun 5, 2024

No description provided.

@okolo okolo linked an issue Jun 5, 2024 that may be closed by this pull request
@okolo okolo requested a review from volodymyrss June 5, 2024 20:34
@volodymyrss volodymyrss requested a review from ferrigno June 6, 2024 06:54
Copy link
Member

@volodymyrss volodymyrss left a comment

Choose a reason for hiding this comment

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

Thanks! At first glance - looks good to me. Let's have @ferrigno assess it as the first immediate user.

@ferrigno
Copy link
Contributor

ferrigno commented Jun 6, 2024

You mention first
from oda_api.api import get_context
token = get_context()['token']

then
from oda_api.token import discover_token
token = discover_token(allow_invalid=True, token_discovery_methods=None)

Are the two codes equivalent? If yes, why you propose two solutions? Which the advantages and drawbacks of one or the other? It is not clear if one needs to set the optional parameters to some values.
You should explain what the options mean an what should be used. It is not clear, sorry.

@okolo
Copy link
Contributor Author

okolo commented Jun 7, 2024

@ferrigno Indeed both ways described in doc are equivalent, however the second way also provides token validation and token discovery method as extra options as it was stated in the doc. The first way is more low level implementation. I've extended the documentation.

@ferrigno
Copy link
Contributor

Can you provide an example of context file so that one can test locally the code and debug ?

@ferrigno
Copy link
Contributor

Actually, I would suggest that you drop the option token_discovery_methods=[oda_api.token.TokenLocation.CONTEXT_FILE]
because in this way one can run it locally as well as remotely.

@ferrigno
Copy link
Contributor

You should add that the annotation enures that the token of the session is stored by the system in a json file called ".oda...." and then notebook will read it. However, the other methods are suitable to read the token outside of MMODA as in other documentation.

I removed the method restriction.
@ferrigno
Copy link
Contributor

I removed the pre-defined method and explained the usage.

@okolo okolo merged commit eee0dde into master Jul 31, 2024
2 checks passed
@okolo okolo deleted the 100-need-a-doc-on-how-to-annotate-need-for-oda-token branch July 31, 2024 06:08
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.

need a doc on how to annotate need for ODA token
3 participants