Adding the POC of uploading default asset(not official PR) #1933
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current implementation of uploading default assets: What I've done so far is put the two requests to upload the assets into a bash file so that the assets in the zip package can be uploaded to the website by executing the init.sh file. However when sending a request, we need to obtain the jwt token, which make it difficult to realize it in the docker. During my test, I got this token from the web page after logging in.
A potential solution: When I do log in action, I notice that the front end sends a lot of requests with jwt tokens. Can we implement the request to upload assets through Angular? Just like the getAllResources defined in base-asset-links.direction.ts, maybe we could get the zip list of default assets to upload with getAllDefaultAssets. Then loop through the actions of the two buttons, performPreview and performImport(). I wonder if this is possible? Or is there a way to securely acquire jwt tokens during the deployment phase of docker?
PR introduces (a) breaking change(s): no
PR introduces (a) deprecation(s): no