Skip to content

feat: add jwt authorization to supply chain example #1801

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

Merged
merged 1 commit into from
Apr 6, 2022

Conversation

elenaizaguirre
Copy link
Contributor

closes #1579

Signed-off-by: Elena Izaguirre [email protected]

@petermetz petermetz added API_Server documentation Improvements or additions to documentation Security Related to existing or potential security vulnerabilities labels Jan 21, 2022
@elenaizaguirre elenaizaguirre force-pushed the jwt-supply-chain branch 2 times, most recently from f642c23 to c099442 Compare January 25, 2022 15:45
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

@petermetz As we talked about here, I need the newest npm packages before create the image

@elenaizaguirre Ah, I'm so sorry, I'm struggling to keep up with everything... :-)
I just published your branch to npm with these package names (pasted below).
Does this make it possible now to build and publish the docker image so that the tag in the readme can also be updated? I'm pushing for this because if we merge this PR as-is then the instructions in the README will get updated, but without the new image the new instructions won't make sense to people so I opted to eliminate the deadlock by publishing the npm packages as a canary release. Sorry again for all this back and forth and the complications. Release management is not easy due to the dependencies unfortunately.

Successfully published:
 - @hyperledger/cactus-example-carbon-accounting-backend@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-example-carbon-accounting-business-logic-plugin@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-example-carbon-accounting-frontend@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-example-supply-chain-backend@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-example-supply-chain-business-logic-plugin@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-example-supply-chain-frontend@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-htlc-coordinator-besu@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-object-store-ipfs@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/cactus-plugin-consortium-manual@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-htlc-eth-besu-erc20@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/cactus-plugin-keychain-azure-kv@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-keychain-google-sm@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-keychain-memory-wasm@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-besu@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-corda@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-fabric-socketio@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-fabric@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-go-ethereum-socketio@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-iroha@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-quorum@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-sawtooth-socketio@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-xdai@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/cactus-test-plugin-consortium-manual@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-test-plugin-htlc-eth-besu-erc20@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-test-plugin-htlc-eth-besu@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-test-plugin-ledger-connector-besu@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-test-plugin-ledger-connector-quorum@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/[email protected]+62c7e930

@elenaizaguirre
Copy link
Contributor Author

@petermetz As we talked about here, I need the newest npm packages before create the image

@elenaizaguirre Ah, I'm so sorry, I'm struggling to keep up with everything... :-) I just published your branch to npm with these package names (pasted below). Does this make it possible now to build and publish the docker image so that the tag in the readme can also be updated? I'm pushing for this because if we merge this PR as-is then the instructions in the README will get updated, but without the new image the new instructions won't make sense to people so I opted to eliminate the deadlock by publishing the npm packages as a canary release. Sorry again for all this back and forth and the complications. Release management is not easy due to the dependencies unfortunately.

Successfully published:
 - @hyperledger/cactus-example-carbon-accounting-backend@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-example-carbon-accounting-business-logic-plugin@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-example-carbon-accounting-frontend@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-example-supply-chain-backend@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-example-supply-chain-business-logic-plugin@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-example-supply-chain-frontend@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-htlc-coordinator-besu@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-object-store-ipfs@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/cactus-plugin-consortium-manual@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-htlc-eth-besu-erc20@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/cactus-plugin-keychain-azure-kv@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-keychain-google-sm@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-keychain-memory-wasm@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-besu@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-corda@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-fabric-socketio@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-fabric@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-go-ethereum-socketio@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-iroha@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-quorum@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-sawtooth-socketio@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-plugin-ledger-connector-xdai@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/[email protected]+62c7e930
 - @hyperledger/cactus-test-plugin-consortium-manual@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-test-plugin-htlc-eth-besu-erc20@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-test-plugin-htlc-eth-besu@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-test-plugin-ledger-connector-besu@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/cactus-test-plugin-ledger-connector-quorum@1.0.0-jwt-supply-chain.62c7e930.0+62c7e930
 - @hyperledger/[email protected]+62c7e930

@petermetz Don't worry, I know you are very busy and I am very grateful for your help.

Regarding the npm packages, I think something went wrong. When I install cactus-example-supply-chain-backend in Dockerfile setting that new version as the value of NPM_PKG_VERSION, I get an error (code try to validate a key before set it) that I solved in #1655.

I checked several package.json of the container but only cactus-example-supply-chain-backend has this new version, other packages are installed with the previous version. Could it be caused by needing to do a build before publish?

@elenaizaguirre elenaizaguirre force-pushed the jwt-supply-chain branch 2 times, most recently from 8e68bb4 to 0df4510 Compare February 10, 2022 08:05
1. The JWT token to be used is printed by the Supply Chain App after
it successfully bootstrapped itself (pulled up the ledgers, API server)
2. The web application uses a native window prompt for getting the token
which might need to be refactored in the future because there are ideas
floating around on the internet that the window prompt/alert APIs should
be discontinued in web browsers altogether.
3. The image built from this source code has been pushed to ghcr.io as:
ghcr.io/hyperledger/cactus-example-supply-chain-app:2022-04-05--feat-1579

closes hyperledger-cacti#1579

Signed-off-by: Elena Izaguirre <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

@elenaizaguirre Very sorry for the slow turnaround I finally managed to get this over the finish line.
Published the image with the freshly published canary npm packages as ghcr.io/hyperledger/cactus-example-supply-chain-app:2022-04-05--feat-1579 and updated your PR so that the README files point to this one as well.

LGTM

@petermetz petermetz merged commit a4f07f6 into hyperledger-cacti:main Apr 6, 2022
@petermetz petermetz deleted the jwt-supply-chain branch April 6, 2022 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API_Server documentation Improvements or additions to documentation Security Related to existing or potential security vulnerabilities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs(examples): add authN/authZ for supply chain app example
3 participants