Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump github.com/stretchr/testify from 1.9.0 to 1.10.0 #418

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c0fc8c8
fix: increase http timeout
fritterhoff Oct 22, 2022
85711bd
feat: add health endpoint
fritterhoff Jul 2, 2023
8cbb0ed
fix/extend eab functionality
fritterhoff Oct 22, 2022
cfa3c4c
Adaptions for MUAS
fritterhoff Oct 22, 2022
32a7afb
feat: add validation agent functionality
fritterhoff Jul 10, 2023
88b920e
feat: permit insecure endpoints for reverse proxying
fritterhoff Sep 22, 2023
ad0f783
chore: upgrade packages
fritterhoff Sep 29, 2023
f95fad2
feat: better errors for eab usage
fritterhoff Oct 20, 2023
b625cc8
fix: optimize error logging
fritterhoff Oct 20, 2023
ee53f07
chore: update github actions
fritterhoff Oct 22, 2023
f733465
feat: more mqtt logging
fritterhoff Oct 26, 2023
991a254
chore: better handling of reconnects
fritterhoff Oct 26, 2023
92aa5e1
fix: try to handle concurrent saving better
fritterhoff Nov 25, 2023
24f63b2
tests: start fixing broken tests
fritterhoff Mar 24, 2024
6761a00
tests: fix broken tests
fritterhoff Mar 24, 2024
53d170d
make eab optional
fritterhoff Mar 24, 2024
807d601
stick to old repo name
fritterhoff Mar 26, 2024
dbea7df
fix agent image name
fritterhoff Mar 26, 2024
8a1b530
upgrade packages
fritterhoff Apr 5, 2024
11b8a66
fix: make client id unique
fritterhoff May 13, 2024
8d6ab44
chore: upgrade packages
fritterhoff May 29, 2024
a30a9d9
chore(deps): bump docker/build-push-action from 5 to 6
dependabot[bot] Jun 23, 2024
7acf0dd
feat: custom dns resolver
fritterhoff Aug 8, 2024
48cdc3b
chore: upgrade packages
fritterhoff Aug 27, 2024
c01fe4e
chore: update packages
fritterhoff Nov 10, 2024
d5f1844
feat: switch to sentry tracing
fritterhoff Nov 25, 2024
1406cfe
reuse context
fritterhoff Nov 25, 2024
d64e1f8
try capturing acme errors
fritterhoff Nov 25, 2024
dda74cd
fix: debug sentry integration
fritterhoff Nov 25, 2024
2ca48b5
debug sentry
fritterhoff Nov 25, 2024
42ce803
wrapping sentry trace
fritterhoff Nov 25, 2024
216f42a
fix sentry wrapping
fritterhoff Nov 25, 2024
2e56fb9
try fixing context usage
fritterhoff Nov 25, 2024
885e553
try reusing trace
fritterhoff Nov 25, 2024
b78e306
fix: set transaction name
fritterhoff Nov 25, 2024
85e0381
chore(deps): bump github.com/stretchr/testify from 1.9.0 to 1.10.0
dependabot[bot] Nov 25, 2024
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
4 changes: 4 additions & 0 deletions .devcontainer/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=postgres
POSTGRES_HOSTNAME=localhost
19 changes: 19 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): 1, 1.18, 1.17, 1-bullseye, 1.18-bullseye, 1.17-bullseye, 1-buster, 1.18-buster, 1.17-buster
ARG VARIANT=1-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/go:0-${VARIANT}

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment the next lines to use go get to install anything else you need
# USER vscode
# RUN go get -x <your-dependency-or-tool>
# USER root

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
36 changes: 36 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/go-postgres
{
"name": "Go & PostgreSQL",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.gopath": "/go",
"go.goroot": "/usr/local/go"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"golang.Go"
]
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [5432],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "go version",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
53 changes: 53 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version: '3.8'

volumes:
postgres-data:

null
services:
app:
build:
context: .
dockerfile: Dockerfile
args:
# [Choice] Go version 1, 1.18, 1.17
# Append -bullseye or -buster to pin to an OS version.
# Use -bullseye variants on local arm64/Apple Silicon.
VARIANT: 1.18-bullseye
# Options
NODE_VERSION: "lts/*"
env_file:
# Ensure that the variables in .env match the same variables in devcontainer.json
- .env

# Security Opt and cap_add allow for C++ based debuggers to work.
# See `runArgs`: https://github.com/Microsoft/vscode-docs/blob/main/docs/remote/devcontainerjson-reference.md
# security_opt:
# - seccomp:unconfined
# cap_add:
# - SYS_PTRACE

volumes:
- ..:/workspace:cached

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:db
# Uncomment the next line to use a non-root user for all processes.
# user: vscode

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)

db:
image: postgres:latest
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
env_file:
# Ensure that the variables in .env match the same variables in devcontainer.json
- .env
# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
7 changes: 7 additions & 0 deletions .github/pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "1"
rules:
- base: master
upstream: smallstep:master
mergeMethod: merge
assignees:
- fritterhoff
7 changes: 0 additions & 7 deletions .github/workflows/code-scan-cron.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/dependabot-auto-merge.yml

This file was deleted.

91 changes: 91 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Docker Images

on:
push:
pull_request:
branches:
- 'main'

jobs:
build:
runs-on: ubuntu-latest
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: hm-edu/certificates
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=raw,value={{branch}}-{{sha}}-{{date 'X'}},enable=${{ github.event_name != 'pull_request' }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: docker/Dockerfile
build-agent:
runs-on: ubuntu-latest
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: hm-edu/certificates-agent
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=raw,value={{branch}}-{{sha}}-{{date 'X'}},enable=${{ github.event_name != 'pull_request' }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: docker/Dockerfile.agent
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/step-ca",
}
]
}
2 changes: 1 addition & 1 deletion acme/api/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func NewAccount(w http.ResponseWriter, r *http.Request) {
render.Error(w, r, err)
return
}
if err := db.UpdateExternalAccountKey(ctx, prov.ID, eak); err != nil {
if err := db.UpdateExternalAccountKey(ctx, prov.GetID(), eak); err != nil {
render.Error(w, r, acme.WrapErrorISE(err, "error updating external account binding key"))
return
}
Expand Down
30 changes: 15 additions & 15 deletions acme/api/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,14 +330,14 @@ func TestHandler_GetOrdersByAccountID(t *testing.T) {
"fail/nil-account": func(t *testing.T) test {
return test{
db: &acme.MockDB{},
ctx: context.WithValue(context.Background(), accContextKey, http.NoBody),
ctx: context.WithValue(context.Background(), AccContextKey, http.NoBody),
statusCode: 400,
err: acme.NewError(acme.ErrorAccountDoesNotExistType, "account does not exist"),
}
},
"fail/account-id-mismatch": func(t *testing.T) test {
acc := &acme.Account{ID: "foo"}
ctx := context.WithValue(context.Background(), accContextKey, acc)
ctx := context.WithValue(context.Background(), AccContextKey, acc)
ctx = context.WithValue(ctx, chi.RouteCtxKey, chiCtx)
return test{
db: &acme.MockDB{},
Expand All @@ -348,7 +348,7 @@ func TestHandler_GetOrdersByAccountID(t *testing.T) {
},
"fail/db.GetOrdersByAccountID-error": func(t *testing.T) test {
acc := &acme.Account{ID: accID}
ctx := context.WithValue(context.Background(), accContextKey, acc)
ctx := context.WithValue(context.Background(), AccContextKey, acc)
ctx = context.WithValue(ctx, chi.RouteCtxKey, chiCtx)
return test{
db: &acme.MockDB{
Expand All @@ -363,7 +363,7 @@ func TestHandler_GetOrdersByAccountID(t *testing.T) {
acc := &acme.Account{ID: accID}
ctx := context.WithValue(context.Background(), chi.RouteCtxKey, chiCtx)
ctx = acme.NewProvisionerContext(ctx, prov)
ctx = context.WithValue(ctx, accContextKey, acc)
ctx = context.WithValue(ctx, AccContextKey, acc)
return test{
db: &acme.MockDB{
MockGetOrdersByAccountID: func(ctx context.Context, id string) ([]string, error) {
Expand Down Expand Up @@ -698,7 +698,7 @@ func TestHandler_NewAccount(t *testing.T) {
}
ctx := acme.NewProvisionerContext(context.Background(), prov)
ctx = context.WithValue(ctx, payloadContextKey, &payloadInfo{value: b})
ctx = context.WithValue(ctx, accContextKey, acc)
ctx = context.WithValue(ctx, AccContextKey, acc)
return test{
db: &acme.MockDB{},
ctx: ctx,
Expand Down Expand Up @@ -879,7 +879,7 @@ func TestHandler_GetOrUpdateAccount(t *testing.T) {
}
},
"fail/nil-account": func(t *testing.T) test {
ctx := context.WithValue(context.Background(), accContextKey, nil)
ctx := context.WithValue(context.Background(), AccContextKey, nil)
return test{
db: &acme.MockDB{},
ctx: ctx,
Expand All @@ -888,7 +888,7 @@ func TestHandler_GetOrUpdateAccount(t *testing.T) {
}
},
"fail/no-payload": func(t *testing.T) test {
ctx := context.WithValue(context.Background(), accContextKey, &acc)
ctx := context.WithValue(context.Background(), AccContextKey, &acc)
return test{
db: &acme.MockDB{},
ctx: ctx,
Expand All @@ -897,7 +897,7 @@ func TestHandler_GetOrUpdateAccount(t *testing.T) {
}
},
"fail/nil-payload": func(t *testing.T) test {
ctx := context.WithValue(context.Background(), accContextKey, &acc)
ctx := context.WithValue(context.Background(), AccContextKey, &acc)
ctx = context.WithValue(ctx, payloadContextKey, nil)
return test{
db: &acme.MockDB{},
Expand All @@ -907,7 +907,7 @@ func TestHandler_GetOrUpdateAccount(t *testing.T) {
}
},
"fail/unmarshal-payload-error": func(t *testing.T) test {
ctx := context.WithValue(context.Background(), accContextKey, &acc)
ctx := context.WithValue(context.Background(), AccContextKey, &acc)
ctx = context.WithValue(ctx, payloadContextKey, &payloadInfo{})
return test{
db: &acme.MockDB{},
Expand All @@ -922,7 +922,7 @@ func TestHandler_GetOrUpdateAccount(t *testing.T) {
}
b, err := json.Marshal(uar)
assert.FatalError(t, err)
ctx := context.WithValue(context.Background(), accContextKey, &acc)
ctx := context.WithValue(context.Background(), AccContextKey, &acc)
ctx = context.WithValue(ctx, payloadContextKey, &payloadInfo{value: b})
return test{
db: &acme.MockDB{},
Expand All @@ -937,7 +937,7 @@ func TestHandler_GetOrUpdateAccount(t *testing.T) {
}
b, err := json.Marshal(uar)
assert.FatalError(t, err)
ctx := context.WithValue(context.Background(), accContextKey, &acc)
ctx := context.WithValue(context.Background(), AccContextKey, &acc)
ctx = context.WithValue(ctx, payloadContextKey, &payloadInfo{value: b})
return test{
db: &acme.MockDB{
Expand All @@ -959,7 +959,7 @@ func TestHandler_GetOrUpdateAccount(t *testing.T) {
b, err := json.Marshal(uar)
assert.FatalError(t, err)
ctx := acme.NewProvisionerContext(context.Background(), prov)
ctx = context.WithValue(ctx, accContextKey, &acc)
ctx = context.WithValue(ctx, AccContextKey, &acc)
ctx = context.WithValue(ctx, payloadContextKey, &payloadInfo{value: b})
return test{
db: &acme.MockDB{
Expand All @@ -978,7 +978,7 @@ func TestHandler_GetOrUpdateAccount(t *testing.T) {
b, err := json.Marshal(uar)
assert.FatalError(t, err)
ctx := acme.NewProvisionerContext(context.Background(), prov)
ctx = context.WithValue(ctx, accContextKey, &acc)
ctx = context.WithValue(ctx, AccContextKey, &acc)
ctx = context.WithValue(ctx, payloadContextKey, &payloadInfo{value: b})
return test{
db: &acme.MockDB{},
Expand All @@ -993,7 +993,7 @@ func TestHandler_GetOrUpdateAccount(t *testing.T) {
b, err := json.Marshal(uar)
assert.FatalError(t, err)
ctx := acme.NewProvisionerContext(context.Background(), prov)
ctx = context.WithValue(ctx, accContextKey, &acc)
ctx = context.WithValue(ctx, AccContextKey, &acc)
ctx = context.WithValue(ctx, payloadContextKey, &payloadInfo{value: b})
return test{
db: &acme.MockDB{
Expand All @@ -1009,7 +1009,7 @@ func TestHandler_GetOrUpdateAccount(t *testing.T) {
},
"ok/post-as-get": func(t *testing.T) test {
ctx := acme.NewProvisionerContext(context.Background(), prov)
ctx = context.WithValue(ctx, accContextKey, &acc)
ctx = context.WithValue(ctx, AccContextKey, &acc)
ctx = context.WithValue(ctx, payloadContextKey, &payloadInfo{isPostAsGet: true})
return test{
db: &acme.MockDB{},
Expand Down
Loading
Loading