Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,26 @@ VERSION := $(shell grep 'Version:' $(SPEC_FILE) | awk '{printf "%s", $$2
# Default target
all: build test

#
# OpenAPI Code Generation
#
API_SPECS := api/components.yaml api/health.yaml api/rvto2addr.yaml api/voucher.yaml api/resell.yaml
GENERATED_DIRS := internal/handlers/components internal/handlers/health internal/handlers/rvto2addr internal/handlers/voucher internal/handlers/resell

.PHONY: oapi-codegen
oapi-codegen:
@echo "Installing oapi-codegen..."
go get -tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest

.PHONY: generate
generate: oapi-codegen
go generate ./...



# Build the Go project
.PHONY: build
build: tidy fmt vet
build: generate tidy fmt vet
go build -ldflags="-X github.com/fido-device-onboard/go-fdo-server/internal/version.VERSION=${VERSION}"

.PHONY: tidy
Expand Down
67 changes: 67 additions & 0 deletions api/components.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
openapi: 3.0.3
info:
title: FDO Server - Shared Components
version: 1.0.0
description: Shared components for FDO Server APIs

paths: {}

components:
schemas:
Error:
type: object
required:
- error
- message
properties:
error:
type: string
description: Error type identifier
message:
type: string
description: Human-readable error message
details:
type: string
description: Additional error details

VoucherInsertResponse:
type: object
required:
- processed
- inserted
properties:
processed:
type: integer
description: Number of vouchers processed
inserted:
type: integer
description: Number of vouchers successfully inserted

VoucherResponse:
type: object
required:
- voucher
- encoding
properties:
voucher:
type: string
description: Base64 encoded voucher data
encoding:
type: string
enum: ["pem"]
description: Voucher encoding format

RVTO2Addr:
type: object
required:
- rvto2addr
properties:
rvto2addr:
type: array
items:
type: array
items:
oneOf:
- type: integer
- type: string
Comment on lines +54 to +66

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description: Rendezvous TO2 address information
Comment on lines +27 to +67

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are specific types, the should go in the respective APIs, please see #156

30 changes: 0 additions & 30 deletions api/handlers/health.go

This file was deleted.

108 changes: 0 additions & 108 deletions api/handlers/ownerinfo.go

This file was deleted.

110 changes: 0 additions & 110 deletions api/handlers/rvinfo.go

This file was deleted.

Loading
Loading