AppIdentity for Ruby

Description

AppIdentity is a Ruby implementation of the Kinetic Commerce application identity proof algorithm as described in its spec.

Synopsis

app = AppIdentity::App.new(id: id, secret: secret, version: 2)
proof = AppIdentity.generate_proof!(app)
AppIdentity.verify_proof!(proof, app)

In a Rails application, proof verification would use AppIdentity::RackMiddleware.

require 'app_identity/rack_middleware'

config.middleware.use AppIdentity::RackMiddleware,
  header: "app-identity-proof",
  finder: ->(proof) { IdentityApplication.find(proof[:id]) }

There is a Faraday Middleware for providing proof generation for clients.

Faraday.new(url: url) do |conn|
  conn.request :app_identity, app: app,
    header: 'app-proof-identity'
end

Installation

Add app_identity to your Gemfile:

gem 'app_identity', '~> 1.1'

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 Ruby welcomes contributions. This project, all Kinetic Commerce open source projects, is under the Kinetic Commerce Open Source Code of Conduct.

AppIdentity for Ruby is licensed under the Apache Licence, version 2.0 and requires certification via a Developer Certificate of Origin. See Licence.md for more details.