Skip to content

Commit

Permalink
refactor(core-api): make schema names consistent in openapi spec
Browse files Browse the repository at this point in the history
Signed-off-by: Youngone Lee <youngone.lee@accenture.com>
  • Loading branch information
Leeyoungone committed Sep 23, 2021
1 parent 63e639e commit 7de3bce
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 264 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,37 @@ export class GetKeychainEntryEndpointV1 implements IWebServiceEndpoint {
return this.getOperation()["x-hyperledger-cactus"].http.verbLowerCase;
}

<<<<<<< HEAD
public getPath(): string {
return this.getOperation()["x-hyperledger-cactus"].http.path;
}

public getExpressRequestHandler(): IExpressRequestHandler {
throw new Error("Method not implemented.");
=======
public async handleRequest(req: Request, res: Response): Promise<void> {
const reqTag = `${this.getVerbLowerCase()} - ${this.getPath()}`;
this.log.debug(reqTag);
const { key } = req.body as GetKeychainEntryRequest;
//const reqBody = req.body;
try {
const value = await this.options.connector.get(key);
//const resBody = await this.options.connector.get(reqBody.key);
res.json({ key, value });
} catch (ex) {
if (ex?.message?.includes(`${key} secret not found`)) {
res.status(404).json({
key,
error: ex?.stack || ex?.message,
});
} else {
this.log.error(`Crash while serving ${reqTag}`, ex);
res.status(500).json({
message: "Internal Server Error",
error: ex?.stack || ex?.message,
});
}
}
>>>>>>> b00281c8... refactor(core-api): make schema names consistent in openapi spec
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ import {
import { registerWebServiceEndpoint } from "@hyperledger/cactus-core";

import OAS from "../../json/openapi.json";
<<<<<<< HEAD
=======
import { PluginKeychainAwsSm } from "../plugin-keychain-aws-sm";
import { SetKeychainEntryRequest } from "../generated/openapi/typescript-axios/api";
>>>>>>> b00281c8... refactor(core-api): make schema names consistent in openapi spec

export interface ISetKeychainEntryEndpointV1Options {
logLevel?: LogLevelDesc;
Expand Down

0 comments on commit 7de3bce

Please sign in to comment.