stbaldricks 9.3.0 → 9.3.1.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec1403cfa67ecf5b7dadd9971360fea591bb6e9a6247a694c5b7a1ca98ff4c19
4
- data.tar.gz: efcded213ca02b7e69387c225d6b45b99d4721fab4cb3ded9fe808d72c6a5df3
3
+ metadata.gz: 59f44d481829edb509fcd44e0e044f175428db8ff20a1ce0c40a34c508cc29db
4
+ data.tar.gz: a37fada058b88f5f6256a7d763d50a914ce92f042b152ae9dda173056ea5ec84
5
5
  SHA512:
6
- metadata.gz: 50310e43fc9a815f454d4a29ce2921bf6e13dd2742a0379bb2cf352b7b69383224529a2c14008a72be9b17ab78a71a4d070d50edd05718b40fbaea7930e279b7
7
- data.tar.gz: 5e70c0e116c1efae1e7826062bf0f224554eeaec1e5c66d65ba1839b1ba6b5842150c2a1fc6426fef858d82b1aad0624aae65d8a2848ac7f0dd2c0aceb5a954c
6
+ metadata.gz: 9d452c8a0c7fba9cdf1065253da4796a38cf6251d30200bf98a2d364bd72f91cf29c7f3c766698ec7e4a2f516c4c74d6fef045cde78d523852e597039973271f
7
+ data.tar.gz: 0556ace2d616357fd5f4993c2562619c6988ddb4bd338d879c7f39e278ef92bb91688d477b51f967b91d06dae7ed75661310556175f0517c84e82c5ef65e5605
@@ -12,7 +12,7 @@ module SBF
12
12
 
13
13
  class << self
14
14
  attr_writer :base_uri, :user_token, :general_token, :request_id
15
- attr_accessor :user_token
15
+ attr_accessor :user_token, :forwarded_for
16
16
  end
17
17
 
18
18
  def self.base_uri
@@ -1,8 +1,19 @@
1
1
  require 'stbaldricks/endpoints/lib/entity'
2
+ require 'ipaddr'
2
3
 
3
4
  module SBF
4
5
  module Client
5
6
  class DonationEndpoint < SBF::Client::EntityEndpoint
7
+ def create(entity_or_hash, with = {})
8
+ unless SBF::Client::Configuration.forwarded_for
9
+ SBF::Client::LOG.warn {
10
+ "SBF::Client No forwarded_for configured for the client on the donation create route. \
11
+ This may cause your app to be blocked from creating donations if too many errors occur."
12
+ }
13
+ end
14
+ super
15
+ end
16
+
6
17
  def external_sync(data)
7
18
  response = SBF::Client::Api::Request.post_request("#{base_uri}/external_sync", data)
8
19
 
@@ -73,7 +73,7 @@ module SBF
73
73
  end
74
74
  SBF::Client::Configuration.user_token = nil
75
75
 
76
- SBF::Client::LOG.info { "SB::Client - Change Password for user with profile_id: #{profile_id}" }
76
+ SBF::Client::LOG.info { "SBF::Client - Change Password for user with profile_id: #{profile_id}" }
77
77
  SBF::Client::Api::Response.new(http_code: response.code, data: nil, error: error)
78
78
  end
79
79
 
@@ -95,7 +95,7 @@ module SBF
95
95
  error = SBF::Client::ErrorEntity.new(parsed_response)
96
96
  end
97
97
 
98
- SBF::Client::LOG.info { "SB::Client - Disconnecting Facebook user with profile_id: #{profile_id}" }
98
+ SBF::Client::LOG.info { "SBF::Client - Disconnecting Facebook user with profile_id: #{profile_id}" }
99
99
  SBF::Client::Api::Response.new(http_code: response.code, data: nil, error: error)
100
100
  end
101
101
  end
@@ -68,12 +68,15 @@ module SBF
68
68
 
69
69
  def self.options(auth: nil, type: :get, query: nil, body: nil)
70
70
  {}.tap do |options|
71
- options.merge!(base_uri: SBF::Client::Configuration.base_uri,
72
- headers: {
73
- 'Accept' => 'application/json',
74
- 'X-Request-Id' => SBF::Client::Configuration.request_id
75
- },
76
- verify: verify_ssl_peer?)
71
+ options.merge!(
72
+ base_uri: SBF::Client::Configuration.base_uri,
73
+ headers: {}.tap do |hsh|
74
+ hsh['Accept'] = 'application/json'
75
+ hsh['X-Request-Id'] = SBF::Client::Configuration.request_id
76
+ hsh['X-Forwarded-For'] = SBF::Client::Configuration.forwarded_for unless SBF::Client::Configuration.forwarded_for.blank?
77
+ end,
78
+ verify: verify_ssl_peer?
79
+ )
77
80
  options[:body] = body if body
78
81
  options[:query] = query if query
79
82
  options[:headers]['Content-Type'] = 'application/json' if type == :post
@@ -1,5 +1,5 @@
1
1
  module SBF
2
2
  module Client
3
- VERSION = '9.3.0'
3
+ VERSION = '9.3.1.alpha.1'
4
4
  end
5
5
  end
@@ -9,7 +9,7 @@ FactoryBot.define do
9
9
  end
10
10
 
11
11
  status { SBF::Client::Challenge::Status::PENDING }
12
- end_date { Date.today + 30 }
12
+ end_date { [Date.today + 30, Date.new(Date.today.year, 12, 31)].min }
13
13
 
14
14
  after :build do |challenge, evaluator|
15
15
  challenge.challenger = build(:challenger) if unpopulated?(evaluator, :challenger)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stbaldricks
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.3.0
4
+ version: 9.3.1.alpha.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-04 00:00:00.000000000 Z
11
+ date: 2019-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -538,9 +538,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
538
538
  version: '0'
539
539
  required_rubygems_version: !ruby/object:Gem::Requirement
540
540
  requirements:
541
- - - ">="
541
+ - - ">"
542
542
  - !ruby/object:Gem::Version
543
- version: '0'
543
+ version: 1.3.1
544
544
  requirements: []
545
545
  rubygems_version: 3.0.3
546
546
  signing_key:
@@ -548,98 +548,98 @@ specification_version: 4
548
548
  summary: St. Baldrick's Foundation Ruby Client Library
549
549
  test_files:
550
550
  - lib/stbaldricks_factories.rb
551
- - spec/factories/lib/faker_patch.rb
552
- - spec/factories/lib/helpers.rb
553
- - spec/factories/participant/rankings/ranking.rb
554
- - spec/factories/participant/totals.rb
555
- - spec/factories/participant/photos.rb
556
- - spec/factories/participant/roles.rb
557
- - spec/factories/participant/policies.rb
558
- - spec/factories/participant/roles/role.rb
559
- - spec/factories/participant/rankings.rb
560
- - spec/factories/event/totals.rb
561
- - spec/factories/event/photos.rb
562
- - spec/factories/event/contacts/name_pieces.rb
563
- - spec/factories/event/contacts/contact.rb
564
- - spec/factories/event/contacts.rb
565
- - spec/factories/event/venue/location.rb
566
- - spec/factories/event/venue/social.rb
567
- - spec/factories/event/coach_tracking.rb
568
- - spec/factories/event/coach_tracking/plaque.rb
569
- - spec/factories/event/coach_tracking/proceeds.rb
570
- - spec/factories/event/coach_tracking/coaching_interactions.rb
571
- - spec/factories/event/venue.rb
551
+ - spec/factories/collection.rb
552
+ - spec/factories/user.rb
572
553
  - spec/factories/organization/addresses.rb
573
554
  - spec/factories/organization/email_addresses.rb
574
555
  - spec/factories/organization/phone_numbers.rb
575
- - spec/factories/shave_schedule.rb
576
- - spec/factories/treatment_status.rb
577
- - spec/factories/search_team.rb
578
- - spec/factories/search_event.rb
556
+ - spec/factories/search_participant.rb
557
+ - spec/factories/location.rb
558
+ - spec/factories/email_address.rb
559
+ - spec/factories/grant_institution.rb
560
+ - spec/factories/response.rb
561
+ - spec/factories/fundraising_page.rb
579
562
  - spec/factories/grant.rb
563
+ - spec/factories/campaign.rb
580
564
  - spec/factories/donor.rb
565
+ - spec/factories/kid_institution.rb
566
+ - spec/factories/shave_schedule.rb
567
+ - spec/factories/donation/participant.rb
568
+ - spec/factories/person/addresses.rb
569
+ - spec/factories/person/email_addresses.rb
570
+ - spec/factories/person/policies.rb
571
+ - spec/factories/person/phone_numbers.rb
581
572
  - spec/factories/photo.rb
582
- - spec/factories/event_supporter.rb
573
+ - spec/factories/event_application.rb
574
+ - spec/factories/kid.rb
583
575
  - spec/factories/event.rb
584
- - spec/factories/fund.rb
576
+ - spec/factories/donation.rb
577
+ - spec/factories/kid_honor.rb
578
+ - spec/factories/message.rb
579
+ - spec/factories/memorial/photos.rb
580
+ - spec/factories/memorial/tribute.rb
581
+ - spec/factories/memorial/totals.rb
582
+ - spec/factories/photos.rb
583
+ - spec/factories/kid/custom_institution.rb
585
584
  - spec/factories/phone.rb
585
+ - spec/factories/campaign/totals.rb
586
+ - spec/factories/page.rb
587
+ - spec/factories/newsletter_recipient.rb
588
+ - spec/factories/memorial.rb
586
589
  - spec/factories/institution.rb
587
- - spec/factories/donation/participant.rb
588
- - spec/factories/kid.rb
589
- - spec/factories/organization.rb
590
590
  - spec/factories/participant.rb
591
- - spec/factories/shave_schedule/time_selection_permissions.rb
592
- - spec/factories/recurring_gift.rb
593
- - spec/factories/team/rankings/ranking.rb
594
- - spec/factories/team/totals.rb
595
- - spec/factories/team/photos.rb
596
- - spec/factories/team/rankings.rb
597
- - spec/factories/collection.rb
591
+ - spec/factories/address.rb
592
+ - spec/factories/contact_group.rb
593
+ - spec/factories/venue.rb
594
+ - spec/factories/permissions.rb
595
+ - spec/factories/participant/rankings/ranking.rb
596
+ - spec/factories/participant/photos.rb
597
+ - spec/factories/participant/roles.rb
598
+ - spec/factories/participant/roles/role.rb
599
+ - spec/factories/participant/totals.rb
600
+ - spec/factories/participant/rankings.rb
601
+ - spec/factories/participant/policies.rb
598
602
  - spec/factories/diagnosis.rb
599
603
  - spec/factories/researcher.rb
600
- - spec/factories/memorial.rb
601
- - spec/factories/memorial/totals.rb
602
- - spec/factories/memorial/photos.rb
603
- - spec/factories/memorial/tribute.rb
604
- - spec/factories/name_pieces.rb
605
- - spec/factories/location.rb
606
- - spec/factories/photos.rb
607
- - spec/factories/address.rb
608
- - spec/factories/event_application.rb
609
- - spec/factories/search_participant.rb
610
- - spec/factories/message.rb
611
- - spec/factories/kid_institution.rb
612
- - spec/factories/fundraiser.rb
613
- - spec/factories/user.rb
614
- - spec/factories/fundraising_page.rb
615
- - spec/factories/campaign.rb
604
+ - spec/factories/contact.rb
605
+ - spec/factories/organization.rb
606
+ - spec/factories/search_fundraiser.rb
616
607
  - spec/factories/team.rb
617
- - spec/factories/payment.rb
618
- - spec/factories/campaign/totals.rb
619
- - spec/factories/permissions.rb
620
- - spec/factories/donation.rb
608
+ - spec/factories/event_supporter.rb
609
+ - spec/factories/challenger.rb
610
+ - spec/factories/disease.rb
611
+ - spec/factories/third_party_media.rb
621
612
  - spec/factories/search_kid.rb
622
- - spec/factories/person/addresses.rb
623
- - spec/factories/person/policies.rb
624
- - spec/factories/person/email_addresses.rb
625
- - spec/factories/person/phone_numbers.rb
626
- - spec/factories/fundraiser/totals.rb
613
+ - spec/factories/lib/faker_patch.rb
614
+ - spec/factories/lib/helpers.rb
615
+ - spec/factories/treatment_status.rb
616
+ - spec/factories/recurring_gift.rb
617
+ - spec/factories/name_pieces.rb
618
+ - spec/factories/shave_schedule/time_selection_permissions.rb
619
+ - spec/factories/event/coach_tracking/coaching_interactions.rb
620
+ - spec/factories/event/coach_tracking/proceeds.rb
621
+ - spec/factories/event/coach_tracking/plaque.rb
622
+ - spec/factories/event/contacts.rb
623
+ - spec/factories/event/photos.rb
624
+ - spec/factories/event/contacts/contact.rb
625
+ - spec/factories/event/contacts/name_pieces.rb
626
+ - spec/factories/event/venue.rb
627
+ - spec/factories/event/coach_tracking.rb
628
+ - spec/factories/event/venue/location.rb
629
+ - spec/factories/event/venue/social.rb
630
+ - spec/factories/event/totals.rb
631
+ - spec/factories/team/rankings/ranking.rb
632
+ - spec/factories/team/photos.rb
633
+ - spec/factories/team/totals.rb
634
+ - spec/factories/team/rankings.rb
627
635
  - spec/factories/fundraiser/photos.rb
636
+ - spec/factories/fundraiser/totals.rb
628
637
  - spec/factories/fundraiser/policies.rb
629
- - spec/factories/grant_institution.rb
630
- - spec/factories/challenger.rb
631
- - spec/factories/response.rb
632
- - spec/factories/third_party_media.rb
633
- - spec/factories/email_address.rb
638
+ - spec/factories/search_event.rb
634
639
  - spec/factories/person.rb
640
+ - spec/factories/search_team.rb
641
+ - spec/factories/fundraiser.rb
635
642
  - spec/factories/error.rb
636
- - spec/factories/venue.rb
637
- - spec/factories/page.rb
638
- - spec/factories/contact_group.rb
639
- - spec/factories/newsletter_recipient.rb
640
- - spec/factories/disease.rb
641
- - spec/factories/contact.rb
643
+ - spec/factories/payment.rb
642
644
  - spec/factories/challenge.rb
643
- - spec/factories/kid/custom_institution.rb
644
- - spec/factories/search_fundraiser.rb
645
- - spec/factories/kid_honor.rb
645
+ - spec/factories/fund.rb