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

feat: Add injection of Secure MessageBus creds for eKuiper connections #3778

Merged
merged 3 commits into from
Oct 27, 2021

Conversation

lenny-goodell
Copy link
Member

@lenny-goodell lenny-goodell commented Oct 25, 2021

close #3767

Signed-off-by: Leonard Goodell [email protected]

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-go/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?) N/A due to internal impl

Testing Instructions

For existing functionality not broken:

  1. Clone branch for this PR and for feat: Add volume mounting of eKuiper connections file edgex-compose#196
  2. run make docker_security_secretstore_setup
  3. Update image for Security Secret Setup in add-security.yml from /edgex-compose/pull/196 to be edgexfoundry/security-secretstore-setup:0.0.0-dev
  4. From Compose Builder run make run
  5. Verify logs for Security Secret Setup contain the following:
level=INFO ts=2021-10-25T17:44:14.0811604Z app=security-secretstore-setup source=secure-messagebus.go:123 msg="Wrote eKuiper EdgeX Source at /tmp/kuiper/edgex.yaml with Secure MessageBus credentials"
level=INFO ts=2021-10-25T17:44:14.0813855Z app=security-secretstore-setup source=secure-messagebus.go:123 msg="Wrote eKuiper Connections at /tmp/kuiper-connections/connection.yaml with Secure MessageBus credentials"
  1. Create a stream for eKupier by sending following to: http://localhost:59720/streams
{
  "sql": "create stream demo() WITH (FORMAT=\"JSON\", TYPE=\"edgex\")"
}
  1. Create a new rule for eKupier by sending following to: http://localhost:59720/rules
{
  "id": "ruleBool",
  "sql": "SELECT bool FROM demo where bool = true",
  "actions": [
    {
      "rest": {
        "url": "http://edgex-core-command:48082/api/v1/device/name/Random-Integer-Device/command/Int64",       
        "method": "get",
        "dataTemplate": "\"newKey\":\"{{.key}}\"",
        "sendSingle": true
      }
    }
  ]
}
  1. Verify eKuiper logs contain the following:
time="2021-10-25 17:46:43" level=info msg="Use configuration for edgex messagebus {{ 0 } {edgex-redis 6379 redis} redis map[Password:* Username:redis5]}" file="source/edgex_source.go:109"

For new connections functionality testing TBD when 1.4.0-beta.1-alpine is available

  1. TBD

New Dependency Instructions (If applicable)

N/A

@codecov-commenter
Copy link

codecov-commenter commented Oct 26, 2021

Codecov Report

Merging #3778 (8537e0f) into main (11dac8c) will decrease coverage by 0.00%.
The diff coverage is 61.53%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3778      +/-   ##
==========================================
- Coverage   45.94%   45.93%   -0.01%     
==========================================
  Files         112      112              
  Lines        9595     9598       +3     
==========================================
+ Hits         4408     4409       +1     
- Misses       4806     4807       +1     
- Partials      381      382       +1     
Impacted Files Coverage Δ
internal/security/secretstore/secure-messagebus.go 67.74% <61.53%> (-3.69%) ⬇️

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 11dac8c...8537e0f. Read the comment docs.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@lenny-goodell lenny-goodell merged commit fb769a0 into edgexfoundry:main Oct 27, 2021
@lenny-goodell lenny-goodell deleted the ekuiper-connections branch October 27, 2021 00:46
@farshidtz
Copy link
Member

farshidtz commented Oct 27, 2021

@lenny-intel sorry for the late review. Unfortunately, this change breaks the snaps because connection.yaml is not available. security-secretstore-setup fails to start

edgexfoundry.security-secretstore-setup[86630]: level=ERROR ts=2021-10-27T08:29:24.227447706Z app=security-secretstore-setup source=init.go:421 msg="failed to configure for Secure Message Bus: %w"
snap.edgexfoundry.security-secretstore-setup.service: Main process exited, code=exited, status=1/FAILURE

(The error is not printed due to another bug: #3784)

Could you please clarify if this addition depends on eKuiper 1.4.0? The connection.yaml file is not available in 1.3.1 and 1.3.0 archives.

Thanks

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.

Add injecting Redis credential to eKuiper connections config file
6 participants