diff --git a/README.md b/README.md index 9a29cfb..fc6f006 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ Available Commands: dir Analyze cryptographic assets in a directory help Help about any command image Analyze cryptographic assets in a container image + server Start a server (port: 8080, see openapi.yaml) Flags: -b, --bom string BOM file to be verified and enriched @@ -113,7 +114,10 @@ Server: Docker Engine - Community ```shell docker build -t cbomkit-theia . +# CLI docker run cbomkit-theia [command] > enriched_CBOM.json +# Server +docker run -d -p 8080:8080 cbomkit-theia ``` ### Compiled diff --git a/cmd/server.go b/cmd/server.go index bf0a09f..02eb2cf 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -24,7 +24,7 @@ import ( var serverCmd = &cobra.Command{ Use: "server", - Short: "Start a server", + Short: "Start a server (port: 8080, see openapi.yaml)", Run: func(cmd *cobra.Command, args []string) { server.Serve() }, diff --git a/openapi.yaml b/openapi.yaml index 89b5638..2f9601b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -6,9 +6,9 @@ info: url: http://www.apache.org/licenses/LICENSE-2.0.html version: 0.0.1 paths: - /api/v1/image/get: + /api/v1/image: post: - summary: Generate CBOM from existing image + summary: Generate CBOM from a Container Image requestBody: required: true content: @@ -17,7 +17,7 @@ paths: type: object properties: image: - description: Identifier for Image + description: Identifier for the Container Image example: "nginx" type: string plugins: diff --git a/server/server.go b/server/server.go index edec866..586fc6e 100644 --- a/server/server.go +++ b/server/server.go @@ -50,7 +50,7 @@ func Serve() { r.SetTrustedProxies(nil) v1 := r.Group("/api/v1") { - v1.POST("/image/get", imageGet) + v1.POST("/image", imageGet) } r.Run(":8080") // listen and serve on 0.0.0.0:8080 }