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

Secrets, MQTT interface, interface & protocol cmds #347

Merged
merged 6 commits into from
Dec 25, 2022

Conversation

ryanmelt
Copy link
Member

@ryanmelt ryanmelt commented Dec 23, 2022

No description provided.

@ryanmelt ryanmelt requested a review from jmthomas December 23, 2022 18:17
other_interface.options = self.options.clone
self.options.each do |option_name, option_values|
other_interface.set_option(option_name, option_values)
end
Copy link
Member

Choose a reason for hiding this comment

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

Good change because serial_interface overrides set_option to do more

result = protocol.protocol_cmd(cmd_name, @cmd_args) if index == protocol_index or index == -1
handled = true if result
end
return handled
Copy link
Member

Choose a reason for hiding this comment

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

Default is every protocol gets the command and if any return non-nil (or false) it's considered handled. I don't see anyone using or caring about this return code and whether it was handled though.

ENV['OPENC3_SECRET_BACKEND'] ||= 'redis'

module OpenC3
class Secrets
Copy link
Member

Choose a reason for hiding this comment

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

I think this API will work well with the methods defined by https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/SecretsManager/Client.html

if parameters[3]
# Option Name, Secret Name
@secret_options << [parameters[3], parameters[1]]
end
Copy link
Member

Choose a reason for hiding this comment

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

You can make this a secret and a secret option at the same time? What does that look like?

Copy link
Member Author

Choose a reason for hiding this comment

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

See the example openc3-cosmos-mqtt-test plugin I added.

@jmthomas jmthomas changed the title Secrets and interface protocol cmds Secrets, MQTT interface, interface & protocol cmds Dec 23, 2022
@jmthomas
Copy link
Member

closes #269

@codecov
Copy link

codecov bot commented Dec 24, 2022

Codecov Report

Base: 74.98% // Head: 74.71% // Decreases project coverage by -0.26% ⚠️

Coverage data is based on head (68cc7e5) compared to base (7db3abf).
Patch coverage: 38.72% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #347      +/-   ##
==========================================
- Coverage   74.98%   74.71%   -0.27%     
==========================================
  Files         446      450       +4     
  Lines       27187    27386     +199     
  Branches      578      578              
==========================================
+ Hits        20385    20462      +77     
- Misses       6709     6830     +121     
- Partials       93       94       +1     
Flag Coverage Δ
frontend 75.79% <ø> (-0.03%) ⬇️
ruby-api 50.31% <33.33%> (-0.12%) ⬇️
ruby-backend 78.91% <39.44%> (-0.37%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...c3/lib/openc3/interfaces/tcpip_server_interface.rb 63.10% <ø> (+0.53%) ⬆️
...lib/openc3/microservices/interface_microservice.rb 77.26% <16.12%> (-5.83%) ⬇️
openc3/lib/openc3/topics/interface_topic.rb 77.77% <16.66%> (-22.23%) ⬇️
openc3/lib/openc3/topics/router_topic.rb 66.03% <16.66%> (-14.46%) ⬇️
...enc3/lib/openc3/operators/microservice_operator.rb 20.19% <21.42%> (+0.19%) ⬆️
...-cmd-tlm-api/app/controllers/secrets_controller.rb 23.80% <23.80%> (ø)
openc3/lib/openc3/interfaces/interface.rb 91.46% <31.57%> (-5.03%) ⬇️
openc3/lib/openc3/api/interface_api.rb 90.90% <33.33%> (-7.06%) ⬇️
openc3/lib/openc3/api/router_api.rb 91.30% <33.33%> (-8.70%) ⬇️
openc3/lib/openc3/models/interface_model.rb 91.70% <46.15%> (-3.30%) ⬇️
... and 13 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ryanmelt ryanmelt merged commit bb1dfb5 into main Dec 25, 2022
@ryanmelt ryanmelt deleted the secrets_and_interface_protocol_cmds branch December 25, 2022 03:52
@ryanmelt ryanmelt mentioned this pull request Dec 25, 2022
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.

2 participants