# @mitoai/gintonic-api

> This projects contains a reference API implementation, which using a koa server exposes the transformed API and subsequently routes requests to the source API. We encourage that you develop your own API that fits your needs.!

Latest version **0.2.0** (published 2018-12-12) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @mitoai/gintonic-api
pnpm add @mitoai/gintonic-api
yarn add @mitoai/gintonic-api
bun add @mitoai/gintonic-api
```

Provides the command `gintonic`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2018-12-12 |
| First published | 2018-12-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 12.1 KB |
| Known vulnerabilities | 0 (+4 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 28 |
| Author | Christian Budde Christensen |
| Maintainers | budde377 |

## Links

- npm: https://www.npmjs.com/package/@mitoai/gintonic-api
- Repository: https://github.com/mitoai/gintonic
- Homepage: https://github.com/mitoai/gintonic#readme
- Issues: https://github.com/mitoai/gintonic/issues
- npm.io page: https://npm.io/package/@mitoai/gintonic-api

## Dependencies (11)

- [koa](https://npm.io/package/koa.md) ^2.6.2
- [config](https://npm.io/package/config.md) ^3.0.0
- [graphql](https://npm.io/package/graphql.md) ^14.0.2
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.12.0
- [jwks-rsa](https://npm.io/package/jwks-rsa.md) ^1.3.0
- [@koa/cors](https://npm.io/package/@koa/cors.md) ^2.2.2
- [koa-router](https://npm.io/package/koa-router.md) ^7.4.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.3.0
- [http-errors](https://npm.io/package/http-errors.md) ^1.7.1
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.4.0
- [@mitoai/gintonic-koa](https://npm.io/package/@mitoai/gintonic-koa.md) ^0.2.0

## Recent versions

- 0.2.0 (latest) — 2018-12-12

## README

# GraphQL Transformer reference API

This projects contains a reference API implementation, which using a 
koa server exposes the transformed API and subsequently routes requests to the
source API. We encourage that you develop your own API that fits your needs.! 

Notice that this API is accepting JWT tokens, which when verified will
be exchanged for an upstream token. Accepting tokens that will only work for 
this API enables strong access separation, and can potentially remove the need
for scopes or other authentication mechanisms.  Assuming that the target API
is only accepting tokens with audience claim `T`, the upstream api only tokens with audience 
claim `S`, and that `S =/= T` then there is no chance that the user of the target API
can access data on the upstream API. Pretty neato! 

This API is configurable by environment variables, which includes:


| Variable | Description |
|----------|-------------|
| `TRANSFORMATION` | The GraphQL Transformation. If omitted, the API will look for the file `transformation.grapqht` in the current working directory. |
| `SCHEMA` | The upstream schema. If omitted, the schema will first look for the file `schema.graphql` in the current working directory. If not found it will be fetched on start up. |
| `UPSTREAM_URL` | The url for the upstream server. |
| `AUTH_CLIENT_ID` | Client id used for generating upstream tokens.|
| `AUTH_CLIENT_SECRET` | Client secret used for generating upstream tokens. |
| `AUTH_AUDIENCE` | Audience claim for the target api server. |
| `AUTH_DOMAIN` | Domain at witch the jwks can be fetched for token verification. |

---
_Source: https://npm.io/package/@mitoai/gintonic-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
