Deprecate is_write_action and write_permission=True when login #2632
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(slightly related to #2631)
This PR takes care of removing any local checks related to tokens. Since finegrained and oauth tokens exist, we don't have a simple distinction between "read" and "write" permission, making a few features useless and outdated in the codebase.
This PR:
is_write_action
inbuild_hf_headers
=> this argument has close to no usage at all and complexifies the API for nothing. Its first purpose in #1064 was to raise an exception if a local token was not find and the HTTP call specifically needed a token (what I wrongly called "a write action" instead of "an authenticated action"). In the end it's much simpler if we let the server raise the exception when appropriate.
For context, before #1064, we had a distinction between "write actions" and "not write actions" in the sense that only "write actions" was using a token. All read actions where unauthenticated (even if a token was locally saved) which caused troubles when stable diffusion was released as a gated repo where even a read needed authentication. Since then, the locally saved token is always sent to the server if it exists.
write_permission
inlogin
/notebook_login
/interpreter_login
helpers=> with finegrained tokens, it doesn't make sense anymore to require a "write" token. Added in #1476.
login
/notebook_login
/interpreter_login
helpers=> otherwise we won't be able to remove them. Always better to enforce keyword arguments for future maintenance.