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(security): Remove Writable from security services #3147

Conversation

jim-wang-intel
Copy link
Contributor

@jim-wang-intel jim-wang-intel commented Feb 8, 2021

Update for security services on:

  • Loglevel is on the top level of ConfigurationStruct
  • Remove Writable from Configuration struct
  • Make UpdateFromRaw, UpdateWritableFromRaw do nothing and make EmptyWritablePtr just return nil

Fixes: #3123

Signed-off-by: Jim Wang yutsung.jim.wang@intel.com

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

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/master/.github/Contributing.md.

What is the current behavior?

security services have Writable struct but actually it never uses

Issue Number: #3123

What is the new behavior?

Refactor the LogLevel inside Writable struct and remove Writable.

Does this PR introduce a breaking change?

  • Yes
  • [x ] No

New Imports

  • Yes
  • [x ] No

Specific Instructions

Are there any specific instructions or things that should be known prior to reviewing?
Depends on PR #2863 as the redis' toml conf would also be removed about the Writable section.

Other information

LogLevel = "DEBUG"

[ProxySetup]
Copy link
Member

Choose a reason for hiding this comment

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

Why was this added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no particular strong reason, i just felt that it can be more structural in this way since potentially you can have many more RequestTimout for that naming alone.

Copy link
Member

Choose a reason for hiding this comment

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

It is redundant since this is Proxy Setup's specific configuration. IMO, the extra level isn't needed. We added the extra levels in the bootstrapper config to make the Env override more readable, but that isn't needed here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

internal/security/proxy/config/config.go Show resolved Hide resolved
@jim-wang-intel jim-wang-intel marked this pull request as ready for review February 8, 2021 23:49
lenny-goodell
lenny-goodell previously approved these changes Feb 9, 2021
Copy link
Member

@lenny-goodell lenny-goodell left a comment

Choose a reason for hiding this comment

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

LGTM

Update for security services on:

- Loglevel is on the top level of ConfigurationStruct
- Remove Writable from Configuration struct
- Make UpdateFromRaw, UpdateWritableFromRaw do nothing and make EmptyWritablePtr just return nil

Fixes: edgexfoundry#3123

Signed-off-by: Jim Wang <yutsung.jim.wang@intel.com>
@sonarcloud
Copy link

sonarcloud bot commented Feb 9, 2021

Kudos, SonarCloud 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
37.0% 37.0% Duplication

@lenny-goodell lenny-goodell merged commit 4701403 into edgexfoundry:master Feb 9, 2021
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.

Remove Writable config section from Security services that don't use Config Provider
2 participants