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

Enhance plugins and security modules #264

Merged
merged 2 commits into from Feb 17, 2024
Merged

Enhance plugins and security modules #264

merged 2 commits into from Feb 17, 2024

Conversation

burbas
Copy link
Contributor

@burbas burbas commented Feb 17, 2024

Before a plugin-function is called we check if it has arity 2 or 3. If it's 3 we include Env as the second argument.

This also introduce a mechanism to send replies to the caller by returning term of type reply() defined below.

-type reply() :: {reply, Body :: iolist() | binary()} | 
                          {reply, Status :: integer(), Body :: iolist() | binary() |
                          {reply, Status :: integer(), Headers :: [{binary(), binary()}], Body :: iolist() | binary()

Also enriches the return object from a security-module.

Instead of returning {false, Headers} one can now return three different options:

{false, Headers :: map()} |
{false, StatusCode :: integer(), Headers :: map()} |
{false, StatusCode :: integer(), Headers :: map(), Body :: iolist() | binary()}

@burbas burbas added the enhancement New feature or request label Feb 17, 2024
@burbas burbas self-assigned this Feb 17, 2024
@burbas burbas requested a review from Taure as a code owner February 17, 2024 18:53
@burbas burbas changed the title Enhance plugins Enhance plugins and security modules Feb 17, 2024
@Taure Taure merged commit 4bf4800 into master Feb 17, 2024
3 checks passed
@Taure Taure deleted the plugin-env branch February 17, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants