Giter VIP home page Giter VIP logo

elixir-kitten-blue's Introduction

KittenBlue

Actions Status

KittenBlue is a JOSE wrapper library that makes JWT implementation simpler.

  • KittenBlue.JWK : Structure containing kid, alg, JOSE.JWK and handling functions
    • KittenBlue.JWK.Google : JWK Handling module for Google Public JWKs
    • KittenBlue.JWK.Apple : JWK Handling module for Apple Public JWKs
  • KittenBlue.JWS : JOSE.JWS wrappter functions using KittenBlue.JWK
  • KittenBlue.JWE : (Future Work) JOSE.JWE wrappter functions using KittenBlue.JWK
  • KittenBlue.JWT : functions to handle JWT Claims

Installation

If available in Hex, the package can be installed by adding kitten_blue to your list of dependencies in mix.exs:

def deps do
  [
    {:kitten_blue, "~> 0.9"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/kitten_blue.

elixir-kitten-blue's People

Contributors

enerick avatar k-asm avatar ritou avatar

Watchers

 avatar  avatar

Forkers

enerick k-asm

elixir-kitten-blue's Issues

Remove dependency on HTTPoison

#15 (review)

BTW, I noticed that this line forces the HTTP client to HTTPoison. (I guess the HTTP client configuration is for Mox, though.)

It needs to make the HTTP Client response more generic.

Add header parameter when generating signature

Currently, only Payload is specified as an argument when generating JWS.

@spec sign(payload :: map, key :: KittenBlue.JWK.t()) :: {:ok, String.t()} | {:error, :invalid_key}
def sign(payload, key = %KittenBlue.JWK{}) do

It is necessary to extend to be able to specify header parameters other than alg and kid included in KittenBlue.JWK.

@spec sign(payload :: map, key :: KittenBlue.JWK.t(), other_header_params :: map) :: {:ok, String.t()} | {:error, :invalid_key}
def sign(payload, key = %KittenBlue.JWK{}, other_header_params \\ %{}) do

Support more famous IdP's jwks_uri

Currently, this library supports retrieval of public keys from Google and Apple's jwks_uri.
In the future, if this library supports other IdPs, I need to describe the contribution in the KittenBlue.JWK documentation.

Define and lookup main Key for issue JWS

From the list of keys held by Config, make it possible to clearly specify and refer to the "Main Key" used for issuance.

This omits the following processing.

@iss_key Enum.find(@config_keys, fn kb_jwk -> kb_jwk.kid == @config_kid end)

httpoison related warnings at Compiling

warning: HTTPoison.request/5 defined in application :httpoison is used by the current application but the current application does not depend on :httpoison. To fix this, you must do one of:

  1. If :httpoison is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :httpoison is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :httpoison, you may optionally skip this warning by adding [xref: [exclude: [HTTPoison]]] to your "def project" in mix.exs

lib/kitten_blue/jwk.ex:247: KittenBlue.JWK.fetch!/1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.