Skip to content

Commit

Permalink
fix: initialise schema service after auth
Browse files Browse the repository at this point in the history
  • Loading branch information
ljacobsson committed Nov 23, 2022
1 parent 5e00ad8 commit aaf96f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/commands/code-binding/code-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const schemaBrowser = require("../shared/schema-browser");
const inputUtil = require("../shared/input-util");
const templateParser = require("../shared/template-parser");
const SchemasClient = require("aws-sdk/clients/schemas");
const schemas = new SchemasClient();
const jsf = require("json-schema-faker");
const jp = require("jsonpath");
const toJsonSchema = require("to-json-schema");
Expand All @@ -20,6 +19,7 @@ require("./languages/python");
require("./languages/java");
require("./languages/swift");
async function loadFromRegistry(cmd) {
const schemas = new SchemasClient();
const schemaLocation = await schemaBrowser.getSchemaName(schemas);
const schema = await schemas
.exportSchema({
Expand All @@ -32,6 +32,8 @@ async function loadFromRegistry(cmd) {
}

async function loadFromTemplate(cmd) {
const schemas = new SchemasClient();

if (!cmd.registryName) {
cmd.registryName = (await inputUtil.getRegistry(schemas)).id;
}
Expand Down
1 change: 1 addition & 0 deletions src/commands/shared/auth-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ require("@mhlabs/aws-sdk-sso");
function initAuth(cmd) {

const credentials = new AWS.SharedIniFileCredentials({ profile: cmd.profile });
console.log(credentials);
if (credentials.accessKeyId) {
AWS.config.credentials = credentials;
} else {
Expand Down

0 comments on commit aaf96f3

Please sign in to comment.