OpenAuth_server/src/api/internal/index.ts

31 lines
963 B
TypeScript
Raw Normal View History

2018-11-06 19:48:50 +00:00
import { Router } from "express";
2019-03-13 01:06:09 +00:00
import { OAuthInternalApp } from "./oauth";
import PasswordAuth from "./password";
2018-11-06 19:48:50 +00:00
const InternalRoute: Router = Router();
2019-03-14 22:10:39 +00:00
/**
* @api {get} /internal/oauth
* @apiName ClientInteralOAuth
2020-08-07 14:16:39 +00:00
*
2019-03-14 22:10:39 +00:00
* @apiGroup client_internal
* @apiPermission client_internal Only ClientID
2020-08-07 14:16:39 +00:00
*
2019-03-14 22:10:39 +00:00
* @apiParam {String} redirect_uri Redirect URI called after success
* @apiParam {String} state State will be set in RedirectURI for the client to check
*/
2018-11-06 19:48:50 +00:00
InternalRoute.get("/oauth", OAuthInternalApp);
2019-03-14 22:10:39 +00:00
/**
* @api {post} /internal/password
* @apiName ClientInteralPassword
2020-08-07 14:16:39 +00:00
*
2019-03-14 22:10:39 +00:00
* @apiGroup client_internal
* @apiPermission client_internal Requires ClientID and Secret
2020-08-07 14:16:39 +00:00
*
2019-03-14 22:10:39 +00:00
* @apiParam {String} username Username (either username or UID)
* @apiParam {String} uid User ID (either username or UID)
* @apiParam {String} password Hashed and Salted according to specification
*/
2020-08-07 14:16:39 +00:00
InternalRoute.post("/password", PasswordAuth);
export default InternalRoute;