bissy-api

command module
v0.0.0-...-2d572df Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2021 License: MIT Imports: 27 Imported by: 0

README

🤖 bissy-api

CI Maintainability Test Coverage Go Report Card

Some toy APIs to learn go!

Getting Started

This project comes with a docker-compose setup! If you want to run the webserver use docker-compose up dev. The webserver will watch *.go files and recompile and restart whenever you make a change.

For testing, run docker-compose up test, again this process will watch for changes to *.go files and recompile and re-run the test suite on every change.

Auth

Authentication is done via JWT Token or API Token. You can get a JWT token via Github OAuth, via this url:

https://api.bissy.io/auth/github/signin?redirect_uri=https://api.bissy.io/auth/github/token

Subsequent request to the API will need to set the Authorization header with the Bearer token equal to the token returned from the above request. A potential exchange might look like this (on macOS):

open "https://api.bissy.io/auth/github/signin?redirect_uri=https://api.bissy.io/auth/github/token"
# Returns a JSON payload of `{ "token": "a-jwt-token" }

curl -i -H "Authorization: Bearer a-jwt-token" "https://api.bissy.io/authping

To create an apikey:

curl -i -H "Authorization: Bearer a-jwt-token" \
        -H "Content-Type: application/json" \
        -d '{ "name": "Personal API Key" }' \
        "https://api.bissy.io/auth/apikeys"

# Returns { id: "an-id", "name": "Personal API Key", "key": "the-api-key"}
# The "key" value will no longer be exposed after this call, make sure you keep it safe!

curl -i -H "X-Bissy-Apikey: the-api-key" "https://api.bissy.io/authping"

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL