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

First Pass of API-side NervesHub integration #998

Merged
merged 26 commits into from Sep 27, 2018
Merged

First Pass of API-side NervesHub integration #998

merged 26 commits into from Sep 27, 2018

Conversation

RickCarlino
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Sep 27, 2018

Codecov Report

Merging #998 into staging will increase coverage by 4.69%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           staging     #998      +/-   ##
===========================================
+ Coverage    95.22%   99.92%   +4.69%     
===========================================
  Files          216      226      +10     
  Lines         4354     3796     -558     
===========================================
- Hits          4146     3793     -353     
+ Misses         208        3     -205
Impacted Files Coverage Δ
app/mutations/devices/create.rb 100% <ø> (+5.26%) ⬆️
app/controllers/api/rmq_utils_controller.rb 100% <ø> (+4.47%) ⬆️
app/mutations/farmware_envs/update.rb 100% <ø> (ø)
app/mutations/farmware_envs/create.rb 100% <ø> (ø)
config/routes.rb 100% <ø> (ø)
app/models/application_record.rb 100% <ø> (+2.32%) ⬆️
app/models/device.rb 100% <100%> (+3.7%) ⬆️
app/models/device_serial_number.rb 100% <100%> (ø)
app/lib/key_gen.rb 100% <100%> (+25%) ⬆️
app/jobs/send_nerves_hub_info_job.rb 100% <100%> (ø)
... and 149 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eb22c17...5165084. Read the comment docs.

@coveralls
Copy link

coveralls commented Sep 27, 2018

Coverage Status

Coverage remained the same at 93.754% when pulling 5165084 on RickCarlino:nerves-hub-pt1 into eb22c17 on FarmBot:staging.

end

# Private Key for authenticating Farmbot API (NOT FARMBOT OS) to NervesHub
def self.try_env_ca_file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got this method, comment and the following method wrong. Sorry.

It should be self.try_file_ca_file and the next method should be self.try_env_ca_file

The comment should also say something like `CA file for authenticating Farmbot API (NOT FARMBOT OS) to NervsHub

# Allow loading this as a normal cert, it only allows
# loading a flie from the filesystem.
# https://stackoverflow.com/questions/36993208/how-to-enumerate-through-multiple-certificates-in-a-bundle
def self.try_file_ca_file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one should be self.try_env_ca_file

# loading a flie from the filesystem.
# https://stackoverflow.com/questions/36993208/how-to-enumerate-through-multiple-certificates-in-a-bundle
def self.try_file_ca_file
if ENV['NERVES_HUB_KEY']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be ENV['NERVES_HUB_CA']

def self.try_file_ca_file
if ENV['NERVES_HUB_KEY']
file = File.open(NERVES_HUB_CA_HACK, 'w')
file.write(ENV['NERVES_HUB_KEY'])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be ENV['NERVES_HUB_CA']

@RickCarlino RickCarlino merged commit 81190dc into FarmBot:staging Sep 27, 2018
@RickCarlino RickCarlino deleted the nerves-hub-pt1 branch January 11, 2019 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants