{"id":28388852,"url":"https://github.com/ianleeclark/paseto_plug","last_synced_at":"2025-06-27T07:32:08.930Z","repository":{"id":48290301,"uuid":"138678132","full_name":"Ianleeclark/paseto_plug","owner":"Ianleeclark","description":"A Paseto (Platform Agnostic SEcurity Token) plug for Phoenix Authentication","archived":false,"fork":false,"pushed_at":"2021-08-03T04:49:07.000Z","size":66,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-25T14:49:11.745Z","etag":null,"topics":["elixir","paseto","security"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ianleeclark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-26T03:08:05.000Z","updated_at":"2024-06-26T08:54:27.000Z","dependencies_parsed_at":"2022-08-28T02:41:20.950Z","dependency_job_id":null,"html_url":"https://github.com/Ianleeclark/paseto_plug","commit_stats":null,"previous_names":["grappigpanda/paseto_plug"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Ianleeclark/paseto_plug","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ianleeclark%2Fpaseto_plug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ianleeclark%2Fpaseto_plug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ianleeclark%2Fpaseto_plug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ianleeclark%2Fpaseto_plug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ianleeclark","download_url":"https://codeload.github.com/Ianleeclark/paseto_plug/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ianleeclark%2Fpaseto_plug/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262212618,"owners_count":23275963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","paseto","security"],"created_at":"2025-05-30T23:16:21.564Z","updated_at":"2025-06-27T07:32:08.923Z","avatar_url":"https://github.com/Ianleeclark.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/GrappigPanda/paseto_plug/tree/master.svg?style=svg)](https://circleci.com/gh/GrappigPanda/paseto_plug/tree/master)\n[![Hex.pm](https://img.shields.io/hexpm/v/paseto_plug.svg)](https://hex.pm/packages/paseto_plug)\n[HexDocs](https://hexdocs.pm/paseto_plug/api-reference.html)\n\n# paseto_plug\n\nA Phoenix authentication plug that validates Paseto (Platform Agnostic Security Tokens).\n\n## Installation\n\nThis package can be installed by adding `paseto_plug` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:paseto_plug, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n## Considerations for using this library\n\nThere are a few library/binary requirements required in order for the Paseto \nlibrary to work on any computer:\n1. Erlang version \u003e= 20.1\n    * This is required because this was the first Erlang version to introduce\n      crypto:sign/5.\n2. libsodium \u003e= 1.0.13 \n    * This is required for cryptography used in Paseto.\n    * This can be found at https://github.com/jedisct1/libsodium\n3. openssl \u003e= 1.1 \n    * This is needed for XChaCha-Poly1305 used for V2.Local Paseto\n\n## Using the plug\n\nThis plug, solely, handles taking a Paseto and validating it was issued by your key(-pair).\nShould you need more information on generating a Paseto, take a look at my other project over here:\nhttps://github.com/GrappigPanda/paseto\n\nSo, in order to use the plug, you will need to include the following in your `router.ex` file.\n\n```elixir\nplug PasetoPlug, key_provider: \u0026KeyProvider.get_key/0\n```\n\nMoreover, you will need to write a key provider module + function. This can be as simple as the following:\n\n```elixir\ndefmodule KeyProvider do\n  def get_key() do\n    \"safe_key\"\n  end\nend\n```\n\nNow, whenever a request goes through, the requester will either face a 401 (if they have an invalid paseto) or your `conn` will have a new `:claims` key in the `assigns` map.\n\n```elixir\n# You can grab it by using\nconn.assigns.claims\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianleeclark%2Fpaseto_plug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianleeclark%2Fpaseto_plug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianleeclark%2Fpaseto_plug/lists"}