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

HTTPie Auth Store #32

Merged
merged 5 commits into from
Jun 20, 2024
Merged

HTTPie Auth Store #32

merged 5 commits into from
Jun 20, 2024

Conversation

ikalnytskyi
Copy link
Owner

No description provided.

@ikalnytskyi ikalnytskyi force-pushed the feat/auth-store branch 2 times, most recently from 911f23a to 1b76eec Compare June 19, 2024 23:49
Apparently CI has been completely broken I don't know how long due to
pipx using the python interpreter it was installed for, instead of using
the one we specifically prepared for tests. This patch uses python3
alias to install tox and run tests, which must guarantee proper python
interpreter.
The auth store seems to more correctly reflect what is this plugin
about. Taking into account that I plan to introduce a bunch of changes
w/o preserving backward compatibility, it sounds like a good idea to
publish a new version under a new name.

This patch also drops deprecated 'creds' and 'credential-store' auth
types because the plan is to introduce backward incompatible changes
anyway.
First version of the auth store lacked two major features: (1) it was
impossible to share secrets between auth bindings, and (2) it was
impossible to define an auth binding to many resources (URLs)
simultaneously. In addition to that, it contained a bunch of nested
blocks which were hard to write and mantain.

New, second version of the auth store is designed to address those
concerns by (1) separating secrets from auth bindings, (2) reducing
nesting level, and (3) supporting multiple resources (URLs) per auth
binding.

    {
        "bindings": [
            {
                "auth_type": "bearer",
                "auth": "$GITHUB_TOKEN",
                "resources": ["https://api.github.com/"]
            }
        ],
        "secrets": {
            "GITHUB_TOKEN": {
                "provider": "system",
                "service": "github.com",
                "username": "ikalnytskyi"
            }
        }
    }

This patch also delivers a significant internal refactoring. The most
notable change is that "types" are enforced internally instead of
dealing with dictionaries around. I don't think performance is going to
be an issue here. :)
The plugin is changed significantly and even changed its name. It's
about time to reflect that in the README file. The conversion to
Markdown just happened along the way because Markdown is a more popular
choice, and because GitHub's Markdown flavour goes a long way to improve
original syntax.
In order to ease managing of auth entries and give some examples to end
users, instead of asking them to create the auth store themselves, we
better create one automatically.
@ikalnytskyi ikalnytskyi merged commit bb162e6 into master Jun 20, 2024
8 checks passed
@ikalnytskyi ikalnytskyi deleted the feat/auth-store branch June 20, 2024 21:04
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.

1 participant