Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SECURITY] Version bump json gem dependency version [CVE-2013-0269] #8

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 28 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,24 +1,41 @@
PATH
remote: .
specs:
avatax (0.0.1)
avatax-v1 (15.0.1)
addressable (~> 2.3)
json (~> 1.8)
rest-client (~> 1.7)
json
rest-client (>= 2.1)

GEM
remote: https://rubygems.org/
specs:
addressable (2.3.6)
json (1.8.1)
mime-types (2.3)
netrc (0.7.7)
rest-client (1.7.2)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
http-accept (1.7.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
json (2.3.1)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.0512)
netrc (0.11.0)
public_suffix (4.0.5)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)

PLATFORMS
ruby

DEPENDENCIES
avatax!
avatax-v1!

BUNDLED WITH
1.17.3
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
avatax.rb
avatax-v1.rb
=====================
[Other Samples](http://developer.avalara.com/avatax/sample-code)

Expand All @@ -19,8 +19,8 @@ Dependencies

Requirements
----------
- Add the `avatax` gem to your Gemfile with `gem 'avatax'`
- Run `bundle install` to retrieve `avatax` and all its dependencies
- Add the `avatax-v1` gem to your Gemfile with `gem 'avatax-v1'`
- Run `bundle install` to retrieve `avatax-v1` and all its dependencies
- Authentication requires an valid **Account Number** and **License Key**. If you do not have an AvaTax account, a free trial account can be acquired through our [developer site](http://developer.avalara.com/avatax/get-started)
- Specify your authentication credentials as
- environment variables,
Expand All @@ -36,13 +36,13 @@ $ AVATAX_ACCOUNT_NUMBER=1234567890 AVATAX_LICENSE_KEY=A1B2C3D4E5F6G7H8 AVATAX_SE
Credentials from YAML file
--------------------------
```ruby
AvaTax.configure_from 'credentials.yml.example'
AvaTaxV1.configure_from 'credentials.yml.example'
```

Credentials in source
---------------------
```ruby
AvaTax.configure do
AvaTaxV1.configure do
account_number '1234567890'
license_key 'A1B2C3D4E5F6G7H8'
service_url 'https://development.avalara.net'
Expand All @@ -54,8 +54,8 @@ Examples

| Filename | Description |
| :----------------- | :---------- |
| CancelTaxTest.rb | Demonstrates [AvaTax::TaxService.cancel](http://developer.avalara.com/avatax/tax/v1#cancelTax) used to [void a document](http://developer.avalara.com/avatax/tax/v1#voiding-documents) |
| EstimateTaxTest.rb | Demonstrates the [AvaTax::TaxService.estimate](http://developer.avalara.com/avatax/tax/v1#estimateTax) method used for product- and line- indifferent tax estimates. |
| GetTaxTest.rb | Demonstrates the [AvaTax::TaxService.get](http://developer.avalara.com/avatax/tax/v1#getTax) method used for product- and line- specific [calculation](http://developer.avalara.com/avatax/calculating-tax). **NOTE:** This will generate a new transaction/document each time. |
| PingTest.rb | Uses a hardcoded `AvaTax::TaxService.estimate` call to test connectivity and credential information. |
| ValidateTest.rb | Demonstrates the [AvaTax::AddressService.validate](http://developer.avalara.com/avatax/tax/v1#validateAddress) method to [normalize an address](http://developer.avalara.com/avatax/address-validation). |
| CancelTaxTest.rb | Demonstrates [AvaTaxV1::TaxService.cancel](http://developer.avalara.com/avatax/tax/v1#cancelTax) used to [void a document](http://developer.avalara.com/avatax/tax/v1#voiding-documents) |
| EstimateTaxTest.rb | Demonstrates the [AvaTaxV1::TaxService.estimate](http://developer.avalara.com/avatax/tax/v1#estimateTax) method used for product- and line- indifferent tax estimates. |
| GetTaxTest.rb | Demonstrates the [AvaTaxV1::TaxService.get](http://developer.avalara.com/avatax/tax/v1#getTax) method used for product- and line- specific [calculation](http://developer.avalara.com/avatax/calculating-tax). **NOTE:** This will generate a new transaction/document each time. |
| PingTest.rb | Uses a hardcoded `AvaTaxV1::TaxService.estimate` call to test connectivity and credential information. |
| ValidateTest.rb | Demonstrates the [AvaTaxV1::AddressService.validate](http://developer.avalara.com/avatax/tax/v1#validateAddress) method to [normalize an address](http://developer.avalara.com/avatax/address-validation). |
8 changes: 4 additions & 4 deletions avatax.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "avatax"
s.version = "14.4.4"
s.name = "avatax-v1"
s.version = "15.0.1"
s.summary = "Library for accessing Avalara's AvaTax and Address Validation services"
s.authors = ['Anya Stettler', 'Jeff Weiss']
s.email = '[email protected]'
Expand All @@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.homepage = "http://www.avalara.com/"
s.license = 'Apache-2.0'
s.description = "Provides a straightforward way to access and communicate with the all methods exposed by the Avalara AvaTax REST API."
s.add_dependency 'json', '~> 1.8'
s.add_dependency 'rest-client', '~> 1.7'
s.add_dependency 'json'
s.add_dependency 'rest-client', '>= 2.1'
s.add_dependency 'addressable', '~> 2.3'
end
6 changes: 3 additions & 3 deletions examples/CancelTaxTest.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'avatax'
require 'avatax-v1'

# Header Level Elements
# Required Header Level Elements
AvaTax.configure_from 'credentials.yml'
AvaTaxV1.configure_from 'credentials.yml'

taxSvc = AvaTax::TaxService.new
taxSvc = AvaTaxV1::TaxService.new

cancelTaxRequest = {
# Required Request Parameters
Expand Down
6 changes: 3 additions & 3 deletions examples/EstimateTaxTest.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'avatax'
require 'avatax-v1'

# Header Level Elements
# Required Header Level Elements
AvaTax.configure_from 'credentials.yml'
AvaTaxV1.configure_from 'credentials.yml'

taxSvc = AvaTax::TaxService.new
taxSvc = AvaTaxV1::TaxService.new

#Required Request Parameters
location = {
Expand Down
6 changes: 3 additions & 3 deletions examples/GetTaxTest.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
require 'avatax'
require 'avatax-v1'
require 'date'

# Header Level Elements
# Required Header Level Elements
AvaTax.configure_from 'credentials.yml'
AvaTaxV1.configure_from 'credentials.yml'

taxSvc = AvaTax::TaxService.new
taxSvc = AvaTaxV1::TaxService.new

getTaxRequest = {
# Document Level Elements
Expand Down
6 changes: 3 additions & 3 deletions examples/PingTest.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'avatax'
require 'avatax-v1'

# Header Level Elements
# Required Header Level Elements
AvaTax.configure_from 'credentials.yml'
AvaTaxV1.configure_from 'credentials.yml'

taxSvc = AvaTax::TaxService.new
taxSvc = AvaTaxV1::TaxService.new

pingResult = taxSvc.ping

Expand Down
6 changes: 3 additions & 3 deletions examples/ValidateTest.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'avatax'
require 'avatax-v1'

# Header Level Elements
# Required Header Level Elements
AvaTax.configure_from 'credentials.yml'
AvaTaxV1.configure_from 'credentials.yml'

addressSvc = AvaTax::AddressService.new
addressSvc = AvaTaxV1::AddressService.new

validateRequest = {
# Required Request Parameters
Expand Down
2 changes: 1 addition & 1 deletion lib/avatax.rb → lib/avatax-v1.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require_relative 'avatax/configuration'
module AvaTax
module AvaTaxV1

def self.configure(&block)
Configuration.instance.instance_eval(&block)
Expand Down
8 changes: 4 additions & 4 deletions lib/avatax/address_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
require 'base64'
require_relative 'configuration'

class AvaTax::AddressService
class AvaTaxV1::AddressService
@@service_path = '/1.0/address/'
attr_accessor :account_number, :license_key, :service_url

def initialize()
@account_number = AvaTax::Configuration.instance.account_number
@license_key = AvaTax::Configuration.instance.license_key
@service_url = AvaTax::Configuration.instance.service_url
@account_number = AvaTaxV1::Configuration.instance.account_number
@license_key = AvaTaxV1::Configuration.instance.license_key
@service_url = AvaTaxV1::Configuration.instance.service_url
end

def validate(address)
Expand Down
2 changes: 1 addition & 1 deletion lib/avatax/configuration.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'singleton'

module AvaTax
module AvaTaxV1
class Configuration
include Singleton

Expand Down
10 changes: 5 additions & 5 deletions lib/avatax/tax_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
require 'rest-client'
require_relative 'configuration'

class AvaTax::TaxService
class AvaTaxV1::TaxService
@@service_path = "/1.0/tax/"
attr_accessor :account_number, :license_key, :service_url

def initialize()
#puts AvaTax::Configuration.instance.inspect
@account_number = AvaTax::Configuration.instance.account_number
@license_key = AvaTax::Configuration.instance.license_key
@service_url = AvaTax::Configuration.instance.service_url
#puts AvaTaxV1::Configuration.instance.inspect
@account_number = AvaTaxV1::Configuration.instance.account_number
@license_key = AvaTaxV1::Configuration.instance.license_key
@service_url = AvaTaxV1::Configuration.instance.service_url
end

def get(request_hash)
Expand Down