Skip to content

Conversation

@ivanhercaz
Copy link

@ivanhercaz ivanhercaz commented Aug 3, 2024

Hi @Quarkex!
In this PR I add the next stuff:

  1. Support bounce_to and message options in require_authorization/3.
  2. Write simple documentation for require_authorization/3 and a explain a bit how to use the plug (change a bit the README and add docs into ChalkAuthorization.Plug module.
  3. Tests... Well, I tried it haha. I just achieve to make the ones for the superuser case. It is necessary to develop a good test case to handle the other cases. I research a bit but I couldn't with my available time.
  4. Format the code with mix format.

In the docs configuration of mix.exs I added source_url and source_ref to make the module and function link to the documentation for the version selected in the HexDocs. But it requires to create a tag for each released version on GitHub, so it is necessary to:

  • Create a tag for this version: v0.1.2.
  • Create a tag for previous versions (v0.1.0 and v0.1.1) to not have broken links in Hexdocs.

I already bump the version to 0.1.2, so in case the PR is merged, don't bump it.

 This tests only checks if a user can access depending of being or not being a superuser. The tests and the test cases must be rewritten to handle all possible cases.

 I tried to test all possibilities but by lack of knowledge and confussion with testing this kind of plug/packages, I finally just do the two tests of this commit.
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