Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.
This repository was archived by the owner on Jul 18, 2024. It is now read-only.

Feature: Allow specifying authorization information for servers #154

@makisukurisu

Description

@makisukurisu

Type

Functionality

Issue

Currently, there is no way to specify authorization information for servers to allow access to certain features and/or tags.
For example, Danbooru has subscriptions which require authorization, such as search for more than 2 tags, and access to certain tags (+- some additional features).

Feature

At "worst" — allow specifying the Authorization header.

And at best — a proper support for auth* is desired. For example, for Danbooru, you have to specify a username and API key which are then converted to Basic Authentication header value, which is sent alongside the request.

Additional context

It'd be great to show additional context for errors, like error 422 on Danbooru, which clearly sates the reason of the error:

{"success":false,"error":"PostQuery::TagLimitError","message":"You cannot search for more than 2 tags at a time.","backtrace":["app/logical/post_query.rb:307:in `validate_tag_limit!\'","app/logical/post_sets/post.rb:108:in `posts\'","app/controllers/posts_controller.rb:24:in `index\'","app/logical/rack_server_timing.rb:19:in `call\'"]}

Because right now all I see is "Cannot get result from Danbooru (HTTP 422)", which is a code for Unprocessable Content, but on Danbooru (according to API docs) it's used like "422 Locked: The resource is locked and cannot be modified".

This led me to believe that there are some errors in tags conversion with order/score filters (because usually, they add up to >2 “tags” per search)

If it's OK, I may contribute to the project by implementing this feature, unless it's already in the works. (Though, it may take me a while since I have other work to do, and I'm new to Dart)

Acknowledgements

  • I have searched the existing issues and this is a new and no duplicate or related to another open issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions