elmas 2.6.0 → 3.0.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
- SHA1:
3
- metadata.gz: b4840a3f199ef30c829409b92a207b39fde8cdb1
4
- data.tar.gz: 95aa8f2d9383565fbd3cca3199a1e983635830ed
2
+ SHA256:
3
+ metadata.gz: 9bf17c014442114f64d14b2cc50b88279eba0b6249c7b08f5d9e7611cce0f078
4
+ data.tar.gz: 526d26398ef1c5fdfdbdd6f7430ae37d0530ef01d09cbfb78365ac44f2945120
5
5
  SHA512:
6
- metadata.gz: 77744d31e6373970e4e8cb92668fd0802af0a5d91267de329020a756b0199379ffa5e64c3863f52afb54f1215c41e1360f29f427437068377409eca7c335385e
7
- data.tar.gz: f7758eaae28006c2e346ddc95077a874489e74c891bb2e18078848deaf54a60a8f5ad9696df632c7250091673616e87a0087dddc826d9343950a1611efeb7391
6
+ metadata.gz: 3854963c10a80a9ee649363f8b4530266a2befad8994557060f07385fad0fba45823380eb74c33386a03985f08327df9869b6e503ed3fe16e803e0a770583fc6
7
+ data.tar.gz: bf11fdb4d48fc87e9a5eb406fc7dd0befe11280d6270df113bd87e69d5edc492703176bbf8cc39c6e5acd9fcce4fc25c7d8500e33fca14cb96196f4b0a54bd8b
@@ -1 +1 @@
1
- 2.3.1
1
+ 2.5.1
@@ -1,3 +1,7 @@
1
+ ## 3.0.0
2
+ - Deprecating auto authorize due to changes to login flow by Exact. https://support.exactonline.com/community/s/knowledge-base#All-All-HNO-Concept-general-security-gen-auth-totpc
3
+ - Upgrade Ruby Version.
4
+
1
5
  ## 2.6.0
2
6
  - Add main atttribute to bank account (thanks @Korstiaan)
3
7
  - Add address object (thanks @chicks)
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) [2015] [Hoppinger]
3
+ Copyright (c) [2018] [Hoppinger]
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  # Elmas
7
7
 
8
- Elmas means diamond, but in this case it's an API wrapper for [Exact Online](https://developers.exactonline.com/). This gem was created by [@Marthyn](https://github.com/marthyn), [Hoppinger](http://www.hoppinger.com) and a few people:
8
+ Elmas means diamond, but in this case it's an API wrapper for [Exact Online](https://developers.exactonline.com/). This gem was created by [@Marthyn](https://github.com/marthyn), [Hoppinger](http://www.hoppinger.com) and a few people.
9
9
 
10
10
  # DISCLAIMER
11
11
 
12
- Please read the Authorization part of this readme before opening an issue about it and realize it's a functionality that is only intented for debugging purposes really, or to allow App to App communication, but it's really better to CREATE YOUR OWN authentication/refresh/authorization logic for your customers through the normal OAUTH path. The code in the Oauth.rb file could break any time Exact changes their login form for example.
12
+ __As of 25th of May, 2FA will be mandatory for all Exact Online accounts. Therefor the auto authorize method with which you could simulate and App 2 App connection will not work anymore. Hoppinger is working on a new solution. The methods will stay available but probably won't work and will show a deprecation warning. [Read more about it here](https://support.exactonline.com/community/s/knowledge-base#All-All-HNO-Concept-general-security-gen-auth-totpc)__
13
13
 
14
14
  ### Contributers
15
15
 
@@ -59,48 +59,6 @@ Elmas.configure do |config|
59
59
  end
60
60
  ```
61
61
 
62
- If you only use the api within your app without exposing it to users you can chose
63
- to automatically login with your credentials. So this is for example when you have a
64
- rake task that shoots in invoices.
65
- Do not use this when you let other users login. Build your own OAUTH flow and then set the access token
66
- before the api request.
67
- ```ruby
68
- Elmas.configure do |config|
69
- config.access_token = Elmas.authorize(ENV['EXACT_USER_NAME'], ENV['EXACT_PASSWORD']).access_token
70
- end
71
- ```
72
- Now you're authorized you can set your current division
73
- ```ruby
74
- Elmas.configure do |config|
75
- config.division = Elmas.authorize_division
76
- end
77
- ```
78
-
79
- So combining all of this results in
80
- ```ruby
81
- Elmas.configure do |config|
82
- config.client_id = ENV['CLIENT_ID']
83
- config.client_secret = ENV['CLIENT_SECRET']
84
- config.redirect_uri = ENV['REDIRECT_URI']
85
- config.access_token = Elmas.authorize(ENV['EXACT_USER_NAME'], ENV['EXACT_PASSWORD']).access_token
86
- config.division = Elmas.authorize_division
87
- end
88
- ```
89
-
90
- You should make sure that when you do a request you're authorized. So build in something like the
91
- following code into your application, that checks wether you're authorized and otherwise authorizes
92
- again.
93
- ```ruby
94
- #The client will now be authorized for 10 minutes,
95
- # if there are requests the time will be reset,
96
- # otherwise authorization should be called again.
97
- unless Elmas.authorized?
98
- Elmas.configure do |config|
99
- config.access_token = Elmas.authorize(ENV['EXACT_USER_NAME'], ENV['EXACT_PASSWORD']).access_token
100
- end
101
- end
102
- ```
103
-
104
62
  ### Logger
105
63
 
106
64
  The default logger is STDOUT. A custom logger can be be configured.
@@ -8,10 +8,15 @@ require File.expand_path("../utils", __FILE__)
8
8
  require File.expand_path("../response", __FILE__)
9
9
 
10
10
  # from https://developers.exactonline.com/#Example retrieve access token.html
11
+
12
+ # This whole class is going to be replaced due to Exact Online's new policies.
13
+ # https://support.exactonline.com/community/s/knowledge-base#All-All-HNO-Concept-general-security-gen-auth-totpc
14
+
11
15
  module Elmas
12
16
  # rubocop:disable Metrics/ModuleLength
13
17
  module OAuth
14
18
  def authorize(user_name, password, options = {})
19
+ warn "[DEPRECATION] `authorize` is deprecated. Please implement your own authorization methods instead."
15
20
  agent = Mechanize.new
16
21
 
17
22
  login(agent, user_name, password, options)
@@ -22,6 +27,7 @@ module Elmas
22
27
  end
23
28
 
24
29
  def refresh_authorization
30
+ warn "[DEPRECATION] `refresh_authorization` is deprecated. Please implement your own authorization methods instead."
25
31
  OauthResponse.new(get_refresh_token(refresh_token)).tap do |response|
26
32
  Elmas.configure do |config|
27
33
  config.access_token = response.access_token
@@ -43,6 +49,7 @@ module Elmas
43
49
  end
44
50
 
45
51
  def auto_authorize
52
+ warn "[DEPRECATION] `auto_authorize` is deprecated. Please implement your own authorization methods instead."
46
53
  Elmas.configure do |config|
47
54
  config.redirect_uri = ENV["REDIRECT_URI"]
48
55
  config.client_id = ENV["CLIENT_ID"]
@@ -2,8 +2,8 @@
2
2
 
3
3
  module Elmas
4
4
  class Version
5
- MAJOR = 2
6
- MINOR = 6
5
+ MAJOR = 3
6
+ MINOR = 0
7
7
  PATCH = 0
8
8
 
9
9
  class << self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elmas
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marthyn
@@ -350,7 +350,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
350
350
  version: '0'
351
351
  requirements: []
352
352
  rubyforge_project:
353
- rubygems_version: 2.5.1
353
+ rubygems_version: 2.7.6
354
354
  signing_key:
355
355
  specification_version: 4
356
356
  summary: API wrapper for Exact Online