Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

credentials manager initial poc #24

Merged
merged 5 commits into from
May 19, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
profile as a const
Signed-off-by: Johnny On <[email protected]>
johnnyon-amzn committed May 18, 2022
commit 07f7e7adf13ce249111d0ac51ecc5c3237e66559
31 changes: 8 additions & 23 deletions src/renderer.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
let config = {};
const PROFILE = document.getElementById("profile");
function getMapping() {
return [{id: "awsAccessKeyId", key: "AWS_ACCESS_KEY_ID"},
{id: "awsSecretAccessKey", key: "AWS_SECRET_ACCESS_KEY"},
@@ -31,19 +14,18 @@ function init() {

async function populateFields() {
config = window.electron.getConfig();
let profile = document.getElementById("profile");
profile.innerHTML = "";
let PROFILE = document.getElementById("profile");
PROFILE.innerHTML = "";

let options = Object.keys(config).map(function(name) {
return `<option value="${name}">${name}</option>`
});
profile.innerHTML += options.join('');
PROFILE.innerHTML += options.join('');

}

function getActiveConfig() {
let profile = document.getElementById("profile");
var name = profile.options[profile.selectedIndex].value;
var name = PROFILE.options[PROFILE.selectedIndex].value;
return config[name] || null;
}

@@ -68,6 +50,8 @@ function addListeners() {

//get active profile config
let activeConfig = getActiveConfig();
console.log(activeConfig);

await window.electron.startProxy(activeConfig);
await window.electron.startOSD(activeConfig);
waitForServer();
@@ -77,6 +61,7 @@ function addListeners() {

async function waitForServer() {
let osdStatus = await window.electron.getOSDStatus();
console.log(osdStatus);
if (osdStatus["os"] == "green" && osdStatus["osd"] == "green") {
window.electron.ipcRenderer.invoke("swapURL", "http://localhost:5601");
} else {