Skip to content

Commit

Permalink
fix(cypress config read): read the credentials in differently due to …
Browse files Browse the repository at this point in the history
…config refactor
  • Loading branch information
andrewleith committed Jan 18, 2024
1 parent 8df261e commit cbcaf57
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests_cypress/cypress/Notify/NotifyAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ const Utilities = {
};
const Admin = {
SendOneOff: ({to, template_id}) => {

var token = Utilities.CreateJWT(Cypress.env('ADMIN_USERNAME'), Cypress.env('ADMIN_SECRET'));
var token = Utilities.CreateJWT(Cypress.env('ADMIN_USERNAME'), Cypress.env(config.CONFIG_NAME).ADMIN_SECRET);
return cy.request({
url: `/service/${config.Services.Cypress}/send-notification`,
method: 'POST',
Expand All @@ -37,7 +36,7 @@ const Admin = {
body: {
'to': to,
'template_id': template_id,
'created_by': Cypress.env('NOTIFY_USER_ID'),
'created_by': Cypress.env(config.CONFIG_NAME).NOTIFY_USER_ID,
}
});
}
Expand Down Expand Up @@ -117,7 +116,7 @@ const API = {
});
},
CreateAPIKey: ({ service_id, key_type, name }) => {
var token = Utilities.CreateJWT(Cypress.env('ADMIN_USERNAME'), Cypress.env('ADMIN_SECRET'));
var token = Utilities.CreateJWT(Cypress.env('ADMIN_USERNAME'), Cypress.env(config.CONFIG_NAME).ADMIN_SECRET);
return cy.request({
url: `/service/${service_id}/api-key`,
method: 'POST',
Expand All @@ -127,12 +126,13 @@ const API = {
body: {
key_type: key_type,
name: name,
created_by: Cypress.env('NOTIFY_USER_ID'),
created_by: Cypress.env(config.CONFIG_NAME).NOTIFY_USER_ID,
}
});
},
RevokeAPIKey: ({ token, type, url, source, failOnStatusCode = true }) => {
var jwt_token = Utilities.CreateJWT(Cypress.env('SRE_USERNAME'), Cypress.env('SRE_SECRET'));

var jwt_token = Utilities.CreateJWT(Cypress.env('SRE_USERNAME'), Cypress.env(config.CONFIG_NAME).SRE_SECRET);
cy.request({
url: `/sre-tools/api-key-revoke`,
method: 'POST',
Expand All @@ -148,7 +148,7 @@ const API = {
});
},
RevokeAPIKeyWithAdminAuth: ({ token, type, url, source, failOnStatusCode = true }) => {
var jwt_token = Utilities.CreateJWT(Cypress.env('ADMIN_USERNAME'), Cypress.env('ADMIN_SECRET'));
var jwt_token = Utilities.CreateJWT(Cypress.env('ADMIN_USERNAME'),Cypress.env(config.CONFIG_NAME).ADMIN_SECRET);
return cy.request({
url: `/sre-tools/api-key-revoke`,
method: 'POST',
Expand Down

0 comments on commit cbcaf57

Please sign in to comment.