coypu

command module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

README

Coypu

Create customizable server quickly from plugins.

Plugins

Coypu will ship with some basic plugins, enough to run.

Plugin Interfaces

Plugins can be called in any order. They should each have a function called "New" which takes in the config object described in the plugin yaml document, and a returns a function which takes in and returns a context map (the plugin itself).

Context Maps

The context map includes the http method, the query as a map, the request body, request headers as a map, error, resStatus, resBody, resHeaders for response sending, and authDenied as intended for an auth plugin to write to as needed.

At the end of all plugins, a response message with either a 5XX code and body error is sent, or a response message with a resStatus code, with body resBody and headers resHeaders.

Of course, plugins can write anything they would like to the context that they output to be used by other plugins in the stack. It's highly recommended to document this.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
config
plugins/jwtClient
JWT interface for Coypu config interactions - jwksURL -- where to get the jwks context interactions - jwtClaims -- where to put claims - jwt -- the token itself
JWT interface for Coypu config interactions - jwksURL -- where to get the jwks context interactions - jwtClaims -- where to put claims - jwt -- the token itself

Jump to

Keyboard shortcuts

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