mirror of
https://github.com/swift-server/swift-openapi-lambda.git
synced 2026-05-03 07:22:26 +00:00
10f3e99c4d
Apply recommendations in code and documentation - [CI] restrict permissions to `read-all` instead of the default `write-all` - Example `openapi.yaml` : add a note about using `security:` definition when deploying to production - Example `README.md` : add a note about Lambda functions configuration with improved security and scalability changes for production environment
70 lines
1.5 KiB
YAML
70 lines
1.5 KiB
YAML
# This is an example API definition not suited for production
|
|
#
|
|
# In real life scenario, you must
|
|
# 1. Ensure that the global security field has rules defined
|
|
# 2. Ensure that security operations is not empty.
|
|
# https://learn.openapis.org/specification/security.html
|
|
#
|
|
# As per Checkov CKV_OPENAPI_4 and CKV_OPENAPI_5
|
|
|
|
openapi: 3.1.0
|
|
info:
|
|
title: StockQuoteService
|
|
version: 1.0.0
|
|
|
|
# security:
|
|
# - defaultApiKey: []
|
|
|
|
components:
|
|
schemas:
|
|
quote:
|
|
type: object
|
|
properties:
|
|
symbol:
|
|
type: string
|
|
price:
|
|
type: number
|
|
change:
|
|
type: number
|
|
changePercent:
|
|
type: number
|
|
volume:
|
|
type: number
|
|
timestamp:
|
|
type: string
|
|
format: date-time
|
|
|
|
paths:
|
|
/stocks/{symbol}:
|
|
get:
|
|
summary: Get the latest quote for a stock
|
|
operationId: getQuote
|
|
parameters:
|
|
- name: symbol
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
- name: date
|
|
in: query
|
|
required: false
|
|
schema:
|
|
type: string
|
|
format: date
|
|
tags:
|
|
- stocks
|
|
responses:
|
|
200:
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/quote'
|
|
400:
|
|
description: Bad Request
|
|
401:
|
|
description: Authentication required
|
|
404:
|
|
description: Not Found
|
|
# security:
|
|
# - defaultApiKey: [] |