Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Fix options migration, implement proxy options #41

Merged
merged 12 commits into from
Apr 22, 2022

Conversation

farshidtz
Copy link
Member

@farshidtz farshidtz commented Apr 20, 2022

Fixes for #38.

Moved proxy-related code to the options package.

Added proxy options processing for TLS:

  • apps.secrets-config.proxy.tls.cert
  • apps.secrets-config.proxy.tls.key
  • apps.secrets-config.proxy.tls.snis

Added proxy options processing for user:

  • apps.secrets-config.proxy.admin.public-key

For usability purposes, the username, userid, algorithm of the single user have been hardcoded to admin, 1, ES256. This should be sufficient since we don't allow setting multiple users using snap options. The algorithm is set to ES256 rather than RS256, because it is more secure.

To avoid mixed option issues, the new namespace is now enabled after opting-in by setting config-enabled=true.

Testing instructions

Add the following to go.mod:

replace github.com/canonical/edgex-snap-hooks/v2 => github.com/farshidtz/edgex-snap-hooks/v2 d43ccc771100d663099c8ca8e3974d78076b2058

@farshidtz farshidtz changed the title Fix options migration Fix options migration, implement proxy options Apr 21, 2022
* Export log init to re-initialize debug mode in external tests
@farshidtz farshidtz force-pushed the options-migration-fix branch from 80677de to 349c72a Compare April 21, 2022 17:09
farshidtz pushed a commit to canonical/edgex-snap-testing that referenced this pull request Apr 22, 2022
#49)

* Add `TestAppConfig()` test

* Separate tests

* Remove redundant subtest, move unset to cleanup

- remove redundant subtest
- move unset to cleanup
- add comment for existing issue
- improve words

* Update device-rest's config_test

* Do `snap set`, then `snap start`

* Setting FULL_CONFIG_TEST make skipping of config subtests optional

* Move config testing into util functions

* Use boolean for `FullConfigTest`, add message for `t.Skip()`

* Update `if else` and README format

* Add `config-enabled` for new version hooks

new version hooks: canonical/edgex-snap-hooks#41
@farshidtz farshidtz merged commit 1d21d9c into canonical:main Apr 22, 2022
@farshidtz farshidtz deleted the options-migration-fix branch April 22, 2022 13:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant