Skip to content

Commit

Permalink
Switch to Gin (#433)
Browse files Browse the repository at this point in the history
* progress

* progress

* midddleware good

* temp

* temp2

* did done

* progress

* progress

* consistent server errs

* it builds

* working on tests

* more tests

* two more

* another 1

* two more

* one more

* fix lints

* cred test fix

* fix get did

* fix tests

* tests pass

* fix integration

* change back port

* fix path param weirdness

* renames

* update magefile

* mage

* config changes - temp

* update build

* update ci
  • Loading branch information
decentralgabe authored May 18, 2023
1 parent 3d67b63 commit 7047be5
Show file tree
Hide file tree
Showing 68 changed files with 1,579 additions and 1,545 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: End to End Test
name: Integration Tests

on:
push:
Expand Down Expand Up @@ -27,21 +27,21 @@ jobs:
run: go install github.com/magefile/mage

- name: Start containers
run: docker-compose -f "build/docker-compose.yml" up -d --build web redis uni-resolver-web driver-did-ion
run: docker-compose -f "build/docker-compose.yml" up -d --build ssi redis uni-resolver driver-did-ion

- name: End To End Test
run: mage integration

- name: Save Container Logs to File
if: failure()
run: docker logs web > web_logs.txt
run: docker logs ssi > ssi_logs.txt

- name: Upload Logs as Artifact
if: failure()
uses: actions/upload-artifact@v3
with:
name: logs
path: web_logs.txt
path: ssi_logs.txt

- name: Stop containers
if: always()
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/swagger-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- main

jobs:

generate-swagger:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Steps to issue an Employment Status Credential:
## Configuration

Managed via:
[TOML](https://toml.io/en/) [file](./config/config.toml)
[TOML](https://toml.io/en/) [file](config/dev.toml)

There are sets of configuration values for the server (e.g. which port to listen on), the services (e.g. which database to use),
and each service. Each service may define specific configuration, such as which DID methods are enabled for the DID
Expand Down
1 change: 0 additions & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ RUN go mod download
COPY . ./

# Build the binary and call it "docker-ssi-service"
RUN ls -alt
RUN go build -tags jwx_es256k -o /docker-ssi-service ./cmd/ssiservice

EXPOSE 3000
Expand Down
14 changes: 0 additions & 14 deletions build/Dockerfile-swagger

This file was deleted.

82 changes: 0 additions & 82 deletions build/docker-compose-published.yml

This file was deleted.

22 changes: 7 additions & 15 deletions build/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,34 @@
version: "3.98"

services:
web:
container_name: web
ssi:
container_name: ssi
build:
context: ../
dockerfile: build/Dockerfile
ports:
- "8080:3000"
environment:
- CONFIG_PATH=/app/config/test.toml
- JAEGER_HTTP_URL=http://jaeger:14268/api/traces
depends_on:
- jaeger
- redis
volumes:
- ../config/compose.toml:/app/config/config.toml
- ../config:/app/config
networks:
- ssi_network
- universal-resolver
links:
- uni-resolver-web
swagger-ui:
build:
context: ../
dockerfile: build/Dockerfile-swagger
ports:
- "8002:8080"
volumes:
- ../doc/swagger.yaml:/app/swagger.yaml
command: ["serve", "/app/swagger.yaml", "--no-open", "--port", "8080"]
- uni-resolver
gui:
build:
context: ../
dockerfile: build/Dockerfile-gui
ports:
- "8003:8501"
depends_on:
- web
- ssi
networks:
- ssi_network
jaeger:
Expand Down Expand Up @@ -68,7 +60,7 @@ services:
- "9001:8081"
networks:
- ssi_network
uni-resolver-web:
uni-resolver:
image: universalresolver/uni-resolver-web:latest
ports:
- "8088:8080"
Expand Down
7 changes: 4 additions & 3 deletions cmd/authserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ import (
"github.com/ory/fosite/storage"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/tbd54566975/ssi-service/config"
"github.com/tbd54566975/ssi-service/pkg/authorizationserver"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/exporters/jaeger"
"go.opentelemetry.io/otel/sdk/resource"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.18.0"

"github.com/tbd54566975/ssi-service/config"
"github.com/tbd54566975/ssi-service/pkg/authorizationserver"
)

func main() {
Expand Down Expand Up @@ -65,7 +66,7 @@ func run() error {
}
api := http.Server{
Addr: cfg.Server.APIHost,
Handler: srv,
Handler: srv.Handler,
ReadTimeout: cfg.Server.ReadTimeout,
WriteTimeout: cfg.Server.WriteTimeout,
}
Expand Down
Loading

0 comments on commit 7047be5

Please sign in to comment.