Skip to content

Commit 67af135

Browse files
authored
Merge pull request #38 from auth0-samples/patch/SDK-2798-add-go-mod
[SDK-2798] Use go modules
2 parents 01a32a9 + 0c58be6 commit 67af135

6 files changed

Lines changed: 42 additions & 12 deletions

File tree

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.DS_Store
2-
.env
3-
src
2+
01-Authorization-RS256/.env
3+
01-Authorization-RS256/vendor/
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
README.md
22
exec.sh
33
exec.ps1
4-
src/

01-Authorization-RS256/Dockerfile

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
FROM golang:1.8-alpine3.6
1+
FROM golang:1.17-alpine3.14
22

3-
# install git
3+
# Install git
44
RUN apk --update add \
55
git openssl \
66
&& rm /var/cache/apk/*
77

8-
WORKDIR /go/src
8+
# Define current working directory
9+
WORKDIR /01-Authorization-RS256
910

10-
ADD . /go/src
11+
# Download modules to local cache so we can skip re-
12+
# downloading on consecutive docker build commands
13+
COPY go.mod .
14+
COPY go.sum .
15+
RUN go mod download
1116

12-
RUN go-wrapper download
13-
14-
CMD ["go", "run", "main.go"]
17+
# Add sources
18+
COPY . .
1519

20+
# Expose port 3010 for our api binary
1621
EXPOSE 3010
22+
23+
CMD ["go", "run", "main.go"]

01-Authorization-RS256/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ AUTH0_AUDIENCE={API_AUDIENCE}
2020
### Install Dependencies and Start Server
2121

2222
```bash
23-
# Install dependencies
24-
go get -d
23+
# Download dependencies
24+
go mod vendor
2525

2626
# Start the server
2727
go run main.go

01-Authorization-RS256/go.mod

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module 01-Authorization-RS256
2+
3+
go 1.17
4+
5+
require (
6+
github.com/auth0/go-jwt-middleware v1.0.1
7+
github.com/codegangsta/negroni v1.0.0
8+
github.com/form3tech-oss/jwt-go v3.2.5+incompatible
9+
github.com/gorilla/mux v1.8.0
10+
github.com/joho/godotenv v1.3.0
11+
github.com/rs/cors v1.8.0
12+
)

01-Authorization-RS256/go.sum

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
github.com/auth0/go-jwt-middleware v1.0.1 h1:/fsQ4vRr4zod1wKReUH+0A3ySRjGiT9G34kypO/EKwI=
2+
github.com/auth0/go-jwt-middleware v1.0.1/go.mod h1:YSeUX3z6+TF2H+7padiEqNJ73Zy9vXW72U//IgN0BIM=
3+
github.com/codegangsta/negroni v1.0.0 h1:+aYywywx4bnKXWvoWtRfJ91vC59NbEhEY03sZjQhbVY=
4+
github.com/codegangsta/negroni v1.0.0/go.mod h1:v0y3T5G7Y1UlFfyxFn/QLRU4a2EuNau2iZY63YTKWo0=
5+
github.com/form3tech-oss/jwt-go v3.2.5+incompatible h1:/l4kBbb4/vGSsdtB5nUe8L7B9mImVMaBPw9L/0TBHU8=
6+
github.com/form3tech-oss/jwt-go v3.2.5+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
7+
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
8+
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
9+
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
10+
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
11+
github.com/rs/cors v1.8.0 h1:P2KMzcFwrPoSjkF1WLRPsp3UMLyql8L4v9hQpVeK5so=
12+
github.com/rs/cors v1.8.0/go.mod h1:EBwu+T5AvHOcXwvZIkQFjUN6s8Czyqw12GL/Y0tUyRM=

0 commit comments

Comments
 (0)