Skip to content

Commit

Permalink
refactor: remove sha1 reference
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Aug 8, 2022
1 parent 512ba43 commit cfd1ef4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ jobs:
FLUX_TOKEN: ${{ secrets.FLUX_TOKEN }}
FLUX_WEBHOOK_URL: ${{ secrets.FLUX_WEBHOOK_URL }}
run: |
curl --disable --silent --show-error --location --max-time 30 --header "X-Signature: sha1=$(printf "{}" | openssl dgst -sha1 -r -hmac "${FLUX_TOKEN}"| awk '{print $1}')" --data "{}" "${FLUX_WEBHOOK_URL}"
curl --disable --silent --show-error --location --max-time 30 --header "X-Signature: sha256=$(printf "{}" | openssl dgst -sha256 -r -hmac "${FLUX_TOKEN}"| awk '{print $1}')" --data "{}" "${FLUX_WEBHOOK_URL}"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ help: Makefile
name:
@printf "$(APP_NAME)"

## version: Output last commit sha1
## version: Output last commit sha
.PHONY: version
version:
@printf "$(shell git rev-parse --short HEAD)"
Expand Down
8 changes: 4 additions & 4 deletions cmd/fibr/templates/upload-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
}

/**
* Compute the sha1 on input.
* Compute the sha on input.
* @param {Object} data Data to hash
* @return {Promise<String>} Promise that will resolve the sha1 string
* @return {Promise<String>} Promise that will resolve the sha string
*/
async function sha1(data) {
async function sha(data) {
const buffer = await crypto.subtle.digest(
'SHA-256',
new TextEncoder('utf-8').encode(data),
Expand All @@ -60,7 +60,7 @@
* @return {Promise<String>} Promise that will resolve the message id.
*/
async function fileMessageId(file) {
const hash = await sha1(
const hash = await sha(
JSON.stringify({
name: file.name,
size: file.size,
Expand Down

0 comments on commit cfd1ef4

Please sign in to comment.