Skip to content

Commit aaf96f3

Browse files
committed
fix: initialise schema service after auth
1 parent 5e00ad8 commit aaf96f3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/commands/code-binding/code-binding.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const schemaBrowser = require("../shared/schema-browser");
22
const inputUtil = require("../shared/input-util");
33
const templateParser = require("../shared/template-parser");
44
const SchemasClient = require("aws-sdk/clients/schemas");
5-
const schemas = new SchemasClient();
65
const jsf = require("json-schema-faker");
76
const jp = require("jsonpath");
87
const toJsonSchema = require("to-json-schema");
@@ -20,6 +19,7 @@ require("./languages/python");
2019
require("./languages/java");
2120
require("./languages/swift");
2221
async function loadFromRegistry(cmd) {
22+
const schemas = new SchemasClient();
2323
const schemaLocation = await schemaBrowser.getSchemaName(schemas);
2424
const schema = await schemas
2525
.exportSchema({
@@ -32,6 +32,8 @@ async function loadFromRegistry(cmd) {
3232
}
3333

3434
async function loadFromTemplate(cmd) {
35+
const schemas = new SchemasClient();
36+
3537
if (!cmd.registryName) {
3638
cmd.registryName = (await inputUtil.getRegistry(schemas)).id;
3739
}

src/commands/shared/auth-helper.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ require("@mhlabs/aws-sdk-sso");
44
function initAuth(cmd) {
55

66
const credentials = new AWS.SharedIniFileCredentials({ profile: cmd.profile });
7+
console.log(credentials);
78
if (credentials.accessKeyId) {
89
AWS.config.credentials = credentials;
910
} else {

0 commit comments

Comments
 (0)