Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 0 additions & 79 deletions .circleci/config.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!--
❗ For general support or usage questions, use the Auth0 Community forums or raise a support ticket.

By submitting a pull request to this repository, you agree to the terms within the Auth0 Code of Conduct: https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md.
-->

### 🔧 Changes

<!--
Describe both what is changing and why this is important. Include:

- Types and methods added, deleted, deprecated, or changed
- A summary of usage if this is a new feature or a change to a public API
-->

### 📚 References

<!--
Add relevant links supporting this change, such as:

- GitHub issue/PR number addressed or fixed
- Auth0 Community post
- StackOverflow answer
- Related pull requests/issues from other repositories

If there are no references, simply delete this section.
-->

### 🔬 Testing

<!--
Describe how this can be tested by reviewers. Be specific about anything not tested and why. Include any manual steps for testing end-to-end, or for testing functionality not covered by unit tests.
-->

### 📝 Checklist

- [ ] All new/changed/fixed functionality is covered by tests (or N/A)
- [ ] I have added documentation for all new/changed functionality (or N/A)

<!--
❗ All the above items are required. Pull requests with an incomplete or missing checklist will be closed.
-->
25 changes: 0 additions & 25 deletions .github/workflows/semgrep.yml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: API Tests

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]

jobs:
test-01-authorization-rs256:
runs-on: ubuntu-20.04

env:
AUTH0_CFG: 01-Authorization-RS256
SAMPLE_PATH: 01-Authorization-RS256

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24"

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Clone test scripts
run: git clone --depth 1 https://github.com/auth0-samples/api-quickstarts-tests test

- name: Prepare environment variables
env:
AUTH0_DOMAIN: ${{ secrets.AUTH0_DOMAIN }}
API_IDENTIFIER: ${{ secrets.API_IDENTIFIER }}
run: |
cd $AUTH0_CFG
mv .env.example .env
sed -i 's|{DOMAIN}|'$AUTH0_DOMAIN'|g' .env
sed -i 's|{API_IDENTIFIER}|'$API_IDENTIFIER'|g' .env

- name: Install Go dependencies
run: cd $AUTH0_CFG && go mod download

- name: Start server in background
run: cd $AUTH0_CFG && sh exec.sh &

- name: Wait for server to be ready
run: |
until $(curl --silent --head --output /dev/null --fail http://localhost:8080/api/public); do
echo "Waiting for server to start..."
sleep 5
done

- name: Prepare test environment
env:
AUTH0_DOMAIN: ${{ secrets.AUTH0_DOMAIN }}
API_IDENTIFIER: ${{ secrets.API_IDENTIFIER }}
CLIENT_ID_SCOPES_NONE: ${{ secrets.CLIENT_ID_SCOPES_NONE }}
CLIENT_SECRET_SCOPES_NONE: ${{ secrets.CLIENT_SECRET_SCOPES_NONE }}
CLIENT_ID_SCOPES_READ: ${{ secrets.CLIENT_ID_SCOPES_READ }}
CLIENT_SECRET_SCOPES_READ: ${{ secrets.CLIENT_SECRET_SCOPES_READ }}
CLIENT_ID_SCOPES_WRITE: ${{ secrets.CLIENT_ID_SCOPES_WRITE }}
CLIENT_SECRET_SCOPES_WRITE: ${{ secrets.CLIENT_SECRET_SCOPES_WRITE }}
CLIENT_ID_SCOPES_READWRITE: ${{ secrets.CLIENT_ID_SCOPES_READWRITE }}
CLIENT_SECRET_SCOPES_READWRITE: ${{ secrets.CLIENT_SECRET_SCOPES_READWRITE }}
run: |
cd test
echo "AUTH0_DOMAIN=$AUTH0_DOMAIN" >> .env
echo "API_IDENTIFIER=$API_IDENTIFIER" >> .env
echo "AUTH0_CLIENT_ID_1=$CLIENT_ID_SCOPES_NONE" >> .env
echo "AUTH0_CLIENT_SECRET_1=$CLIENT_SECRET_SCOPES_NONE" >> .env
echo "AUTH0_CLIENT_ID_2=$CLIENT_ID_SCOPES_READ" >> .env
echo "AUTH0_CLIENT_SECRET_2=$CLIENT_SECRET_SCOPES_READ" >> .env
echo "AUTH0_CLIENT_ID_3=$CLIENT_ID_SCOPES_WRITE" >> .env
echo "AUTH0_CLIENT_SECRET_3=$CLIENT_SECRET_SCOPES_WRITE" >> .env
echo "AUTH0_CLIENT_ID_4=$CLIENT_ID_SCOPES_READWRITE" >> .env
echo "AUTH0_CLIENT_SECRET_4=$CLIENT_SECRET_SCOPES_READWRITE" >> .env
echo "API_URL=http://localhost:8080" >> .env
npm install

- name: Run automated tests
run: cd test && npm test
12 changes: 6 additions & 6 deletions 01-Authorization-RS256/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM golang:1.17-alpine3.14
FROM golang:1.24-alpine

# Install git
RUN apk --update add \
git openssl \
&& rm /var/cache/apk/*
git openssl \
&& rm /var/cache/apk/*

# Define current working directory
WORKDIR /01-Authorization-RS256
Expand All @@ -17,7 +17,7 @@ RUN go mod download
# Add sources
COPY . .

# Expose port 3010 for our api binary
EXPOSE 3010
# Expose port 8080 for our api binary
EXPOSE 8080

CMD ["go", "run", "main.go"]
CMD ["go", "run", "cmd/server/main.go"]
Loading
Loading