macaroons 0.6.3 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 08d3a8b767a9be462228f92c22fa97db3be91a0b
4
- data.tar.gz: c217878cbaae5c4e36f9ba4bcb1fcd22a3594832
3
+ metadata.gz: 12077081feaaf8fc5433f0ad4b46dfbc37d740fc
4
+ data.tar.gz: eb5b5f1d3028790cebd36e218233cf0d5c4df5c3
5
5
  SHA512:
6
- metadata.gz: b620e558ca340937d4b5dd59c3cff42049c2bc45f014e86b27e90de1fea67630c23584153037c9e1f10ce4de317bbf61136e4a599fac6a45142299db3c81ae5a
7
- data.tar.gz: 7ed1c8c1dd7d5e38d48ce82c68f8645a72d520f881e57b1e09737adf6415a5841fcfd22f71d4ca240df97c1e72789f079e478eefa37dca96cb9f63c98dbb1b63
6
+ metadata.gz: b6e419caf63482deeda7157835841f35d5dcdf7a1f7ade2e668a760801ee1615ebb4b140987a7305d5387161a7264448095ab459532cf4b2f26e7b095149d31f
7
+ data.tar.gz: 3f107670dd47a75d3ec007d7263b4536ee439e80f91c95a0b99a6c84689679bc174e6ffc10037335bd153ffa71301262a5f7fd5f9ce5e2bef2dd6cc49ad8380f
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Coverage Status](https://img.shields.io/coveralls/localmed/ruby-macaroons.svg)](https://coveralls.io/r/localmed/ruby-macaroons?branch=master)
4
4
  [![Gem Version](https://badge.fury.io/rb/macaroons.svg)](http://badge.fury.io/rb/macaroons)
5
5
 
6
- This is a Ruby implementation of Macaroons. It is still under active development but is in a useable state - please report any bugs in the issue tracker.
6
+ This is a Ruby implementation of macaroons. The implementation is stable but should be considered temporary, pending any standardization attempts around macaroons.
7
7
 
8
8
  ## What is a Macaroon?
9
9
  Macaroons, like cookies, are a form of bearer credential. Unlike opaque tokens, macaroons embed *caveats* that define specific authorization requirements for the *target service*, the service that issued the root macaroon and which is capable of verifying the integrity of macaroons it recieves.
@@ -14,54 +14,42 @@ Simple examples are outlined below. For more in-depth examples check out the [fu
14
14
 
15
15
  ## Installing
16
16
 
17
- Macaroons requires a sodium library like libsodium or tweetnacl to be installed on the host system.
17
+ The macaroon implementation is pure Ruby, but relies on [rbnacl-libsodium](https://github.com/cryptosphere/rbnacl-libsodium) to provide strong cryptographic primitives.
18
18
 
19
- To install [libsodium](https://github.com/jedisct1/libsodium):
19
+ Install with:
20
20
 
21
- For OS X users, libsodium is available via homebrew and can be installed with:
22
-
23
- brew install libsodium
24
-
25
- For other systems, please see the [libsodium documentation](http://doc.libsodium.org/).
26
-
27
- ### Macaroons gem
28
-
29
- Once you have libsodium installed, add this line to your application's Gemfile:
30
-
31
- gem 'macaroons'
32
-
33
- And then execute:
34
-
35
- $ bundle
36
-
37
- Or install it manually:
38
-
39
- $ gem install macaroons
21
+ ```
22
+ gem install macaroons
23
+ ```
40
24
 
41
- Inside of your Ruby program:
25
+ And then import it into your Ruby program:
42
26
 
43
- require 'macaroons'
27
+ ```ruby
28
+ require 'macaroons'
29
+ ```
44
30
 
45
31
  ## Quickstart
46
32
 
47
- key => Very secret key used to sign the macaroon
48
- identifier => An identifier, to remind you which key was used to sign the macaroon
49
- location => The location at which the macaroon is created
33
+ ```ruby
34
+ key => Very secret key used to sign the macaroon
35
+ identifier => An identifier, to remind you which key was used to sign the macaroon
36
+ location => The location at which the macaroon is created
50
37
 
51
- # Construct a Macaroon.
52
- m = Macaroon.new(key: key, identifier: identifier, location: 'http://foo.com')
38
+ # Construct a Macaroon.
39
+ m = Macaroon.new(key: key, identifier: identifier, location: 'http://foo.com')
53
40
 
54
- # Add first party caveat
55
- m.add_first_party_caveat('caveat_1')
41
+ # Add first party caveat
42
+ m.add_first_party_caveat('caveat_1')
56
43
 
57
- # List all first party caveats
58
- m.first_party_caveats
44
+ # List all first party caveats
45
+ m.first_party_caveats
59
46
 
60
- # Add third party caveat
61
- m.add_third_party_caveat('caveat_key', 'caveat_id', 'http://foo.com')
47
+ # Add third party caveat
48
+ m.add_third_party_caveat('caveat_key', 'caveat_id', 'http://foo.com')
62
49
 
63
- # List all third party caveats
64
- m.third_party_caveats
50
+ # List all third party caveats
51
+ m.third_party_caveats
52
+ ```
65
53
 
66
54
  ## Example with first- and third-party caveats
67
55
 
@@ -118,4 +106,4 @@ PyMacaroons, libmacaroons, and Ruby-Macaroons all use the same underlying crypto
118
106
  - [Mozilla Macaroon Tech Talk](https://air.mozilla.org/macaroons-cookies-with-contextual-caveats-for-decentralized-authorization-in-the-cloud/)
119
107
  - [libmacaroons](https://github.com/rescrv/libmacaroons)
120
108
  - [PyMacaroons](https://github.com/ecordell/pymacaroons)
121
- - [libnacl](https://github.com/saltstack/libnacl)
109
+ - [rbnacl-libsodium](https://github.com/cryptosphere/rbnacl-libsodium)
@@ -1,6 +1,6 @@
1
1
  require 'base64'
2
2
 
3
- require 'rbnacl'
3
+ require 'rbnacl/libsodium'
4
4
 
5
5
  require 'macaroons/caveat'
6
6
  require 'macaroons/utils'
@@ -1,4 +1,4 @@
1
- require 'rbnacl'
1
+ require 'rbnacl/libsodium'
2
2
 
3
3
  require 'macaroons/errors'
4
4
 
@@ -1,3 +1,3 @@
1
1
  module Macaroons
2
- VERSION = '0.6.3'
2
+ VERSION = '0.7.0'
3
3
  end
data/macaroons.gemspec CHANGED
@@ -17,7 +17,8 @@ Gem::Specification.new do |spec|
17
17
  spec.require_paths = ["lib"]
18
18
  spec.required_ruby_version = "~> 2.0"
19
19
  spec.add_dependency "multi_json", "~> 1.10.1"
20
- spec.add_dependency "rbnacl", "~> 3.1.2"
20
+ spec.add_dependency "rbnacl", "~> 3.2"
21
+ spec.add_dependency "rbnacl-libsodium", "~> 1.0"
21
22
 
22
23
  spec.add_development_dependency "bundler", "> 1.3"
23
24
  spec.add_development_dependency "rake"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: macaroons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Cordell
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-10-15 00:00:00.000000000 Z
13
+ date: 2015-12-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
@@ -32,14 +32,28 @@ dependencies:
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: 3.1.2
35
+ version: '3.2'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: 3.1.2
42
+ version: '3.2'
43
+ - !ruby/object:Gem::Dependency
44
+ name: rbnacl-libsodium
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '1.0'
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '1.0'
43
57
  - !ruby/object:Gem::Dependency
44
58
  name: bundler
45
59
  requirement: !ruby/object:Gem::Requirement