Hello community, here is the log from the commit of package rubygem-globalid for openSUSE:Factory checked in at 2017-04-20 20:58:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-globalid (Old) and /work/SRC/openSUSE:Factory/.rubygem-globalid.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-globalid" Thu Apr 20 20:58:02 2017 rev:5 rq:489035 version:0.4.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-globalid/rubygem-globalid.changes 2016-08-25 09:55:43.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-globalid.new/rubygem-globalid.changes 2017-04-20 20:58:05.387385921 +0200 @@ -1,0 +2,6 @@ +Mon Apr 17 04:32:22 UTC 2017 - [email protected] + +- updated to version 0.4.0 + no changelog found + +------------------------------------------------------------------- Old: ---- globalid-0.3.7.gem New: ---- globalid-0.4.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-globalid.spec ++++++ --- /var/tmp/diff_new_pack.LVm6Q2/_old 2017-04-20 20:58:06.319254136 +0200 +++ /var/tmp/diff_new_pack.LVm6Q2/_new 2017-04-20 20:58:06.323253570 +0200 @@ -1,7 +1,7 @@ # # spec file for package rubygem-globalid # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ # Name: rubygem-globalid -Version: 0.3.7 +Version: 0.4.0 Release: 0 %define mod_name globalid %define mod_full_name %{mod_name}-%{version} ++++++ globalid-0.3.7.gem -> globalid-0.4.0.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2016-07-26 22:35:46.000000000 +0200 +++ new/README.md 2017-04-16 17:35:16.000000000 +0200 @@ -43,10 +43,10 @@ ```ruby >> person_sgid = Person.find(1).to_signed_global_id -=> #<SignedGlobalID:0x007fea1944b410 +=> #<SignedGlobalID:0x007fea1944b410> >> person_sgid = Person.find(1).to_sgid -=> #<SignedGlobalID:0x007fea1944b410 +=> #<SignedGlobalID:0x007fea1944b410> >> person_sgid.to_s => "BAhJIh5naWQ6Ly9pZGluYWlkaS9Vc2VyLzM5NTk5BjoGRVQ=--81d7358dd5ee2ca33189bb404592df5e8d11420e" @@ -66,12 +66,12 @@ => #<Person:0x007fae94bf6298 @id="1"> ``` -You can also have SGIDs that expire some time in the future. This is useful if there's a resource, +You can also have SGIDs that expire some time in the future. Useful if there's a resource, people shouldn't have indefinite access to, like a share link. ```ruby >> expiring_sgid = Document.find(5).to_sgid(expires_in: 2.hours, for: >> 'sharing') -=> #<SignedGlobalID:0x008fde45df8937 +=> #<SignedGlobalID:0x008fde45df8937 ...> # Within 2 hours... >> GlobalID::Locator.locate_signed(expiring_sgid.to_s, for: 'sharing') @@ -82,11 +82,37 @@ => nil >> explicit_expiring_sgid = SecretAgentMessage.find(5).to_sgid(expires_at: >> Time.now.advance(hours: 1)) -=> #<SignedGlobalID:0x008fde45df8937 +=> #<SignedGlobalID:0x008fde45df8937 ...> # 1 hour later... >> GlobalID::Locator.locate_signed explicit_expiring_sgid.to_s => nil + +# Passing a false value to either expiry option turns off expiration entirely. +>> never_expiring_sgid = Document.find(5).to_sgid(expires_in: nil) +=> #<SignedGlobalID:0x008fde45df8937 ...> + +# Any time later... +>> GlobalID::Locator.locate_signed never_expiring_sgid +=> #<Document:0x007fae94bf6298 @id="5"> +``` + +Note that an explicit `:expires_at` takes precedence over a relative `:expires_in`. + +You can assign a default SGID lifetime like so: + +```ruby +SignedGlobalID.expires_in = 1.month +``` + +This way any generated SGID will use that relative expiry. + +In Rails, an auto-expiry of 1 month is set by default. You can alter that deal +in an initializer with: + +```ruby +# config/initializers/global_id.rb +Rails.application.config.global_id.expires_in = 3.months ``` ### Custom App Locator Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/global_id/railtie.rb new/lib/global_id/railtie.rb --- old/lib/global_id/railtie.rb 2016-07-26 22:35:46.000000000 +0200 +++ new/lib/global_id/railtie.rb 2017-04-16 17:35:16.000000000 +0200 @@ -22,7 +22,7 @@ config.after_initialize do app.config.global_id.verifier ||= begin - app.message_verifier(:signed_global_ids) + GlobalID::Verifier.new(app.key_generator.generate_key('signed_global_ids')) rescue ArgumentError nil end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/global_id/verifier.rb new/lib/global_id/verifier.rb --- old/lib/global_id/verifier.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/global_id/verifier.rb 2017-04-16 17:35:16.000000000 +0200 @@ -0,0 +1,15 @@ +require 'active_support' +require 'active_support/message_verifier' + +class GlobalID + class Verifier < ActiveSupport::MessageVerifier + private + def encode(data) + ::Base64.urlsafe_encode64(data) + end + + def decode(data) + ::Base64.urlsafe_decode64(data) + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/global_id.rb new/lib/global_id.rb --- old/lib/global_id.rb 2016-07-26 22:35:46.000000000 +0200 +++ new/lib/global_id.rb 2017-04-16 17:35:16.000000000 +0200 @@ -5,4 +5,5 @@ class GlobalID autoload :Locator, 'global_id/locator' autoload :Identification, 'global_id/identification' + autoload :Verifier, 'global_id/verifier' end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2016-07-26 22:35:46.000000000 +0200 +++ new/metadata 2017-04-16 17:35:16.000000000 +0200 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: globalid version: !ruby/object:Gem::Version - version: 0.3.7 + version: 0.4.0 platform: ruby authors: - David Heinemeier Hansson autorequire: bindir: bin cert_chain: [] -date: 2016-07-26 00:00:00.000000000 Z +date: 2017-04-16 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: activesupport @@ -16,14 +16,14 @@ requirements: - - ">=" - !ruby/object:Gem::Version - version: 4.1.0 + version: 4.2.0 type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version - version: 4.1.0 + version: 4.2.0 - !ruby/object:Gem::Dependency name: rake requirement: !ruby/object:Gem::Requirement @@ -53,6 +53,7 @@ - lib/global_id/railtie.rb - lib/global_id/signed_global_id.rb - lib/global_id/uri/gid.rb +- lib/global_id/verifier.rb - lib/globalid.rb homepage: http://www.rubyonrails.org licenses: @@ -74,7 +75,7 @@ version: '0' requirements: [] rubyforge_project: -rubygems_version: 2.4.5.1 +rubygems_version: 2.6.11 signing_key: specification_version: 4 summary: 'Refer to any model with a URI: gid://app/class/id'
