Skip to content

Commit 46aed4f

Browse files
authored
Merge pull request #516 from bheesham/eqs-integrity-line-cryptokey
feat(tf): EQS Integrity line requires adding a custom attribute
2 parents 43ccdb4 + c54b573 commit 46aed4f

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

tf/actions.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ resource "auth0_action" "samlMappings" {
8686
id = "post-login"
8787
version = "v3"
8888
}
89+
90+
# EQS Integrity Line requires an additional parameter.
91+
# https://mozilla-hub.atlassian.net/browse/IAM-1827
92+
secrets {
93+
name = "samlMappings_eqs_integrity_line_cryptokey"
94+
value = local.parsed_secrets["samlMappings_eqs_integrity_line_cryptokey"]
95+
}
8996
}
9097

9198
resource "auth0_action" "gheGroups" {

tf/actions/samlMappings.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,19 @@ exports.onExecutePostLogin = async (event, api) => {
225225
api.samlResponse.setAttribute("grant_all_merchant_accounts", "true");
226226
api.samlResponse.setAttribute("roles", event.user.app_metadata.groups);
227227
break;
228+
229+
case "3c7lAT2sPywWjvgVP5ngCQysHtnNqQFj": // EQS Integrity Line
230+
const cryptokey = event.secrets.samlMappings_eqs_integrity_line_cryptokey;
231+
if (!cryptokey) {
232+
console.log(
233+
"Required secret cryptokey not set (for app EQS Integrity Line)"
234+
);
235+
return api.access.deny(
236+
"No specified cryptokey (SAML misconfiguration)."
237+
);
238+
}
239+
api.samlResponse.setAttribute("cryptokey", cryptokey);
240+
break;
228241
}
229242

230243
return;

0 commit comments

Comments
 (0)