Skip to content

Instantly share code, notes, and snippets.

@jlines
Created December 15, 2015 03:33
Show Gist options
  • Save jlines/502bccab60bde72cf78b to your computer and use it in GitHub Desktop.
Save jlines/502bccab60bde72cf78b to your computer and use it in GitHub Desktop.
{
"swagger": "2.0",
"info": {
"title": "SSN API",
"description": "Deployment services provided by SSN",
"version": "1.0.0"
},
"host": "3gwntvs7mi.execute-api.us-east-1.amazonaws.com",
"schemes": [
"https"
],
"basePath": "/development",
"produces": [
"application/json"
],
"security": [{
"api_key": []
}],
"securityDefinitions": {
"api_key": {
"type": "apiKey",
"name": "x-ssn-accesstoken",
"in": "header"
}
},
"paths": {
"/auth": {
"get": {
"summary": "New API Token",
"description": "Aquire new api token based on username/password/claims",
"parameters": [{
"name": "X-SSN-Username",
"in": "header",
"description": "Username",
"required": true,
"type": "string"
}, {
"name": "X-SSN-Password",
"in": "header",
"description": "Password",
"required": true,
"type": "string"
}, {
"name": "X-SSN-Claims",
"in": "header",
"description": "List of permission claims, separated by commas",
"required": true,
"type": "string"
}],
"responses": {
"200": {
"description": "Api Token",
"headers": {
"x-ssn-accesstoken": {
"type": "string"
}
}
},
"400": {
"description": "Bad request"
},
"default": {
"description": "Unexpected error"
}
},
"x-amazon-apigateway-integration": {
"type": "aws",
"uri": "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:ACCOUNT_ID:function:myFunction/invocations",
"httpMethod": "POST",
"credentials": "arn:aws:iam::ACCOUNT_ID:role/lambda_exec_role",
"requestTemplates": {
"application/json": "json request template 2",
"application/xml": "xml request template 2"
},
"requestParameters": {
"integration.request.path.integrationPathParam": "method.request.querystring.latitude",
"integration.request.querystring.integrationQueryParam": "method.request.querystring.longitude"
},
"cacheNamespace": "cache namespace",
"cacheKeyParameters": [],
"responses": {
"2\\d{2}": {
"statusCode": "200",
"responseParameters": {
"method.response.header.test-method-response-header": "integration.response.header.integrationResponseHeaderParam1"
},
"responseTemplates": {
"application/json": "json 200 response template",
"application/xml": "xml 200 response template"
}
},
"default": {
"statusCode": "400",
"responseParameters": {
"method.response.header.test-method-response-header": "'static value'"
},
"responseTemplates": {
"application/json": "json 400 response template",
"application/xml": "xml 400 response template"
}
}
}
}
},
"options": {
"summary": "CORS Support",
"description": "Allow for CORS pre-flight requests",
"responses": {
"200": {
"description": "Preflight response",
"headers": {
"Access-Control-Allow-Headers": {
"type": "string"
},
"Access-Control-Allow-Methods": {
"type": "string"
},
"Access-Control-Allow-Origin": {
"type": "string"
}
}
}
},
"x-amazon-apigateway-integration": {
"type": "mock",
"requestTemplates": {
"application/json": {
"statusCode": 200
}
},
"responses": {
"default": {
"statusCode": "200",
"responseParameters": {
"method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-SSN-Claims,X-SSN-Password,X-SSN-Username'",
"method.response.header.Access-Control-Allow-Methods": "'*'",
"method.response.header.Access-Control-Allow-Origin": "'*'"
},
"responseTemplates": {
"application/json": ""
}
}
}
}
}
},
"/upload-token": {
"get": {
"summary": "Get a token for S3 Upload",
"description": "Provide a token for S3 upload",
"parameters": [{
"name": "to_sign",
"in": "query",
"description": "S3 Url to be signed in order to allow a client to upload",
"required": true,
"type": "string"
}, {
"name": "Authentication",
"in": "header",
"description": "Bearer token auth type",
"required": true,
"type": "string"
}],
"responses": {
"200": {
"description": "S3 upload token",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad request"
},
"default": {
"description": "Unexpected error"
}
},
"x-amazon-apigateway-integration": {
"type": "http",
"uri": "https://api.github.com",
"httpMethod": "GET",
"responses": {
"2\\d{2}": {
"statusCode": "200"
},
"default": {
"statusCode": "400",
"responseParameters": {
"method.response.header.test-method-response-header": "'static value'"
},
"responseTemplates": {
"application/json": "json 400 response template",
"application/xml": "xml 400 response template"
}
}
}
}
},
"options": {
"summary": "CORS Support",
"description": "Allow for CORS pre-flight requests",
"responses": {
"200": {
"description": "Preflight response",
"headers": {
"Access-Control-Allow-Headers": {
"type": "string"
},
"Access-Control-Allow-Methods": {
"type": "string"
},
"Access-Control-Allow-Origin": {
"type": "string"
}
}
}
},
"x-amazon-apigateway-integration": {
"type": "mock",
"requestTemplates": {
"application/json": {
"statusCode": 200
}
},
"responses": {
"default": {
"statusCode": "200",
"responseParameters": {
"method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization'",
"method.response.header.Access-Control-Allow-Methods": "'*'",
"method.response.header.Access-Control-Allow-Origin": "'*'"
},
"responseTemplates": {
"application/json": ""
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment