View Source AppIdentity for Elixir
- code :: https://github.com/KineticCafe/app-identity/tree/main/elixir
- issues :: https://github.com/KineticCafe/app-identity/issues
Description
AppIdentity is an Elixir implementation of the Kinetic Commerce application identity proof algorithm as described in its spec.
Synopsis
app = %{id: id, secret: secret, version: 2}
proof = AppIdentity.generate_proof(app)
AppIdentity.verify_proof(proof, app)There is a Plug available for authenticating applications, AppIdentity.Plug.
plug AppIdentity.Plug,
headers: ["app-identity-proof"],
finder: fn %{id: id} = _proof -> IdentityApplications.get(id) end
There is a Tesla Middleware for providing proof generation for clients.
def client(app) do
middleware = [
{AppIdentity.TeslaMiddleware, identity_app: app, header: "app-identity-proof"}
]
endInstallation
The package can be installed by adding app_identity to your list of
dependencies in mix.exs:
def deps do
[
{:app_identity, "~> 1.3"}
]
endIf you need to use a pre-release version, the dependency structure is slightly different:
def deps do
[
{:app_identity, github: "KineticCafe/app_identity", sparse: "elixir"}
]
endIf on Elixir 1.13 or later, you can use :subdir instead:
def deps do
[
{:app_identity, github: "KineticCafe/app_identity", subdir: "elixir"}
]
endOptional features are present when Plug and/or Tesla are part of your application.
Documentation can found at HexDocs or generated with ex_doc.
Semantic Versioning
AppIdentity uses a Semantic Versioning scheme with one significant change:
- When PATCH is zero (
0), it will be omitted from version references.
Additionally, the major version will generally be reserved for specification revisions.
Contributing
AppIdentity for Elixir welcomes contributions. This project, like all Kinetic Commerce open source projects, is under the Kinetic Commerce Open Source Code of Conduct.
AppIdentity for Elixir is licensed under the Apache Licence, version 2.0 and requires certification of a Developer Certificate of Origin. See Licence.md for more details.