@flink-app/management-api-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.7.0-alpha.1 • Public • Published

Flink API Docs

WORK IN PROGRESS 👷‍♀️👷🏻‍♂️

A FLINK plugin that lets you expose management api:s for other plugins.

Other plugins must be able to generate a ManagementApiModule that can be registered with this plugin to expose management apis.

Usage

Install plugin to your flink app project:

npm i -S @flink-app/management-api-plugin

Add and configure plugin in your app startup (probable the index.ts in root project):

import { managementApiPlugin } from "@flink-app/management-api-plugin";


function start() {
  new FlinkApp<AppContext>({
    name: "My app",
    plugins: [
        // Register plugin
        managementApiPlugin({
          token : "SECRET_TOKEN_USED_TO_COMMUNICATE_WITH_THE_API",
          jwtSecret : "JWT_SECRET_USED_TO_GENERATE_LOGGED_IN_TOKENS",
          modules : []
        })
    ],
  }).start();
}

Communicating with the management api

To work with the management api you must in the http header management-token send either the token specified when register the plugin or a user login token.

The management API have it's own users system, where you might add, edit or remove management users.

To create a first user to your management api make a POST request to /managementapi/managementapiuser with http-header management-token set to the specified token.

curl 'https://URL-TO-YOUR-API/managementapi/managementapiuser' \
    -H 'management-token: SECRET_TOKEN_USED_TO_COMMUNICATE_WITH_THE_API' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  --data-raw '{"username":"test","password":"test"}'

Readme

Keywords

none

Package Sidebar

Install

npm i @flink-app/management-api-plugin

Weekly Downloads

7

Version

0.7.0-alpha.1

License

MIT

Unpacked Size

153 kB

Total Files

128

Last publish

Collaborators

  • joelso
  • jenkins-frost
  • johanfrost