-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathscript-text.mock.data.ts
More file actions
121 lines (114 loc) · 8.58 KB
/
script-text.mock.data.ts
File metadata and controls
121 lines (114 loc) · 8.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*
* @forgerock/javascript-sdk
*
* script-text.mock.data.ts
*
* Copyright (c) 2020 - 2026 Ping Identity Corporation. All rights reserved.
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
/* eslint-disable no-useless-escape */
import type { CallbackType } from '../auth/enums';
/* eslint-disable max-len */
const displayRecoveryCodes = `/*
* Copyright 2018 ForgeRock AS. All Rights Reserved
*
* Use of this code requires a commercial software license with ForgeRock AS.
* or with one of its affiliates. All use shall be exclusively subject
* to such license between the licensee and ForgeRock AS.
*/\n\nvar newLocation = document.getElementById(\"wrapper\");\nvar oldHtml = newLocation.getElementsByTagName(\"fieldset\")[0].innerHTML;\nnewLocation.getElementsByTagName(\"fieldset\")[0].innerHTML = \"<div class=\\\"panel panel-default\\\">\\n\" +
\" <div class=\\\"panel-body text-center\\\">\\n\" +
\" <h3>Your Recovery Codes</h3>\\n\" +
\" <h4>You must make a copy of these WebAuthn authenticator recovery codes. They cannot be displayed again.</h4>\\n\" +
\" </div>\\n\" +
\"<div class=\\\"text-center\\\">\\n\" +
\"iZmEtxvQ00\\n\" +
\"</div>\\n\" +
\"<div class=\\\"text-center\\\">\\n\" +
\"Eqw3GFVamY\\n\" +
\"</div>\\n\" +
\"<div class=\\\"text-center\\\">\\n\" +
\"nNPqIEtIpS\\n\" +
\"</div>\\n\" +
\"<div class=\\\"text-center\\\">\\n\" +
\"vGhNQpDjP8\\n\" +
\"</div>\\n\" +
\"<div class=\\\"text-center\\\">\\n\" +
\"ItA4W3iBaA\\n\" +
\"</div>\\n\" +
\"<div class=\\\"text-center\\\">\\n\" +
\"JmLQP6XyIo\\n\" +
\"</div>\\n\" +
\"<div class=\\\"text-center\\\">\\n\" +
\"G2e6foNKke\\n\" +
\"</div>\\n\" +
\"<div class=\\\"text-center\\\">\\n\" +
\"h2SqAqvT21\\n\" +
\"</div>\\n\" +
\"<div class=\\\"text-center\\\">\\n\" +
\"q6VX1ojNbI\\n\" +
\"</div>\\n\" +
\"<div class=\\\"text-center\\\">\\n\" +
\"IZKIQXAfY2\\n\" +
\"</div>\\n\" +
\"<div class=\\\"panel-body text-center\\\">\\n\" +
\" <p>Use one of these codes to authenticate if you lose your device, which has been named: <em>New Security Key</em></p>\\n\" +
\"</div>\\n\" +
\"</div>\" + oldHtml;\ndocument.body.appendChild(newLocation);\n\n\n
`;
const displayRecoveryCodesResponse = {
authId: 'foo',
callbacks: [
{
type: 'TextOutputCallback' as CallbackType.TextOutputCallback,
output: [
{
name: 'message',
value:
'/*\n * Copyright 2018 ForgeRock AS. All Rights Reserved\n *\n * Use of this code requires a commercial software license with ForgeRock AS.\n * or with one of its affiliates. All use shall be exclusively subject\n * to such license between the licensee and ForgeRock AS.\n */\n\nvar newLocation = document.getElementById("wrapper");\nvar oldHtml = newLocation.getElementsByTagName("fieldset")[0].innerHTML;\nnewLocation.getElementsByTagName("fieldset")[0].innerHTML = "<div class=\\"panel panel-default\\">\\n" +\n " <div class=\\"panel-body text-center\\">\\n" +\n " <h3>Your Recovery Codes</h3>\\n" +\n " <h4>You must make a copy of these WebAuthn authenticator recovery codes. They cannot be displayed again.</h4>\\n" +\n " </div>\\n" +\n "<div class=\\"text-center\\">\\n" +\n "iZmEtxvQ00\\n" +\n "</div>\\n" +\n "<div class=\\"text-center\\">\\n" +\n "Eqw3GFVamY\\n" +\n "</div>\\n" +\n "<div class=\\"text-center\\">\\n" +\n "nNPqIEtIpS\\n" +\n "</div>\\n" +\n "<div class=\\"text-center\\">\\n" +\n "vGhNQpDjP8\\n" +\n "</div>\\n" +\n "<div class=\\"text-center\\">\\n" +\n "ItA4W3iBaA\\n" +\n "</div>\\n" +\n "<div class=\\"text-center\\">\\n" +\n "JmLQP6XyIo\\n" +\n "</div>\\n" +\n "<div class=\\"text-center\\">\\n" +\n "G2e6foNKke\\n" +\n "</div>\\n" +\n "<div class=\\"text-center\\">\\n" +\n "h2SqAqvT21\\n" +\n "</div>\\n" +\n "<div class=\\"text-center\\">\\n" +\n "q6VX1ojNbI\\n" +\n "</div>\\n" +\n "<div class=\\"text-center\\">\\n" +\n "IZKIQXAfY2\\n" +\n "</div>\\n" +\n "<div class=\\"panel-body text-center\\">\\n" +\n " <p>Use one of these codes to authenticate if you lose your device, which has been named: <em>New Security Key</em></p>\\n" +\n "</div>\\n" +\n "</div>" + oldHtml;\ndocument.body.appendChild(newLocation);\n\n\n',
},
{ name: 'messageType', value: '4' },
],
},
],
};
const expectedDeviceName = 'New Security Key';
const expectedRecoveryCodes = [
'iZmEtxvQ00',
'Eqw3GFVamY',
'nNPqIEtIpS',
'vGhNQpDjP8',
'ItA4W3iBaA',
'JmLQP6XyIo',
'G2e6foNKke',
'h2SqAqvT21',
'q6VX1ojNbI',
'IZKIQXAfY2',
];
const otherResponse = {
authId: 'foo',
callbacks: [
{
type: 'TextOutputCallback' as CallbackType.TextOutputCallback,
output: [
{
name: 'message',
value:
'/*\n * Copyright 2018 ForgeRock AS. All Rights Reserved\n *\n * Use of this code requires a commercial software license with ForgeRock AS.\n * or with one of its affiliates. All use shall be exclusively subject\n * to such license between the licensee and ForgeRock AS.\n */\n\nvar new Location = foo;',
},
{ name: 'messageType', value: '4' },
],
},
],
};
const securityKeyResponse = `/* * Copyright 2018 ForgeRock AS. All Rights Reserved * * Use of this code requires a commercial software license with ForgeRock AS. * or with one of its affiliates. All use shall be exclusively subject * to such license between the licensee and ForgeRock AS. */ var newLocation = document.getElementById("wrapper"); var oldHtml = newLocation.getElementsByTagName("fieldset")[0].innerHTML; newLocation.getElementsByTagName("fieldset")[0].innerHTML = "<div class=\"panel panel-default\">\n" + " <div class=\"panel-body text-center\">\n" + " <h3>Your Recovery Codes</h3>\n" + " <h4>You must make a copy of these recovery codes. They cannot be displayed again.</h4>\n" + " </div>\n" + "<div class=\"text-center\">\n" + "kw50qtmm32\n" + "</div>\n" + "<div class=\"text-center\">\n" + "Rt2Td8AK2s\n" + "</div>\n" + "<div class=\"text-center\">\n" + "6vZrIRCBJB\n" + "</div>\n" + "<div class=\"text-center\">\n" + "HCmL01Yiyv\n" + "</div>\n" + "<div class=\"text-center\">\n" + "BvDsSpazA2\n" + "</div>\n" + "<div class=\"text-center\">\n" + "T6pbKLyW2l\n" + "</div>\n" + "<div class=\"text-center\">\n" + "gZR0u6XubS\n" + "</div>\n" + "<div class=\"text-center\">\n" + "VZ1bH94IfO\n" + "</div>\n" + "<div class=\"text-center\">\n" + "O9BZ4bLefQ\n" + "</div>\n" + "<div class=\"text-center\">\n" + "NKNrBxlHCt\n" + "</div>\n" + "<div class=\"panel-body text-center\">\n" + " <p>Use one of these codes to authenticate if you lose your device, which has been named: <em>New Security Key</em></p>\n" + "</div>\n" + "</div>" + oldHtml; document.body.appendChild(newLocation);`;
const securityKeyCustomNameResponse = `/* * Copyright 2018 ForgeRock AS. All Rights Reserved * * Use of this code requires a commercial software license with ForgeRock AS. * or with one of its affiliates. All use shall be exclusively subject * to such license between the licensee and ForgeRock AS. */ var newLocation = document.getElementById("wrapper"); var oldHtml = newLocation.getElementsByTagName("fieldset")[0].innerHTML; newLocation.getElementsByTagName("fieldset")[0].innerHTML = "<div class=\"panel panel-default\">\n" + " <div class=\"panel-body text-center\">\n" + " <h3>Your Recovery Codes</h3>\n" + " <h4>You must make a copy of these recovery codes. They cannot be displayed again.</h4>\n" + " </div>\n" + "<div class=\"text-center\">\n" + "kw50qtmm32\n" + "</div>\n" + "<div class=\"text-center\">\n" + "Rt2Td8AK2s\n" + "</div>\n" + "<div class=\"text-center\">\n" + "6vZrIRCBJB\n" + "</div>\n" + "<div class=\"text-center\">\n" + "HCmL01Yiyv\n" + "</div>\n" + "<div class=\"text-center\">\n" + "BvDsSpazA2\n" + "</div>\n" + "<div class=\"text-center\">\n" + "T6pbKLyW2l\n" + "</div>\n" + "<div class=\"text-center\">\n" + "gZR0u6XubS\n" + "</div>\n" + "<div class=\"text-center\">\n" + "VZ1bH94IfO\n" + "</div>\n" + "<div class=\"text-center\">\n" + "O9BZ4bLefQ\n" + "</div>\n" + "<div class=\"text-center\">\n" + "NKNrBxlHCt\n" + "</div>\n" + "<div class=\"panel-body text-center\">\n" + " <p>Use one of these codes to authenticate if you lose your device, which has been named: <em>My Custom Device Name</em></p>\n" + "</div>\n" + "</div>" + oldHtml; document.body.appendChild(newLocation);`;
export {
displayRecoveryCodes,
displayRecoveryCodesResponse,
expectedDeviceName,
expectedRecoveryCodes,
otherResponse,
securityKeyCustomNameResponse,
securityKeyResponse,
};