Skip to content

Commit

Permalink
chore: fix dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-cardenas-coding committed Aug 18, 2024
1 parent 3d8b45b commit c158ca3
Show file tree
Hide file tree
Showing 10 changed files with 136 additions and 121 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) karl-cardenas-coding
# SPDX-License-Identifier: Apache-2.0

FROM golang:1.22.5-alpine3.20 as builder
FROM golang:1.23.0-alpine3.20 as builder

LABEL org.opencontainers.image.source="https://github.com/karl-cardenas-coding/mywhoop"
LABEL org.opencontainers.image.description="A tool for gathering and retaining your own Whoop data."
Expand Down
12 changes: 7 additions & 5 deletions cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ func login() error {
},
}

state := internal.GenerateStateOauthCookie()
state, err := internal.GenerateStateOauthCookie()
if err != nil {
return err

Check warning on line 106 in cmd/login.go

View check run for this annotation

Codecov / codecov/patch

cmd/login.go#L104-L106

Added lines #L104 - L106 were not covered by tests
}

slog.Debug("Redirect Config", "URL:", "http://localhost:"+port+redirectURL)
authUrl := internal.GetAuthURL(*config, state)

Check warning on line 110 in cmd/login.go

View check run for this annotation

Codecov / codecov/patch

cmd/login.go#L110

Added line #L110 was not covered by tests
Expand Down Expand Up @@ -159,23 +162,22 @@ func redirectHandler(assets fs.FS, page, errorPage string, authConf *oauth2.Conf

return func(w http.ResponseWriter, r *http.Request) {
code := r.URL.Query().Get("code")
slog.Debug("Code received", "code", code)
// slog.Debug("Code received", "code", code)

state := r.URL.Query().Get("state")

Check warning on line 167 in cmd/login.go

View check run for this annotation

Codecov / codecov/patch

cmd/login.go#L167

Added line #L167 was not covered by tests

if state != stateIdentifier {
slog.Error("State does not match", "state", state)
slog.Error("State does not match the expected stateIdentifier", "state received:", state)
err := sendErrorTemplate(w, "The unique authentication state identifier does not match the provided value from MyWhoop. You may be subject to a man-in-the-middle (MITM) attack.", http.StatusBadRequest, errorPage, assets)
if err != nil {
slog.Error("unable to send error template", "error", err)

Check warning on line 173 in cmd/login.go

View check run for this annotation

Codecov / codecov/patch

cmd/login.go#L169-L173

Added lines #L169 - L173 were not covered by tests
}
return

Check warning on line 175 in cmd/login.go

View check run for this annotation

Codecov / codecov/patch

cmd/login.go#L175

Added line #L175 was not covered by tests
}

slog.Debug("State received", "state", state)
// slog.Debug("State received", "state", state)

if code == "" {
// slog.Info("no code received.", "Error response status: ", r.Response.StatusCode)
err := sendErrorTemplate(w, "No authorization code returned by the Whoop authorization server.", http.StatusInternalServerError, errorPage, assets)
if err != nil {
slog.Error("unable to send error template", "error", err)
Expand Down
6 changes: 3 additions & 3 deletions docs/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The following steps will guide you through the process of setting up MyWhoop on
7. Download the MyWhoop Docker image.

```shell
docker pull ghcr.io/karl-cardenas-coding/mywhoop:v0.1.1
docker pull ghcr.io/karl-cardenas-coding/mywhoop:v0.1.2
```

8. Create a directory where you want to store the MyWhoop data and credentials token. The command below creates a folder in your home directory and changes to that directory.
Expand All @@ -83,7 +83,7 @@ The following steps will guide you through the process of setting up MyWhoop on
--volume $PWD:/data \
-e WHOOP_CLIENT_ID=$WHOOP_CLIENT_ID \
-e WHOOP_CLIENT_SECRET=$WHOOP_CLIENT_SECRET \
ghcr.io/karl-cardenas-coding/mywhoop:v0.1.1 login \
ghcr.io/karl-cardenas-coding/mywhoop:v0.1.2 login \
--no-auto-open \
--credentials /app/token.json
```
Expand Down Expand Up @@ -112,7 +112,7 @@ The following steps will guide you through the process of setting up MyWhoop on
docker run --publish 8080:8080 --volume $PWD:/app \
-e WHOOP_CLIENT_ID=$WHOOP_CLIENT_ID \
-e WHOOP_CLIENT_SECRET=$WHOOP_CLIENT_SECRET \
ghcr.io/karl-cardenas-coding/mywhoop:v0.1.1 dump \
ghcr.io/karl-cardenas-coding/mywhoop:v0.1.2 dump \
--credentials /app/token.json \
--location /app
```
Expand Down
67 changes: 34 additions & 33 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,59 @@ module github.com/karl-cardenas-coding/mywhoop
go 1.23

require (
github.com/aws/aws-sdk-go-v2/config v1.27.27
github.com/aws/aws-sdk-go-v2/credentials v1.17.27
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.8
github.com/aws/aws-sdk-go-v2/service/s3 v1.58.2
github.com/aws/aws-sdk-go-v2/config v1.27.28
github.com/aws/aws-sdk-go-v2/credentials v1.17.28
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.11
github.com/aws/aws-sdk-go-v2/service/s3 v1.59.0
github.com/cenkalti/backoff/v4 v4.3.0
github.com/docker/go-connections v0.5.0
github.com/go-playground/validator/v10 v10.22.0
github.com/spf13/cobra v1.8.1
github.com/testcontainers/testcontainers-go v0.32.0
github.com/testcontainers/testcontainers-go/modules/localstack v0.32.0
github.com/xuri/excelize/v2 v2.8.1
golang.org/x/oauth2 v0.21.0
golang.org/x/oauth2 v0.22.0
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/moby/sys/userns v0.1.0 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/richardlehane/mscfb v1.0.4 // indirect
github.com/richardlehane/msoleps v1.0.3 // indirect
github.com/xuri/efp v0.0.0-20231025114914-d1ff6096ae53 // indirect
github.com/xuri/nfp v0.0.0-20230919160717-d98342af3f05 // indirect
github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d // indirect
github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 // indirect
)

require (
dario.cat/mergo v1.0.0 // indirect
dario.cat/mergo v1.0.1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Microsoft/hcsshim v0.12.5 // indirect
github.com/aws/aws-sdk-go-v2 v1.30.3 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.15 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.17 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.15 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 // indirect
github.com/aws/smithy-go v1.20.3 // indirect
github.com/aws/aws-sdk-go-v2 v1.30.4 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.4 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.16 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.18 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.16 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.22.5 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.30.4 // indirect
github.com/aws/smithy-go v1.20.4 // indirect
github.com/containerd/containerd v1.7.20 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v0.2.1 // indirect
github.com/cpuguy83/dockercfg v0.3.1 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/docker v27.1.1+incompatible // indirect
github.com/docker/docker v27.1.2+incompatible // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/gabriel-vasile/mimetype v1.4.4 // indirect
github.com/gabriel-vasile/mimetype v1.4.5 // indirect
github.com/go-co-op/gocron/v2 v2.11.0
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
Expand All @@ -72,7 +73,7 @@ require (
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/sequential v0.6.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/moby/sys/user v0.3.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
Expand All @@ -91,13 +92,13 @@ require (
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/mod v0.19.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.17.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/grpc v1.65.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
)
Loading

0 comments on commit c158ca3

Please sign in to comment.