diff --git a/pom.xml b/pom.xml index 04d57b4cd..14e6995c0 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.uid2 uid2-admin - 5.5.0 + 5.5.5-alpha-56-SNAPSHOT UTF-8 diff --git a/webroot/adm/client-key.html b/webroot/adm/client-key.html index 145681788..309261ae2 100644 --- a/webroot/adm/client-key.html +++ b/webroot/adm/client-key.html @@ -5,7 +5,7 @@ -

UID2 Admin - Client Key Management

+

UID2 Env - Client Key Management

Back diff --git a/webroot/adm/client-side-keypairs.html b/webroot/adm/client-side-keypairs.html index 4bd45c960..966906d23 100644 --- a/webroot/adm/client-side-keypairs.html +++ b/webroot/adm/client-side-keypairs.html @@ -4,7 +4,7 @@ -

UID2 Admin - Client Side Keypair Management

+

UID2 Env - Client Side Keypair Management

Back diff --git a/webroot/adm/enclave-gcp-v2.html b/webroot/adm/enclave-gcp-v2.html index 1c1f01157..fe842ba23 100644 --- a/webroot/adm/enclave-gcp-v2.html +++ b/webroot/adm/enclave-gcp-v2.html @@ -11,7 +11,7 @@ -

UID2 Admin - GCP Enclave ID Tool(V2)

+

UID2 Env - GCP Enclave ID Tool(V2)

Back diff --git a/webroot/adm/enclave-gcp.html b/webroot/adm/enclave-gcp.html index ee06ff20c..fdf32086b 100644 --- a/webroot/adm/enclave-gcp.html +++ b/webroot/adm/enclave-gcp.html @@ -11,7 +11,7 @@ -

UID2 Admin - GCP Enclave ID Tool

+

UID2 Env - GCP Enclave ID Tool

Back diff --git a/webroot/adm/enclave-id.html b/webroot/adm/enclave-id.html index e26389959..af5717a47 100644 --- a/webroot/adm/enclave-id.html +++ b/webroot/adm/enclave-id.html @@ -4,7 +4,7 @@ -

UID2 Admin - Enclave Identifier Management

+

UID2 Env - Enclave Identifier Management

Back diff --git a/webroot/adm/encryption-key.html b/webroot/adm/encryption-key.html index 306a089dc..c36ad65b6 100644 --- a/webroot/adm/encryption-key.html +++ b/webroot/adm/encryption-key.html @@ -4,7 +4,7 @@ -

UID2 Admin - Encryption Key Management

+

UID2 Env - Encryption Key Management

Back diff --git a/webroot/adm/key-acl.html b/webroot/adm/key-acl.html index 26b1020f0..5f80f2c18 100644 --- a/webroot/adm/key-acl.html +++ b/webroot/adm/key-acl.html @@ -4,7 +4,7 @@ -

Deprecated: UID2 Admin - Key ACL Management

+

Deprecated: UID2 Env - Key ACL Management

UID2-2758: Key ACL entries must no longer be created. Read only by legacy operators now.

diff --git a/webroot/adm/keysets.html b/webroot/adm/keysets.html index 5b1cf360e..a61d72aaf 100644 --- a/webroot/adm/keysets.html +++ b/webroot/adm/keysets.html @@ -4,7 +4,7 @@ -

UID2 Admin - Keyset Access Management

+

UID2 Env - Keyset Access Management

Back diff --git a/webroot/adm/oncall/generate-api-key-secret.html b/webroot/adm/oncall/generate-api-key-secret.html new file mode 100644 index 000000000..86c9472fa --- /dev/null +++ b/webroot/adm/oncall/generate-api-key-secret.html @@ -0,0 +1,650 @@ + + + + + + + + + + + + + + + + +
+
+
+

UID2 Env - On-call - Generate Client API Key/Secret

+
+
+
+ Back +
+
+
+
+
+
+

Instructions

+
+
+
+
+
    +
  1. Search for a participant with the requested name from the Jira ticket.
  2. +
  3. If a site exists use the Site Id to update the site if necessary.
  4. +
  5. Use the Site Id to create a client API key and secret if necessary.
  6. +
+
+
+
+
+
Search for existing participants:
+
+
+
+
+
+ + +
+
+
+ Search +
+
+
+
+
Search Results:
+
+
+
+ +
+
+ +
+ +
+ + + + + + + +
SitesClient API Keys
+
+
+
+
+
+
+
+
+
Create / Update Operations:
+
+
+
+ Use this to create a new site, update existing sites or create new Client API Key and Secrets. +
+
+
+
+ + + + +
+
+
+
+
+
+
+
Create a new site
+ + + +
+ Client Types: +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ Create + +
+
+
Create Site response:
+
+ +

+                                                        
+ +
+
+
+
+

+                                                    
+
+
+
+
+
+
+
+
+
+
Update an existing site
+
+ + +
+ Search +
+ +
+ +
+
+ +
+ +
+ + + +
+ Client Types: +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+ + Update + +
+
+
Update Site response:
+
+ +

+                                                        
+
+
+ +
+
+
+

+                                                
+
+ +
+
+
+
+
+
+
+
Create a new client API Key
+ +
+ + +
+
+ + + +
+
+ Roles: +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ Create + +
+
+
Please copy and paste this to a new TradeSecret: +
+
+ +

+                                                        
+
+
+
Please copy and paste this into a comment on the JIRA ticket: +
+
+ +

+                                                        
+
+
+
This is the output for reference. You should not need to copy this. +
+
+

+                                                        
+
+
+
+
+
+

+                                                
+
+
+
+
+
+ +
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/webroot/adm/oncall/generate-cstg-keypair.html b/webroot/adm/oncall/generate-cstg-keypair.html new file mode 100644 index 000000000..22b950d70 --- /dev/null +++ b/webroot/adm/oncall/generate-cstg-keypair.html @@ -0,0 +1,636 @@ + + + + + + + + + + + + + + + +
+
+
+

UID2 Env - On-call - Generate CSTG Keypair

+
+
+
+ Back +
+
+
+
+
+
+

Instructions

+
+
+
+
+
    +
  1. Search for a participant with the requested name from the Jira ticket.
  2. +
  3. If a site exists use the Site Id to update the site if necessary.
  4. +
  5. Use the Site Id to create a CSTG key pair if necessary.
  6. +
+
+
+
+
+
Search for existing participants:
+
+
+
+
+
+ + +
+
+
+ Search +
+
+
+
+
Search Results:
+
+
+
+ +
+
+ +
+
+ + + + + + + +
SitesCSTG Keypairs
+
+
+
+
+
+
+
+
+
Create / Update Operations:
+
+
+
+ Use this to create new site, update existing sites or create new key pairs. +
+
+
+
+ + + +
+
+
+
+
+
+
+
Create a new site
+ + + +
+ + + +
+
+ + +
+
+ + +
+ Create + +
+
+
Create Site response:
+
+ +

+                                                        
+ +
+
+
+
+

+                                                    
+
+
+
+
+
+
+
+
+
+
Update an existing site
+
+ + +
+ Search +
+ +
+ +
+
+ +
+ +
+ + +
+ + +
+
+ + +
+
+ + +
+ +
+ + +
If the participant is an Advertiser, check UID2 CSTG How to create a new client side keypair for details
+
+ Update + +
+
+
Update Site response:
+
+ +

+                                                        
+
+
+ +
+
+
+

+                                                
+
+
+
+
+
+
+
+
+
Create a new CSTG Pair
+ +
+ + + +
+
+ + +
+ Create + +
+
+
Please copy and paste this to a private message: +
+
+ +

+                                                        
+
+
+
Please copy and paste this into a comment on the JIRA ticket: +
+
+ +

+                                                        
+
+
+
This is the output for reference. You should not need to copy this. +
+
+

+                                                        
+
+
+
+
+
+

+                                                
+
+
+
+
+ +
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/webroot/adm/oncall/search.html b/webroot/adm/oncall/search.html new file mode 100644 index 000000000..0a88c63f1 --- /dev/null +++ b/webroot/adm/oncall/search.html @@ -0,0 +1,75 @@ + + + + + + + + + + +
+
+
+

UID2 Env - On-call - Key and Secret Search

+
+
+
+ Back +
+
+
+
+
+
+
Search
+
+
+
+
+
+ + +
+
+
+ Search +
+
+
+
+
Search Results:
+
+
+
+

+                        

+                    
+
+
+ +
+
+ + + + + \ No newline at end of file diff --git a/webroot/adm/operator-key.html b/webroot/adm/operator-key.html index 4b9570cfd..a74623be4 100644 --- a/webroot/adm/operator-key.html +++ b/webroot/adm/operator-key.html @@ -4,7 +4,7 @@ -

UID2 Admin - Operator Key Management

+

UID2 Env - Operator Key Management

Back diff --git a/webroot/adm/partner-config.html b/webroot/adm/partner-config.html index e1803860b..343bfa9ac 100644 --- a/webroot/adm/partner-config.html +++ b/webroot/adm/partner-config.html @@ -4,7 +4,7 @@ -

UID2 Admin - Partner Config

+

UID2 Env - Partner Config

Back diff --git a/webroot/adm/salt.html b/webroot/adm/salt.html index d4a0a3f41..479b26bf8 100644 --- a/webroot/adm/salt.html +++ b/webroot/adm/salt.html @@ -4,7 +4,7 @@ -

UID2 Admin - Salt Management

+

UID2 Env - Salt Management

Back diff --git a/webroot/adm/search.html b/webroot/adm/search.html deleted file mode 100644 index 6ef203f2a..000000000 --- a/webroot/adm/search.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - -

UID2 Admin - Key and Secret Search

- -Back - -
-
- -

Inputs

- - - -Search - -
-
- -

Output

- -
-

-    

-
- - - - - diff --git a/webroot/adm/service-links.html b/webroot/adm/service-links.html index c83e6be0e..29e28c8fe 100644 --- a/webroot/adm/service-links.html +++ b/webroot/adm/service-links.html @@ -4,7 +4,7 @@ -

UID2 Admin - Service Link Management

+

UID2 Env - Service Link Management

Back diff --git a/webroot/adm/services.html b/webroot/adm/services.html index 1cd6c1e20..031b623b5 100644 --- a/webroot/adm/services.html +++ b/webroot/adm/services.html @@ -4,7 +4,7 @@ -

UID2 Admin - Service Management

+

UID2 Env - Service Management

Back diff --git a/webroot/adm/site.html b/webroot/adm/site.html index 55f4c48cb..5cab7f5fb 100644 --- a/webroot/adm/site.html +++ b/webroot/adm/site.html @@ -5,7 +5,7 @@ -

UID2 Admin - Site Management

+

UID2 Env - Site Management

Back diff --git a/webroot/css/copy.svg b/webroot/css/copy.svg new file mode 100644 index 000000000..b59068028 --- /dev/null +++ b/webroot/css/copy.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/webroot/css/style.css b/webroot/css/style.css index bd3846a9e..0507ea180 100644 --- a/webroot/css/style.css +++ b/webroot/css/style.css @@ -1,4 +1,4 @@ .message { font-weight: bold; background-color: #FFFF00; -} \ No newline at end of file +} diff --git a/webroot/index.html b/webroot/index.html index 2dc194e27..771da807e 100644 --- a/webroot/index.html +++ b/webroot/index.html @@ -4,7 +4,7 @@ -

UID2 Admin Site

+

UID2 Env Admin Site

+ + + +
+
diff --git a/webroot/js/main.js b/webroot/js/main.js index ddc4e2fdf..b788abdf8 100644 --- a/webroot/js/main.js +++ b/webroot/js/main.js @@ -1,19 +1,14 @@ function doApiCall(method, url, outputDiv, errorDiv, body) { - $(outputDiv).text(''); - $(errorDiv).text(''); + $(outputDiv).text(""); + $(errorDiv).text(""); $.ajax({ type: method, url: url, - dataType: 'text', - data : body, - success: function (text) { - const pretty = JSON.stringify(JSON.parse(text),null,2); - $(outputDiv).text(pretty); - }, - error: function (err) { - standardErrorCallback(err, errorDiv) - } + dataType: "text", + data: body, + success: text => setOutput(text, outputDiv), + error: err => standardErrorCallback(err, errorDiv) }); } @@ -21,38 +16,46 @@ function doApiCallWithCallback(method, url, onSuccess, onError, body) { $.ajax({ type: method, url: url, - dataType: 'text', - data : body, - success: function (text) { - onSuccess(text); - }, - error: function (err) { - standardErrorCallback(err, undefined, onError); - } + dataType: "text", + data: body, + success: text => onSuccess(text), + error: err => onError(err) }); } -function errorCallback(err) { standardErrorCallback(err, '#errorOutput') } +function setOutput(text, div) { + const pretty = JSON.stringify(JSON.parse(text), null, 2); + $(div).text(pretty); +} + +function errorCallback(err) { + standardErrorCallback(err, "#errorOutput") +} function standardErrorCallback(err, errorDiv, onError) { - if(err.getResponseHeader("REQUIRES_AUTH") == 1) { - $('body').hide() - $('body').replaceWith("Unauthorized, prompting reauthentication...") - $('body').show() + if (err.getResponseHeader("REQUIRES_AUTH") == 1) { + $("body").hide() + $("body").replaceWith("Unauthorized, prompting reauthentication...") + $("body").show() $(function () { - setTimeout(function() { + setTimeout(function () { window.location.replace("/login"); }, 3000); }); } else { - if(onError === undefined) { - $(errorDiv).text('Error: ' + err.status + ': ' + (isJsonString(err.responseText) ? JSON.parse(err.responseText).message : (err.responseText ? err.responseText : err.statusText))); + if (onError === undefined) { + $(errorDiv).text("Error: " + err.status + ": " + (isJsonString(err.responseText) ? JSON.parse(err.responseText).message : (err.responseText ? err.responseText : err.statusText))); } else { onError(err); } } } +function alertErrorCallback(err, errorDiv, alert) { + $(errorDiv).text("Error: " + err.status + ": " + (isJsonString(err.responseText) ? JSON.parse(err.responseText).message : (err.responseText ? err.responseText : err.statusText))); + $(alert).collapse('show'); +} + function isJsonString(str) { try { JSON.parse(str); @@ -62,37 +65,75 @@ function isJsonString(str) { return true; } +function clearFormsAndShowCollapsed(toShow) { + const exclude = toShow.join(','); + $(".form-clear").not(exclude).text(""); + $("form").trigger("reset"); + $('.collapse').not(exclude).collapse('hide'); + $(".group").removeClass("btn-primary").addClass("btn-secondary"); + + setTimeout(function () { + toShow.forEach((regionId) => { + $(regionId).collapse('show'); + }) + }, 400); // the collapse takes 350ms, so wait until all are done before showing them +} + function init() { $.ajax({ - type: 'GET', - url: '/api/userinfo', - dataType: 'text', + type: "GET", + url: "/api/userinfo", + dataType: "text", success: function (text) { - var u = JSON.parse(text); - $('#loginEmail').text(u.email); - $('.authed').show(); - if (u.groups.findIndex(e => e === 'developer' || e === 'developer-elevated' || e === 'infra-admin' || e === 'admin') >= 0) { - $('.ro-cki').show(); - $('.ro-opm').show(); - $('.ro-adm').show(); - $('.ro-sem').show(); + const u = JSON.parse(text); + + $("#loginEmail").text(u.email); + $(".authed").show(); + + if (u.groups.findIndex(e => e === "developer" || e === "developer-elevated" || e === "infra-admin" || e === "admin") >= 0) { + $(".ro-cki").show(); + $(".ro-opm").show(); + $(".ro-adm").show(); + $(".ro-sem").show(); } if (u.groups.length === 0) { - $('.ro-nil').show(); + $(".ro-nil").show(); } }, - error: function (err) { - // alert('Error: ' + err.status + ': ' + JSON.parse(err).message); - $('.notauthed').show(); + error: err => { + // alert("Error: " + err.status + ": " + JSON.parse(err).message); + $(".notauthed").show(); } }); - $(document).ready(function () { - if (window.location.origin.endsWith('.eu')) { - let header = $("h1").first(); + $(document).ready(() => { + const header = $("h1").first(); + + if (window.location.origin.includes("prod")) { + header.text(header.text().replace("Env", "Prod")); + } else if (window.location.origin.includes("integ")) { + header.text(header.text().replace("Env", "Integ")); + } else if (window.location.origin.includes("localhost") || (window.location.origin.includes("127.0.0.1"))) { + header.text(header.text().replace("Env", "Local")); + } else { + header.text(header.text().replace("Env", "")); + } + + if (window.location.origin.endsWith(".eu")) { header.text(header.text().replace("UID2", "EUID")); } + + $(".group").on("click", (e) => { + $(".group").removeClass("btn-primary").addClass("btn-secondary"); + + if ($("#" + e.target.id).attr("aria-expanded") == "false") { + $("#" + e.target.id).removeClass("btn-primary").addClass("btn-secondary"); + } else { + $("#" + e.target.id).removeClass("btn-secondary").addClass("btn-primary"); + } + }) }); + } -init(); +init(); \ No newline at end of file