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

Features/x www form urlencoded #97

Merged
merged 13 commits into from
Jan 20, 2024
Merged

Conversation

mardiros
Copy link
Owner

Create a way to register request that can be serialized url encoded,

To acchive it, add the content type as a default in the Request.

from blacksmith import HeaderField, PostBodyField, Request, Response, register
from pydantic import SecretStr


class CreateToken(Request):
    content_type: str = HeaderField(
        alias="Content-Type", default="application/x-www-form-urlencoded"
    )
    client_id: str = PostBodyField(...)
    client_secret: SecretStr = PostBodyField(...)
    grant_type: str = PostBodyField(...)
    code: SecretStr | None = PostBodyField(default=None)
    refresh_token: SecretStr | None = PostBodyField(default=None)

@mardiros mardiros force-pushed the features/x-www-form-urlencoded branch from 1a1ab6c to dd2d49c Compare January 20, 2024 14:47
@mardiros mardiros force-pushed the features/x-www-form-urlencoded branch from dd2d49c to 6589e6e Compare January 20, 2024 16:31
@mardiros mardiros force-pushed the features/x-www-form-urlencoded branch from 306272a to c9b6aa4 Compare January 20, 2024 17:52
Copy link

codecov bot commented Jan 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f5388ad) 100.00% compared to head (79ca6d7) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #97   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           47        48    +1     
  Lines         1668      1720   +52     
=========================================
+ Hits          1668      1720   +52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mardiros mardiros merged commit 0d04d2b into main Jan 20, 2024
8 checks passed
@mardiros mardiros deleted the features/x-www-form-urlencoded branch January 21, 2024 22:17
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