Skip to content

Instantly share code, notes, and snippets.

View kevinjom's full-sized avatar
💭
I may be slow to respond.

Kevin Fan kevinjom

💭
I may be slow to respond.
  • Singapore
View GitHub Profile
@kevinjom
kevinjom / tdd_oauth2_token_endpoint.md
Last active February 13, 2019 08:11
TDD workshop - Simplified OAuth2 Token endpoint

TDD workshop - Simplified OAuth2 Token endpoint

Simple implementation of Okta oauth2 /token endpoint. See https://developer.okta.com/docs/api/resources/oidc#token for the original api reference.

This endpoint only supports authorization_code grant type, and will only return the access_token in the response.

API spec

URL

POST ${baseUrl}/v1/token

swagger: '2.0'
info:
title: Todo API
description: A simple API to manage your todo tasks.
version: "1.0.0"
# the domain of the service
host: todo.bla.com
# array of all schemes that your API supports
schemes:
- http
SELECT
t.tablename,
indexname,
c.reltuples AS num_rows,
pg_size_pretty(pg_relation_size(quote_ident(t.tablename)::text)) AS table_size,
pg_size_pretty(pg_relation_size(quote_ident(indexrelname)::text)) AS index_size,
CASE WHEN indisunique THEN 'Y'
ELSE 'N'
END AS UNIQUE,
idx_scan AS number_of_scans,