Skip to content

Latest commit

 

History

History
103 lines (76 loc) · 2.63 KB

README.md

File metadata and controls

103 lines (76 loc) · 2.63 KB

AppIdentity for Elixir

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"}
  ]
end

Installation

The package can be installed by adding app_identity to your list of dependencies in mix.exs:

def deps do
  [
    {:app_identity, "~> 1.3"}
  ]
end

If 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"}
  ]
end

If on Elixir 1.13 or later, you can use :subdir instead:

def deps do
  [
    {:app_identity, github: "KineticCafe/app_identity", subdir: "elixir"}
  ]
end

Optional 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 License, version 2.0 and requires certification of a Developer Certificate of Origin. See Licence for more details.