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

refactor(cmd-api-server): clean up configuration parameters #720

Closed
petermetz opened this issue Mar 24, 2021 · 7 comments · Fixed by #1996
Closed

refactor(cmd-api-server): clean up configuration parameters #720

petermetz opened this issue Mar 24, 2021 · 7 comments · Fixed by #1996
Assignees
Labels
API_Server Developer_Experience documentation Improvements or additions to documentation enhancement New feature or request
Milestone

Comments

@petermetz
Copy link
Contributor

petermetz commented Mar 24, 2021

Description

As a user of Cactus I don't want to have dangling/zombie configuration parameters in the API server so that I'm not wasting any of my time trying to figure out what they are for or how to use them/provide dummy values to pass the configuration validation mechanism.

Ideally all (or at least most) of the configuration that the API server needs would really just be the configuration that is passed down to the plugin instances so that the API server is kept "dumb" and easily exchangeable.

Acceptance Criteria

  1. The ConfigService is cleaned up so that there are no redundant/unused configuration parameters.
  2. Documentation is updated
  3. API server configuration generation scripts (root package.json for example) are all updated
  4. Manual testing verified that the generated configuration does work with the npm run start:api-server script (e.g. no crash)
  5. Verify that the change is backwards compatible, e.g. the 1.0.0 version of the API server can start with the new reduced configuration file without crashing or producing validation errors
  6. If 5) comes back with the outcome that removing these configuration parameters would be a breaking change then label this issue accordingly, e.g. https://github.com/hyperledger/cactus/labels/Breaking_V1

List of configuration parameters to remove (if they are optional)

  • cactusNodeId
  • consortiumId
  • keyPairPem
  • keychainSuffixKeyPairPem
@ruzell22
Copy link
Contributor

Hello @petermetz , can you assign this to me? Thank you.

@petermetz petermetz assigned ruzell22 and unassigned petermetz Apr 19, 2022
@petermetz
Copy link
Contributor Author

Hello @petermetz , can you assign this to me? Thank you.

@ruzell22 Done, thank you!

@ruzell22
Copy link
Contributor

Hello @petermetz , below are the following outputs of different situational tests that I did for the ticket.

After removing keyPairPem:
Screenshot 2022-04-21 132051 (without keyPairPem error)

Cleaning up based on error log, running npm run configure with successful output but running npm run start: api-server will output an error and it automatically shuts down the API server:
Screenshot 2022-04-21 132342 (without 4 parameters with better cleaning)
Screenshot 2022-04-21 132713 (run start api server with keyPairPem falsy error)

options.keyPairPem falsy and possible code related to the error:
Screenshot 2022-04-21 132836
Screenshot 2022-04-21 133031
Screenshot 2022-04-21 131446

My question for this part is, should I still remove keyPairPem?

Removing the other 3, however, results to a successful npm run configure and npm run start:api-server:
Screenshot 2022-04-21 140723 (v1 0 0-25-gdda3f00c latest tag npm run configure)
Screenshot 2022-04-21 140923 (v1 0 0-25-gdda3f00c tag run api server)

@ruzell22
Copy link
Contributor

As for backwards compatibility, I first tried it without removing any parameters mentioned and just changing the tags to different version and running npm run configure and npm run start:api-server

v1.0.0-rc1 and v1.0.0-rc.2 both outputs an error in run configure and start:api-server
Screenshot 2022-04-22 135805 (no changes - v1 0 0-rc 1 tag npm run configure)
Screenshot 2022-04-22 140527 (no changes - v1 0 0 rc-1 - with npm run configure - run start api server)

while v1.0.0-rc.3 outputs a success in run configure and start:api-server
Screenshot 2022-04-22 142028 (no changes - v1 0 0 rc-3 - npm run configure)
Screenshot 2022-04-22 142119 (no changes - v1 0 0 rc-3 - with npm run configure - run start api server)

Then I tried doing the same after removing the 3 parameters (excluding keyPairPem):

v1.0.0-rc.1 and v.1.0.0-rc.2 results to an error in run configure and start:api-server:
Screenshot 2022-04-21 135318 (v1 0 0-rc 1 tag npm run configure error)
Screenshot 2022-04-21 135408 (v1 0 0-rc 1 tag api server error)

while v1.0.0-rc.3 resulted to a success in run configure but error in start:api-server
Screenshot 2022-04-21 140156 (v1 0 0-rc 3 tag npm run configure)
Screenshot 2022-04-21 140221 (v1 0 0-rc 3 tag run api server error)

excluding the v1.0.0-rc.1 and rc.2, in rc.3, the result differs from each other. Does this mean that removing the parameters is not backwards compatible?

Thank you

ruzell22 added a commit to ruzell22/cactus that referenced this issue Apr 28, 2022
…er-cacti#720

fixes: hyperledger-cacti#720

Parameters that are cleaned up are: cactusNodeId, consortiumId, keychainSuffixKeyPairPem
Parameter keyPairPem cannot be remove as it results to an error in running the api server.

Cleaning the three mentioned parameter are backwards compatible with tags versions:
v1.0.0-rc.3 and v1.0.0
The latest tag being used as of this change is v1.0.0-25-gdda3f00c

Signed-off-by: ruzell22 <[email protected]>
@ruzell22
Copy link
Contributor

I'm gonna add this detail here for future references. Here are the tests using v1.0.0 tag after cleaning up the parameters mentioned excluding keyPairPem:

npm run configure
Screenshot 2022-04-28 142344 (with changes - v1 0 0 - npm run configure)

run start:api-server
Screenshot 2022-04-28 142433 (with changes - v1 0 0 - with npm run configure - run start api server)

@ruzell22
Copy link
Contributor

An update on v1.0.0-rc.3 using npm run start:api-server that has a successful output:
Screenshot 2022-04-29 110339 (with changes - v1 0 0-rc 3 - with npm run configure- run start api server)

ruzell22 added a commit to ruzell22/cactus that referenced this issue May 12, 2022
…er-cacti#720

fixes: hyperledger-cacti#720

Parameters that are cleaned up are: cactusNodeId, consortiumId, keychainSuffixKeyPairPem
Parameter keyPairPem cannot be remove as it results to an error in running the api server.

Cleaning the three mentioned parameter are backwards compatible with tags versions:
v1.0.0-rc.3 and v1.0.0
The latest tag being used as of this change is v1.0.0-25-gdda3f00c

The package cleaned is cactus-cmd-api-server

Signed-off-by: ruzell22 <[email protected]>
ruzell22 added a commit to ruzell22/cactus that referenced this issue May 16, 2022
…er-cacti#720

fixes: hyperledger-cacti#720

Parameters that are cleaned up are: cactusNodeId, consortiumId, keychainSuffixKeyPairPem
together with their corresponding environment:
CACTUS_NODE_ID, CONSORTIUM_ID, KEYCHAIN_SUFFIX_KEY_PAIR_PEM
Parameter keyPairPem cannot be remove as it results to an error in running the api server.

Cleaning the three mentioned parameter are backwards compatible with tags versions:
v1.0.0-rc.3 and v1.0.0
The latest tag being used as of this change is v1.0.0-25-gdda3f00c

Signed-off-by: ruzell22 <[email protected]>
ruzell22 added a commit to ruzell22/cactus that referenced this issue May 17, 2022
…er-cacti#720

fixes: hyperledger-cacti#720

Parameters that are cleaned up are: cactusNodeId, consortiumId, keychainSuffixKeyPairPem
together with their corresponding environment:
CACTUS_NODE_ID, CONSORTIUM_ID, KEYCHAIN_SUFFIX_KEY_PAIR_PEM
Parameter keyPairPem cannot be remove as it results to an error in running the api server.

Cleaning the three mentioned parameter are backwards compatible with tags versions:
v1.0.0-rc.3 and v1.0.0
The latest tag being used as of this change is v1.0.0-25-gdda3f00c

Signed-off-by: ruzell22 <[email protected]>
ruzell22 added a commit to ruzell22/cactus that referenced this issue May 18, 2022
…er-cacti#720

fixes: hyperledger-cacti#720

Parameters that are cleaned up are: cactusNodeId, consortiumId, keychainSuffixKeyPairPem
together with their corresponding environment:
CACTUS_NODE_ID, CONSORTIUM_ID, KEYCHAIN_SUFFIX_KEY_PAIR_PEM
Parameter keyPairPem cannot be remove as it results to an error in running the api server.

Cleaning the three mentioned parameter are backwards compatible with tags versions:
v1.0.0-rc.3 and v1.0.0
The latest tag being used as of this change is v1.0.0-25-gdda3f00c

Signed-off-by: ruzell22 <[email protected]>
ruzell22 added a commit to ruzell22/cactus that referenced this issue May 26, 2022
…er-cacti#720

fixes: hyperledger-cacti#720

Parameters that are cleaned up are: cactusNodeId, consortiumId, keychainSuffixKeyPairPem
together with their corresponding environment:
CACTUS_NODE_ID, CONSORTIUM_ID, KEYCHAIN_SUFFIX_KEY_PAIR_PEM
Parameter keyPairPem cannot be remove as it results to an error in running the api server.

Cleaning the three mentioned parameter are backwards compatible with tags versions:
v1.0.0-rc.3 and v1.0.0
The latest tag being used as of this change is v1.0.0-25-gdda3f00c

Signed-off-by: ruzell22 <[email protected]>
ruzell22 added a commit to ruzell22/cactus that referenced this issue Mar 10, 2023
related to hyperledger-cacti#720

this includes gitguardian workflow + configuration file

Signed-off-by: ruzell22 <[email protected]>
ruzell22 added a commit to ruzell22/cactus that referenced this issue Mar 13, 2023
related to hyperledger-cacti#720

this includes gitguardian workflow + configuration file

Signed-off-by: ruzell22 <[email protected]>
ruzell22 added a commit to ruzell22/cactus that referenced this issue Mar 13, 2023
related to hyperledger-cacti#720 and hyperledger-cacti#2086

This includes GitGuardian workflow + configuration file
To replace the original GitGuardian scanner so it will be configurable.

Signed-off-by: ruzell22 <[email protected]>
ruzell22 added a commit to ruzell22/cactus that referenced this issue Mar 30, 2023
related to hyperledger-cacti#720

This includes gitguardian workflow + configuration file

This change was necessary even if we have stock git guardian workflow
action because it was not possible to be configured for exclusions.

The scanner was not getting triggered by pull_request_target as
expected to access the secrets environment variable so it was
returned to the original pull_request. By default, secrets is not
possible to be accessed by a pull request from a fork repository
unless it is merged to the main repository. Hence, the original
pull_request will work after merging.

The test tokens used in testing were all deleted to prevent further
usage of it.

Signed-off-by: ruzell22 <[email protected]>
petermetz pushed a commit to ruzell22/cactus that referenced this issue Apr 3, 2023
related to hyperledger-cacti#720

This includes gitguardian workflow + configuration file

This change was necessary even if we have stock git guardian workflow
action because it was not possible to be configured for exclusions.

The scanner was not getting triggered by pull_request_target as
expected to access the secrets environment variable so it was
returned to the original pull_request. By default, secrets is not
possible to be accessed by a pull request from a fork repository
unless it is merged to the main repository. Hence, the original
pull_request will work after merging.

The test tokens used in testing were all deleted to prevent further
usage of it.

Signed-off-by: ruzell22 <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
sandeepnRES pushed a commit to sandeepnRES/cacti that referenced this issue Apr 3, 2023
related to hyperledger-cacti#720

This includes gitguardian workflow + configuration file

This change was necessary even if we have stock git guardian workflow
action because it was not possible to be configured for exclusions.

The scanner was not getting triggered by pull_request_target as
expected to access the secrets environment variable so it was
returned to the original pull_request. By default, secrets is not
possible to be accessed by a pull request from a fork repository
unless it is merged to the main repository. Hence, the original
pull_request will work after merging.

The test tokens used in testing were all deleted to prevent further
usage of it.

Signed-off-by: ruzell22 <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
ruzell22 added a commit to ruzell22/cactus that referenced this issue Apr 6, 2023
…er-cacti#720

fixes: hyperledger-cacti#720

Parameters cleaned up are: cactusNodeId, consortiumId, keychainSuffixKeyPairPem
Parameter keyPairPem cannot be removed as it results to an error in running
the api server.

Cleaning the three mentioned parameters are backwards compatible with tags
versions: v1.0.0-rc.3 and v1.0.0
The latest tag being used as of this change is v1.0.0-25-gdda3f00c

Signed-off-by: ruzell22 <[email protected]>
@petermetz petermetz added this to the v2.0.0-rc.0 milestone Aug 25, 2023
@ruzell22
Copy link
Contributor

Hello @petermetz , the clean up configuration parameters part of the ticket is already finished and is just having issue with the gitguardian. Since it will not be used anymore, this ticket is finished and can be closed and fixed by #1996 . Thank you.

@jagpreetsinghsasan jagpreetsinghsasan moved this from In Progress to In review in Cacti_Scrum_Project_v2_Release Sep 8, 2023
petermetz pushed a commit to ruzell22/cactus that referenced this issue Sep 8, 2023
…er-cacti#720

BREAKING CHANGE: Removed the `keyPairPem` parameter from the API server
configuration.

fixes: hyperledger-cacti#720

Parameters cleaned up are: cactusNodeId, consortiumId, keychainSuffixKeyPairPem

Cleaning the three mentioned parameters are backwards compatible with tags
versions: v1.0.0-rc.3 and v1.0.0

The latest tag being used as of this change is v1.0.0-25-gdda3f00c

Signed-off-by: ruzell22 <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
petermetz pushed a commit to ruzell22/cactus that referenced this issue Sep 8, 2023
…er-cacti#720

BREAKING CHANGE: Removed the `keyPairPem` parameter from the API server
configuration.

fixes: hyperledger-cacti#720

Parameters cleaned up are: cactusNodeId, consortiumId, keychainSuffixKeyPairPem

Cleaning the three mentioned parameters are backwards compatible with tags
versions: v1.0.0-rc.3 and v1.0.0

The latest tag being used as of this change is v1.0.0-25-gdda3f00c

Signed-off-by: ruzell22 <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
sandeepnRES pushed a commit to ruzell22/cactus that referenced this issue Sep 20, 2023
…er-cacti#720

BREAKING CHANGE: Removed the `keyPairPem` parameter from the API server
configuration.

fixes: hyperledger-cacti#720

Parameters cleaned up are: cactusNodeId, consortiumId, keychainSuffixKeyPairPem

Cleaning the three mentioned parameters are backwards compatible with tags
versions: v1.0.0-rc.3 and v1.0.0

The latest tag being used as of this change is v1.0.0-25-gdda3f00c

Signed-off-by: ruzell22 <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
petermetz pushed a commit that referenced this issue Sep 20, 2023
BREAKING CHANGE: Removed the `keyPairPem` parameter from the API server
configuration.

fixes: #720

Parameters cleaned up are: cactusNodeId, consortiumId, keychainSuffixKeyPairPem

Cleaning the three mentioned parameters are backwards compatible with tags
versions: v1.0.0-rc.3 and v1.0.0

The latest tag being used as of this change is v1.0.0-25-gdda3f00c

Signed-off-by: ruzell22 <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
@github-project-automation github-project-automation bot moved this from In review to Done in Cacti_Scrum_Project_v2_Release Sep 20, 2023
sandeepnRES pushed a commit to sandeepnRES/cacti that referenced this issue Dec 21, 2023
…er-cacti#720

BREAKING CHANGE: Removed the `keyPairPem` parameter from the API server
configuration.

fixes: hyperledger-cacti#720

Parameters cleaned up are: cactusNodeId, consortiumId, keychainSuffixKeyPairPem

Cleaning the three mentioned parameters are backwards compatible with tags
versions: v1.0.0-rc.3 and v1.0.0

The latest tag being used as of this change is v1.0.0-25-gdda3f00c

Signed-off-by: ruzell22 <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API_Server Developer_Experience documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants