Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca56c37fb0 | ||
|
|
5e2d9e9e2b | ||
|
|
d0ca5cc041 | ||
|
|
310539e2de | ||
|
|
9da86f8411 | ||
|
|
76e721bd91 | ||
|
|
a19aa2ff0c | ||
|
|
cdecf570e2 | ||
|
|
c04c8f4f0a | ||
|
|
8fb33b8ff5 | ||
|
|
e89f31a93b | ||
|
|
518bf19318 | ||
|
|
d35823fae6 | ||
|
|
0231dabbe6 | ||
|
|
263d2b8d95 | ||
|
|
98537f708c | ||
|
|
5596d55035 | ||
|
|
a8f1780731 | ||
|
|
8e6988c179 | ||
|
|
ea293d947f | ||
|
|
d23afb1c71 | ||
|
|
b8ec749d03 | ||
|
|
0c5c9387b5 | ||
|
|
bbbd5cea65 | ||
|
|
66888a4c95 | ||
|
|
ca35246a7b | ||
|
|
16fe712f4e | ||
|
|
296b5fbecd | ||
|
|
4240bbee56 | ||
|
|
c3a9ecb0ec | ||
|
|
e40ff1f63c | ||
|
|
87479b8e3c | ||
|
|
264f81a6f3 | ||
|
|
772c8b38c0 | ||
|
|
03aa4f32f1 | ||
|
|
0b145fac47 | ||
|
|
9bd7193833 | ||
|
|
f3a4017e5f | ||
|
|
43eca819bf | ||
|
|
9aa3f8f5ad | ||
|
|
8cceb4090f | ||
|
|
dc7ebec668 | ||
|
|
cffa419dd6 | ||
|
|
83a938fada | ||
|
|
61c80518de | ||
|
|
d1119efd11 | ||
|
|
a9cb6f35f9 | ||
|
|
6f85419675 | ||
|
|
0cb90353f0 | ||
|
|
cd9f05962c | ||
|
|
9d342cf517 | ||
|
|
88fc063ab9 | ||
|
|
d3e707d740 | ||
|
|
fc4af516a2 | ||
|
|
edb8836a2c | ||
|
|
b29f877e35 | ||
|
|
e299740951 | ||
|
|
03fbc19c2c | ||
|
|
e42647e6a2 | ||
|
|
a03a3811d4 | ||
|
|
d4ef4bc58c | ||
|
|
3d7166d059 | ||
|
|
025ae1bfe2 | ||
|
|
0bc4cd6e21 | ||
|
|
4a6555317a | ||
|
|
be7e3bb56e | ||
|
|
ed0c774714 | ||
|
|
2bdb008f65 | ||
|
|
8109d7789c | ||
|
|
3eb9f07fe0 | ||
|
|
a07cd9e1a1 | ||
|
|
bbbb1620f6 | ||
|
|
1d71e3bec8 | ||
|
|
63d302d716 | ||
|
|
341baa76fc | ||
|
|
cc6f0aa1b4 | ||
|
|
1fb98f8ed3 | ||
|
|
08543e9868 | ||
|
|
0fbcf8e16e | ||
|
|
7ff569779c | ||
|
|
8f2deadc49 | ||
|
|
89b7d0345a | ||
|
|
ad3b9ed684 | ||
|
|
a7a84d64b9 | ||
|
|
7fd89bb946 | ||
|
|
dbfc21ace3 | ||
|
|
7bd8d87ad2 | ||
|
|
f5b80f93d2 | ||
|
|
1e5d52410e | ||
|
|
0dedbfb411 | ||
|
|
992df6b34b | ||
|
|
af7e539f3d | ||
|
|
83f9ab5c61 | ||
|
|
a9c06638c7 | ||
|
|
0637d805d3 | ||
|
|
f089200dc0 | ||
|
|
2726538c41 | ||
|
|
b6291bd3c7 | ||
|
|
0e89ecabdc | ||
|
|
debf6fbe06 | ||
|
|
517ba08f55 | ||
|
|
7f13365336 | ||
|
|
8ebdd995e3 | ||
|
|
e73cd828a5 | ||
|
|
d2a42f7468 | ||
|
|
b1614dc65d | ||
|
|
9931b8d3ca | ||
|
|
b7e5477b3d | ||
|
|
027371567b | ||
|
|
95612186d8 | ||
|
|
f7dd5ebe55 | ||
|
|
a6be658aa5 | ||
|
|
123476a3a8 | ||
|
|
d44528fc2c | ||
|
|
b2c85b9805 | ||
|
|
03ce6be3ee | ||
|
|
a35c4e0ffd | ||
|
|
710bcccfd5 | ||
|
|
8b9d945efb | ||
|
|
aa2114062b | ||
|
|
90055ea142 | ||
|
|
e1aa0c6bcb | ||
|
|
af337626f5 | ||
|
|
dad2d456d0 | ||
|
|
9dac6fc446 | ||
|
|
00348e4c55 | ||
|
|
b0dd9bf803 | ||
|
|
2e23bbea3e | ||
|
|
7e7bad050f | ||
|
|
afadb1d83a | ||
|
|
52c9fb5570 | ||
|
|
2dd3e13cd3 | ||
|
|
74fa0876fb | ||
|
|
c531553c07 | ||
|
|
0ad6d027e6 | ||
|
|
2eb7084643 | ||
|
|
06d162ae89 | ||
|
|
c43ced0380 | ||
|
|
28a4a7304e | ||
|
|
e74fd0202e | ||
|
|
0823c1cb2d | ||
|
|
d034631e4d | ||
|
|
c5af15f4c1 | ||
|
|
fce79d46d7 | ||
|
|
c45357bf25 | ||
|
|
d96d7425f8 | ||
|
|
2000c10006 | ||
|
|
a348e4830a | ||
|
|
7c496b5b90 | ||
|
|
5d6da1e52d | ||
|
|
2eb1d01622 | ||
|
|
f012d10dcb | ||
|
|
a96689e2cc | ||
|
|
c5f72c53d8 | ||
|
|
699d5063d9 | ||
|
|
08deda59aa | ||
|
|
f8cce58d49 | ||
|
|
f69477e556 | ||
|
|
7f5a792af4 | ||
|
|
dd96423ead | ||
|
|
a1117529e5 | ||
|
|
44510ea8d4 | ||
|
|
9c93ff6c13 | ||
|
|
59818fa24d | ||
|
|
98e14a642f | ||
|
|
45fc58fe75 | ||
|
|
6dad1cd276 | ||
|
|
2212c7dd9e | ||
|
|
98bc86497a | ||
|
|
f447fb11ef | ||
|
|
e091730ffb | ||
|
|
3e479fc02a | ||
|
|
ce2be6b4b3 | ||
|
|
816b50eb1b | ||
|
|
9067558082 | ||
|
|
d6129a7dfc | ||
|
|
3b4bb24eb7 | ||
|
|
2217482329 | ||
|
|
32bdf2acdc | ||
|
|
03187e2e2e | ||
|
|
cf72af4004 | ||
|
|
e4a0150ee7 | ||
|
|
1a46a6b183 | ||
|
|
cf377ad3dc | ||
|
|
c82a8be1ed | ||
|
|
b9c5ed0de3 | ||
|
|
885ce5ebf5 | ||
|
|
9f7d528582 | ||
|
|
8544d61e9c | ||
|
|
a1b3e5382b | ||
|
|
1fb41665e5 | ||
|
|
bd50c4f78c | ||
|
|
0f73cd5faf | ||
|
|
96de8f262f | ||
|
|
4a871134a5 | ||
|
|
9bcb402fa2 | ||
|
|
bb1580ab6e | ||
|
|
75f45a134d | ||
|
|
b272f85e68 | ||
|
|
fdb46df9f2 | ||
|
|
f39ac156cb | ||
|
|
986cde5941 | ||
|
|
c94f54c90f | ||
|
|
4c648ad4be | ||
|
|
cd10c30ca8 | ||
|
|
d964411f70 | ||
|
|
9d68eb495e | ||
|
|
ef80dd87c1 | ||
|
|
a59e012f52 | ||
|
|
580a2f4159 | ||
|
|
b0d999cf3c | ||
|
|
97b82818cf | ||
|
|
4f0f8fce26 | ||
|
|
2b7563ee7b | ||
|
|
d8f43531e1 | ||
|
|
0404fe308f | ||
|
|
d3bdab9014 | ||
|
|
4b41c8dc7a | ||
|
|
12913e70ce | ||
|
|
7630f454fd | ||
|
|
9a2e5d23b9 | ||
|
|
a0f371bfc5 | ||
|
|
9100fe9a34 | ||
|
|
87b76a91c4 | ||
|
|
aa4a487e97 | ||
|
|
94cfca561c | ||
|
|
58f46e9334 | ||
|
|
5519cf8557 | ||
|
|
7413afb11d | ||
|
|
e4ccf21ed8 | ||
|
|
3a96aadb99 | ||
|
|
4f044db204 | ||
|
|
d202c550cb | ||
|
|
173fa8a8e6 | ||
|
|
a2e6a6ba44 | ||
|
|
bfa3d8fd3a | ||
|
|
233cc2073b | ||
|
|
ed513ebd14 | ||
|
|
371b89b5ad | ||
|
|
07d2667d14 | ||
|
|
39d19cab06 | ||
|
|
d7659bd9de | ||
|
|
e855697601 | ||
|
|
e5c4ac650e | ||
|
|
688b6652d1 | ||
|
|
6ceddce774 | ||
|
|
84fe290aeb | ||
|
|
0e38cfe54a | ||
|
|
7d70493a66 | ||
|
|
d61867ab10 | ||
|
|
e8e83d979b | ||
|
|
559764a5c1 | ||
|
|
bb494e83f8 | ||
|
|
d5a183abbf | ||
|
|
7f32b871b9 | ||
|
|
0a5eb3ae98 | ||
|
|
7a2ebdd3a1 | ||
|
|
3b6e968bf8 | ||
|
|
56487cdfad | ||
|
|
15b0baba34 | ||
|
|
96795e450e | ||
|
|
43cc25b0a5 | ||
|
|
f9ac2a93e5 | ||
|
|
378fcc53c2 | ||
|
|
a73c57848d | ||
|
|
86ebba9394 | ||
|
|
0ef4b2244b | ||
|
|
3b01e84f1e | ||
|
|
000c22bd08 | ||
|
|
7e2493dd82 | ||
|
|
aea193c78d | ||
|
|
04287e72c2 | ||
|
|
a535991174 | ||
|
|
9c642b5065 | ||
|
|
4bcf061234 | ||
|
|
09d5d1077d | ||
|
|
1a3dc72d57 | ||
|
|
25c0125cd8 | ||
|
|
4daa09ca7b | ||
|
|
14f9635af4 | ||
|
|
4ba3af3272 | ||
|
|
db4964c985 | ||
|
|
1f328e54ee | ||
|
|
295d236b35 | ||
|
|
a83e6af6de | ||
|
|
d5959f4a94 | ||
|
|
48cc8596dc | ||
|
|
33e6515749 | ||
|
|
28963a75cc | ||
|
|
6c1e9bc944 | ||
|
|
1e421225fa | ||
|
|
50ba2eb73a | ||
|
|
1f20e2c40c | ||
|
|
f0926cba87 | ||
|
|
3278d229e8 | ||
|
|
d92654776c | ||
|
|
34c8ad1d6f | ||
|
|
1208fea0a4 | ||
|
|
790cec2931 | ||
|
|
c7ee9cde17 | ||
|
|
1143fb02cc | ||
|
|
3fcff99024 | ||
|
|
2b5afa0e2c | ||
|
|
b8c4feb634 | ||
|
|
1b5e1a7736 | ||
|
|
27afafa077 | ||
|
|
73fef6b907 | ||
|
|
2e2ff60c8f | ||
|
|
4abf4e5550 | ||
|
|
8934e44558 | ||
|
|
c3561a1063 | ||
|
|
2f50e6a980 | ||
|
|
ff0971ca64 | ||
|
|
3f3ac19628 | ||
|
|
b946917ad8 | ||
|
|
bfdaacc2cd | ||
|
|
e47c3bd14e | ||
|
|
88d47688fa | ||
|
|
62b097170c | ||
|
|
32de6a6ed5 | ||
|
|
1e8c8a3ba0 | ||
|
|
0a57865270 | ||
|
|
b209ff7b2a | ||
|
|
a6a33f6b56 | ||
|
|
445d789344 | ||
|
|
939dd16409 | ||
|
|
b0a2348776 | ||
|
|
3bfb6fe5ee | ||
|
|
2fd646c2c9 | ||
|
|
5659df3336 | ||
|
|
9f66314a9e | ||
|
|
6ddf551d75 | ||
|
|
6272b1a164 | ||
|
|
43cd689da0 | ||
|
|
66601240fc | ||
|
|
11daac57c2 | ||
|
|
9b07969491 | ||
|
|
8e3362fb12 | ||
|
|
d9bd8fa193 | ||
|
|
3da7bfc7cc | ||
|
|
d82cbec7c3 | ||
|
|
3f9530a970 | ||
|
|
804a879182 | ||
|
|
170fc74b7f | ||
|
|
2ac8818cc6 | ||
|
|
99851fce59 | ||
|
|
93af7241f5 | ||
|
|
503a7b9eb8 | ||
|
|
ffcc8a25d6 | ||
|
|
eeb8610973 | ||
|
|
75bb34f738 | ||
|
|
242c3f6370 | ||
|
|
3d3d5ec4d2 | ||
|
|
f34af386c4 | ||
|
|
9b625a642f | ||
|
|
1ed0d24fa2 | ||
|
|
b12b303b97 | ||
|
|
5e591ce5bb | ||
|
|
23de0695d0 | ||
|
|
8d4cb1bfea | ||
|
|
d67f6dab2f | ||
|
|
8ee0e0b92d | ||
|
|
be9b68eeff | ||
|
|
1e20f7a149 | ||
|
|
b413e9d8dd | ||
|
|
fd3c9eb876 | ||
|
|
5a76f2791a | ||
|
|
ca2508635e | ||
|
|
baff01ad48 | ||
|
|
3f04c209f3 | ||
|
|
dbf2a8e43f | ||
|
|
db2a40b58f | ||
|
|
f14346d3a4 | ||
|
|
c2b4c0ad8b | ||
|
|
2bb9db6a67 | ||
|
|
cf9166fe4a | ||
|
|
50c7bfc659 | ||
|
|
ecda08164a | ||
|
|
2dfda037fe | ||
|
|
9979fe8464 | ||
|
|
49f6330a5d | ||
|
|
9049bb2087 | ||
|
|
82135a4b20 | ||
|
|
e737cb448c | ||
|
|
dd37718c62 | ||
|
|
e6f0166ff0 | ||
|
|
606a48ca49 | ||
|
|
d1e46cb9b1 | ||
|
|
11ceb8b5ca | ||
|
|
3854d32e92 | ||
|
|
bbb703c671 | ||
|
|
f507edae03 | ||
|
|
9231963ac1 | ||
|
|
9bfb136247 | ||
|
|
4af4ee7cc0 | ||
|
|
12a9f72c68 | ||
|
|
bb88672aff | ||
|
|
25e004976e | ||
|
|
60993e455a | ||
|
|
40ee317f47 | ||
|
|
530cd0298a | ||
|
|
374a13cd07 | ||
|
|
6f5da333e0 | ||
|
|
d121bcf204 | ||
|
|
2acd555966 | ||
|
|
820843c51d | ||
|
|
243f165644 | ||
|
|
5036c62740 | ||
|
|
3ffe70cf5d | ||
|
|
c5b0061428 | ||
|
|
fefae2b73d | ||
|
|
196d01aae2 | ||
|
|
96707ebe15 | ||
|
|
79f5db0441 | ||
|
|
d4fee0af34 | ||
|
|
a8c65e73f5 | ||
|
|
13df776c18 | ||
|
|
12588a17ab | ||
|
|
7b2c8b7d58 | ||
|
|
873965d7b7 | ||
|
|
f02f488edd | ||
|
|
a2ee17e918 | ||
|
|
bf8620d75c | ||
|
|
d0eb41e03b | ||
|
|
6e932f8054 | ||
|
|
76291896c3 | ||
|
|
c803adccc1 | ||
|
|
f7854b642c | ||
|
|
a7a6bdedf9 | ||
|
|
4bcd0e7d06 | ||
|
|
895a25218e | ||
|
|
8356e7d47a | ||
|
|
680ae9980b | ||
|
|
e106454bb5 | ||
|
|
aa227a0db8 | ||
|
|
8aca872c66 | ||
|
|
269c56bf83 | ||
|
|
a89b27c813 | ||
|
|
2804b4322b | ||
|
|
66d16d84d0 | ||
|
|
f420d01fb8 | ||
|
|
4bd80a716e | ||
|
|
8098beb450 | ||
|
|
a6672ecef4 | ||
|
|
79b6737aaa | ||
|
|
31afafff4e | ||
|
|
d4a4828b67 | ||
|
|
44fa206619 | ||
|
|
bc10b00874 | ||
|
|
bbd73b36d1 | ||
|
|
3a52b40214 | ||
|
|
c41855ccc4 | ||
|
|
c013b178d7 | ||
|
|
683fffaa0e | ||
|
|
31f67e568c | ||
|
|
9c15d02080 | ||
|
|
c14be070f7 | ||
|
|
7b1410d832 | ||
|
|
06cf112b61 | ||
|
|
95e3410540 | ||
|
|
77d7187116 | ||
|
|
28d18e389c | ||
|
|
d95ae373ab | ||
|
|
a784eeecc2 | ||
|
|
84962c9ed3 | ||
|
|
cfd2e13832 | ||
|
|
880f8f6b39 | ||
|
|
c5b1cc1498 | ||
|
|
343f85f8e7 | ||
|
|
654bc18422 | ||
|
|
81b59af3b4 | ||
|
|
e50d0ac00b | ||
|
|
9fe89c9b18 | ||
|
|
8c20d29806 | ||
|
|
10d93992d4 | ||
|
|
0552d1db5a | ||
|
|
07919409d9 | ||
|
|
d691c1fa11 | ||
|
|
b632df901b | ||
|
|
ecb67ea344 | ||
|
|
4c2e8f7a76 | ||
|
|
22c4581d4d | ||
|
|
34c668b4d9 | ||
|
|
9437edbf8a | ||
|
|
5890b1b2e8 | ||
|
|
5ea26dc7ea | ||
|
|
6afde1fb18 | ||
|
|
708a0836cc | ||
|
|
3fc51ee54a | ||
|
|
e85a75305f | ||
|
|
9f469aec38 | ||
|
|
dd7907da8c | ||
|
|
634c522eaf | ||
|
|
57a924703e | ||
|
|
89285dcfba | ||
|
|
05c14d7bbb | ||
|
|
8c4228016c | ||
|
|
8d00730653 | ||
|
|
38ed272fc2 | ||
|
|
d0a11d6054 | ||
|
|
8022234e84 | ||
|
|
b58bde0461 | ||
|
|
48c7538172 | ||
|
|
cb938d0e33 | ||
|
|
f2544684ec | ||
|
|
131ce44ecc | ||
|
|
b91f8c1661 | ||
|
|
3943a740bc | ||
|
|
d88a4ac103 | ||
|
|
afeaf3a671 | ||
|
|
1a968a7d24 | ||
|
|
ac5f7fa1c9 | ||
|
|
c1cd762da4 | ||
|
|
5f9230c458 | ||
|
|
2381b3372c | ||
|
|
4a07478f1e | ||
|
|
5c4ceb7f0f | ||
|
|
e940ec98d4 | ||
|
|
b7e0f42d47 | ||
|
|
1b300c676b | ||
|
|
a7cc1b9ba2 | ||
|
|
c99449d8e5 | ||
|
|
2038a463db | ||
|
|
4f0e2794ec | ||
|
|
89891a401a | ||
|
|
d572d5157d | ||
|
|
6ffb4a2350 | ||
|
|
1e1ea1c49a | ||
|
|
fb4238b035 | ||
|
|
3d6d7c99c2 | ||
|
|
5bb7d41903 | ||
|
|
47c453e979 | ||
|
|
e16bfdfb03 | ||
|
|
3138aecc37 | ||
|
|
b19583c08d | ||
|
|
3d8a70d676 | ||
|
|
7e6158b847 | ||
|
|
23e82b352e | ||
|
|
2ccd08a8d4 | ||
|
|
6159378a52 | ||
|
|
65039ce820 | ||
|
|
fde633331c | ||
|
|
597b945aca | ||
|
|
d23684c42f | ||
|
|
cb3bcf1b9e | ||
|
|
c8c5c2e7ef | ||
|
|
8886f14996 | ||
|
|
e8c7e81828 | ||
|
|
1f47ca8ea9 | ||
|
|
f61cad986f | ||
|
|
6256bfc3cf | ||
|
|
3133997e78 | ||
|
|
ed9324a0de | ||
|
|
ab668d74eb | ||
|
|
4fa5b924c9 | ||
|
|
7876de8e2d | ||
|
|
e86a4fc27d | ||
|
|
d72b02ad29 | ||
|
|
545e7d5a7f | ||
|
|
4055f3a06e | ||
|
|
4fed7f3d94 | ||
|
|
ee29f3c599 | ||
|
|
06f00ac8f6 | ||
|
|
97ee639d62 | ||
|
|
a1b0481db9 | ||
|
|
314aa62828 | ||
|
|
bcf27ae048 | ||
|
|
685ddeac7e | ||
|
|
ce9503fc5b | ||
|
|
f2f5a46cdf | ||
|
|
1a0650ff7c | ||
|
|
82a0c7c17c | ||
|
|
dead74c825 | ||
|
|
1397df807f | ||
|
|
24e37d3faa | ||
|
|
cc01bddea3 | ||
|
|
385ea34c98 | ||
|
|
9f32b8cdc3 | ||
|
|
ae8e20b8e1 | ||
|
|
e91612b313 | ||
|
|
aab980a7dc | ||
|
|
13146975e2 | ||
|
|
542b469ad8 | ||
|
|
c2c63294f4 | ||
|
|
56936f78b8 | ||
|
|
dcc77153bf | ||
|
|
4b587d35fa | ||
|
|
ce7cdba0bc | ||
|
|
4e13ea56c3 | ||
|
|
3ef7436f3f | ||
|
|
ee748de5c9 | ||
|
|
74501a440f | ||
|
|
828faf2be4 | ||
|
|
dfb9d6e686 | ||
|
|
2be18bcf6f | ||
|
|
8feeaa47dc | ||
|
|
ec9d953bad | ||
|
|
84051e4b72 | ||
|
|
6b93032a78 | ||
|
|
a909ba67df | ||
|
|
cf40b53fd0 | ||
|
|
3425dc89be | ||
|
|
8e1e2b6b36 | ||
|
|
4ace04de7a | ||
|
|
3bef3e4bc5 | ||
|
|
81447e65c8 | ||
|
|
2e71beee81 | ||
|
|
dfbb54a1ee | ||
|
|
0d67b512a2 | ||
|
|
e551ec4008 | ||
|
|
49a85f1a7f | ||
|
|
15d3520408 | ||
|
|
5d7c0180d5 | ||
|
|
053e16dca8 | ||
|
|
3e2ed2dc27 | ||
|
|
faaf7352c1 | ||
|
|
58252ee6f5 | ||
|
|
85ddd7fc4b | ||
|
|
863e81bc01 | ||
|
|
4b212e1ae0 | ||
|
|
343f73bc21 | ||
|
|
cf5f41acbd | ||
|
|
2f12cc91f2 | ||
|
|
99125dbb77 | ||
|
|
3bfae4b33d | ||
|
|
da6b34b337 | ||
|
|
9a909c0ec1 | ||
|
|
42c01100ad | ||
|
|
fe56acd57f | ||
|
|
e4fb2e7c4d | ||
|
|
b1361bcb83 | ||
|
|
30090d82e3 | ||
|
|
fbe8aefcb4 | ||
|
|
fa02fd3f89 | ||
|
|
f021719d8b | ||
|
|
be9ee8f672 | ||
|
|
48ca4c5ac0 | ||
|
|
ac7db55be2 | ||
|
|
dea79d785b | ||
|
|
f597901140 | ||
|
|
0c1b5bf879 | ||
|
|
bab68f4507 | ||
|
|
c6e4a24dab | ||
|
|
0bcb91ede0 | ||
|
|
fbeb764c76 | ||
|
|
67959d7a58 | ||
|
|
c4bb5173d2 | ||
|
|
ea011592a7 | ||
|
|
e761e0e4af | ||
|
|
fa36f9008b | ||
|
|
15d360abc5 | ||
|
|
9914954d08 | ||
|
|
ec184ff4f1 | ||
|
|
bb2d0420d9 | ||
|
|
e3cabe3102 | ||
|
|
7065f462cd |
No files matched your search
@@ -19,23 +19,6 @@ jobs:
|
|||||||
if: steps.cache.outputs.cache-hit != 'true'
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
- run: yarn run compliance:licenses
|
- run: yarn run compliance:licenses
|
||||||
|
|
||||||
audit:
|
|
||||||
name: Security Audit
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions/cache@v2
|
|
||||||
id: cache
|
|
||||||
with:
|
|
||||||
path: '**/node_modules'
|
|
||||||
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
- uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: '12.x'
|
|
||||||
- run: yarn install
|
|
||||||
if: steps.cache.outputs.cache-hit != 'true'
|
|
||||||
- run: yarn run compliance:audit
|
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
name: Lint
|
name: Lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ testem.log
|
|||||||
yarn-error.log
|
yarn-error.log
|
||||||
storybook-static
|
storybook-static
|
||||||
**/.storybook/*.html
|
**/.storybook/*.html
|
||||||
|
.watchman-cookie*
|
||||||
|
|
||||||
# ember-try
|
# ember-try
|
||||||
.node_modules.ember-try
|
.node_modules.ember-try
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ subproject, e.g. running or testing.
|
|||||||
- [Building Admin UI for Production](#building-admin-ui-for-production)
|
- [Building Admin UI for Production](#building-admin-ui-for-production)
|
||||||
- [Building with a Container](#building-with-a-container)
|
- [Building with a Container](#building-with-a-container)
|
||||||
- [Building Desktop UI for Production](#building-desktop-ui-for-production)
|
- [Building Desktop UI for Production](#building-desktop-ui-for-production)
|
||||||
|
- [Connect Boundary UI to Boundary local instance](#connect-boundary-ui-to-boundary-local-instance)
|
||||||
|
- [For admin](#for-admin)
|
||||||
|
- [For desktop](#for-desktop)
|
||||||
- [Committing](#committing)
|
- [Committing](#committing)
|
||||||
- [License Checking](#license-checking)
|
- [License Checking](#license-checking)
|
||||||
|
|
||||||
@@ -35,6 +38,9 @@ You will need the following things properly installed on your computer.
|
|||||||
|
|
||||||
* [Git][git]
|
* [Git][git]
|
||||||
* [Node.js][node]
|
* [Node.js][node]
|
||||||
|
* v10–v15
|
||||||
|
* **Apple Silicon Users**: if you experience problems building or running
|
||||||
|
Boundary UIs, try Node v15.
|
||||||
* [Yarn][yarn] installed globally
|
* [Yarn][yarn] installed globally
|
||||||
* [Google Chrome][chrome]
|
* [Google Chrome][chrome]
|
||||||
* [Firefox][firefox]
|
* [Firefox][firefox]
|
||||||
@@ -116,11 +122,45 @@ yarn install
|
|||||||
yarn build:ui:desktop
|
yarn build:ui:desktop
|
||||||
```
|
```
|
||||||
|
|
||||||
|
In windows, UI is generated using docker to provide a stable UI across platforms.
|
||||||
|
|
||||||
|
```cmd
|
||||||
|
yarn install
|
||||||
|
docker-compose -f docker-compose-embedding.yml run build-desktop-production
|
||||||
|
yarn build:ui:desktop:app
|
||||||
|
```
|
||||||
|
|
||||||
To provide a signing identify for macOS build, use `BOUNDARY_DESKTOP_SIGNING_IDENTITY`
|
To provide a signing identify for macOS build, use `BOUNDARY_DESKTOP_SIGNING_IDENTITY`
|
||||||
environment variable to set signing certificate name (e.g Developer ID Application: * (*)).
|
environment variable to set signing certificate name (e.g Developer ID Application: * (*)) when building desktop app using `yarn build:ui:desktop:app`.
|
||||||
|
|
||||||
Assets are saved to `ui/desktop/electron-app/out/make/`.
|
Assets are saved to `ui/desktop/electron-app/out/make/`.
|
||||||
DMG packaged desktop UI is available at asset location as `boundary.dmg`.
|
DMG packaged desktop UI is available at asset location as `boundary.dmg`.
|
||||||
|
EXE archived desktop UI is available at asset location under `zip` folder.
|
||||||
|
|
||||||
|
### Connect Boundary UI to Boundary local instance
|
||||||
|
|
||||||
|
This describes how to connect local Boundary UI to your local instance of Boundary.
|
||||||
|
|
||||||
|
This assumes you already have up and running a Boundary dev instance in your local environment with a listener `127.0.0.1:9200` (default behaviour). [Learn how to start a local Boundary dev instance](https://learn.hashicorp.com/tutorials/boundary/getting-started-dev?in=boundary/getting-started#start-a-dev-environment).
|
||||||
|
#### For admin
|
||||||
|
|
||||||
|
This assumes you are within `boundary-ui/ui/admin`.
|
||||||
|
|
||||||
|
You will need to turn `off` mirage, tell the UI where to find Boundary and run it: `$ ENABLE_MIRAGE=false API_HOST=http://localhost:9200 yarn start`.
|
||||||
|
|
||||||
|
Following terminal instructions, open in your browser: `http://localhost:4200/`.
|
||||||
|
|
||||||
|
Once you open the UI you will see the login screen, authenticate using generated admin login name and password.
|
||||||
|
|
||||||
|
#### For desktop
|
||||||
|
|
||||||
|
This assumes you are within `boundary-ui/ui/desktop`.
|
||||||
|
|
||||||
|
You will need to turn `off` mirage and run it: `$ ENABLE_MIRAGE=false yarn start:desktop`.
|
||||||
|
|
||||||
|
In login screen, authenticate using generated admin login name and password.
|
||||||
|
|
||||||
|
Enter the origin of your Boundary dev instance, by default is: `http://localhost:9200`.
|
||||||
|
|
||||||
### Committing
|
### Committing
|
||||||
|
|
||||||
|
|||||||
@@ -248,7 +248,11 @@ export default class ApplicationAdapter extends RESTAdapter.extend(
|
|||||||
// Normalize field-specific errors, if any.
|
// Normalize field-specific errors, if any.
|
||||||
const errors = fieldErrors.map((error) => ({
|
const errors = fieldErrors.map((error) => ({
|
||||||
detail: error.description,
|
detail: error.description,
|
||||||
source: { pointer: `/data/attributes/${error.name}` },
|
// Ember Data cannot handle errors on nested attributes, so these are
|
||||||
|
// flattened (e.g. `attributes.foobar` becomes `attributes_foobar`).
|
||||||
|
// To capture these errors, add read-only fields on the model
|
||||||
|
// corresponding to the underscored field name.
|
||||||
|
source: { pointer: `/data/attributes/${error.name.replace('.', '_')}` },
|
||||||
}));
|
}));
|
||||||
// Return a list of JSON API errors rooted under the `errors` key.
|
// Return a list of JSON API errors rooted under the `errors` key.
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import BaseModel from '../../models/base';
|
||||||
|
import { attr } from '@ember-data/model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A credential library is a resource that can generate and retrieve
|
||||||
|
* credentials.
|
||||||
|
*/
|
||||||
|
export default class GeneratedCredentialLibraryModel extends BaseModel {
|
||||||
|
// =attributes
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
description: 'The type of the resource, to help differentiate schemas',
|
||||||
|
})
|
||||||
|
type;
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
description: 'The owning credential store ID.',
|
||||||
|
})
|
||||||
|
credential_store_id;
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
description: 'Optional name for identification purposes',
|
||||||
|
})
|
||||||
|
name;
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
description: 'Optional user-set description for identification purposes',
|
||||||
|
})
|
||||||
|
description;
|
||||||
|
|
||||||
|
@attr('date', {
|
||||||
|
description: 'The time this resource was created\nOutput only.',
|
||||||
|
readOnly: true,
|
||||||
|
})
|
||||||
|
created_time;
|
||||||
|
|
||||||
|
@attr('date', {
|
||||||
|
description: 'The time this resource was last updated\nOutput only.',
|
||||||
|
readOnly: true,
|
||||||
|
})
|
||||||
|
updated_time;
|
||||||
|
|
||||||
|
@attr('number', {
|
||||||
|
description: 'Current version number of this resource.',
|
||||||
|
})
|
||||||
|
version;
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
import BaseModel from '../../models/base';
|
||||||
|
import { attr } from '@ember-data/model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A credential store is a resource that can retrieve, store, and potentially
|
||||||
|
* generate credentials.
|
||||||
|
*/
|
||||||
|
export default class GeneratedCredentialStoreModel extends BaseModel {
|
||||||
|
// =attributes
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
description: 'The type of the resource, to help differentiate schemas',
|
||||||
|
})
|
||||||
|
type;
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
description: 'Optional name for identification purposes',
|
||||||
|
})
|
||||||
|
name;
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
description: 'Optional user-set description for identification purposes',
|
||||||
|
})
|
||||||
|
description;
|
||||||
|
|
||||||
|
@attr('date', {
|
||||||
|
description: 'The time this resource was created\nOutput only.',
|
||||||
|
readOnly: true,
|
||||||
|
})
|
||||||
|
created_time;
|
||||||
|
|
||||||
|
@attr('date', {
|
||||||
|
description: 'The time this resource was last updated\nOutput only.',
|
||||||
|
readOnly: true,
|
||||||
|
})
|
||||||
|
updated_time;
|
||||||
|
|
||||||
|
@attr('number', {
|
||||||
|
description: 'Current version number of this resource.',
|
||||||
|
})
|
||||||
|
version;
|
||||||
|
}
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
// app/initializers/fragment-serializer.js
|
||||||
|
import FragmentAuthMethodAttributesAccountClaimMapSerializer from '../serializers/fragment-auth-method-attributes-account-claim-map';
|
||||||
|
|
||||||
|
export function initialize(application) {
|
||||||
|
application.register(
|
||||||
|
'serializer:fragment-auth-method-attributes-account-claim-map',
|
||||||
|
FragmentAuthMethodAttributesAccountClaimMapSerializer
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fragment serializers must be manually registered
|
||||||
|
export default {
|
||||||
|
name: 'fragment-auth-method-attributes-account-claim-map',
|
||||||
|
initialize: initialize,
|
||||||
|
};
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
// app/initializers/fragment-serializer.js
|
||||||
|
import FragmentStringSerializer from '../serializers/fragment-string';
|
||||||
|
|
||||||
|
export function initialize(application) {
|
||||||
|
application.register('serializer:fragment-string', FragmentStringSerializer);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fragment serializers must be manually registered
|
||||||
|
export default {
|
||||||
|
name: 'fragment-string',
|
||||||
|
initialize: initialize,
|
||||||
|
};
|
||||||
@@ -17,19 +17,19 @@ export default class AccountModel extends GeneratedAccountModel {
|
|||||||
*/
|
*/
|
||||||
@equal('type', 'password') isPassword;
|
@equal('type', 'password') isPassword;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
@equal('type', 'oidc') isOIDC;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience for getting username in account.
|
* Convenience for getting username in account.
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
@computed('type', 'attributes.login_name')
|
@computed('attributes.{email,full_name,login_name}')
|
||||||
get username() {
|
get accountName() {
|
||||||
let username = '';
|
const { email, full_name, login_name } = this.attributes;
|
||||||
switch (this.type) {
|
return email || full_name || login_name;
|
||||||
case 'password':
|
|
||||||
username = this.attributes.login_name;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return username;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// =methods
|
// =methods
|
||||||
|
|||||||
@@ -1,9 +1,61 @@
|
|||||||
import GeneratedAuthMethodModel from '../generated/models/auth-method';
|
import GeneratedAuthMethodModel from '../generated/models/auth-method';
|
||||||
|
import { attr } from '@ember-data/model';
|
||||||
|
import { fragment } from 'ember-data-model-fragments/attributes';
|
||||||
import { equal } from '@ember/object/computed';
|
import { equal } from '@ember/object/computed';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum options per auth method type and field.
|
||||||
|
*/
|
||||||
|
export const options = {
|
||||||
|
oidc: {
|
||||||
|
signing_algorithms: [
|
||||||
|
'RS256',
|
||||||
|
'RS384',
|
||||||
|
'RS512',
|
||||||
|
'ES256',
|
||||||
|
'ES384',
|
||||||
|
'ES512',
|
||||||
|
'PS256',
|
||||||
|
'PS384',
|
||||||
|
'PS512',
|
||||||
|
'EdDSA',
|
||||||
|
],
|
||||||
|
state: ['inactive', 'active-private', 'active-public'],
|
||||||
|
account_claim_maps: {
|
||||||
|
to: ['sub', 'name', 'email'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
export default class AuthMethodModel extends GeneratedAuthMethodModel {
|
export default class AuthMethodModel extends GeneratedAuthMethodModel {
|
||||||
|
// =error attributes
|
||||||
|
// These attributes exist solely to capture errors on nested fields.
|
||||||
|
// See the application adapter's error normalization method for
|
||||||
|
// more information.
|
||||||
|
|
||||||
|
@attr('string', { readOnly: true }) attributes_state;
|
||||||
|
@attr('string', { readOnly: true }) attributes_issuer;
|
||||||
|
@attr('string', { readOnly: true }) attributes_client_id;
|
||||||
|
@attr('string', { readOnly: true }) attributes_client_secret;
|
||||||
|
@attr('string', { readOnly: true }) attributes_max_age;
|
||||||
|
@attr('string', { readOnly: true }) attributes_api_url_prefix;
|
||||||
|
@attr('string', { readOnly: true })
|
||||||
|
attributes_disable_discovered_config_validation;
|
||||||
|
@attr('string', { readOnly: true }) attributes_dry_run;
|
||||||
|
@attr('string', { readOnly: true }) attributes_account_claim_maps;
|
||||||
|
@attr('string', { readOnly: true }) attributes_claims_scopes;
|
||||||
|
@attr('string', { readOnly: true }) attributes_signing_algorithms;
|
||||||
|
@attr('string', { readOnly: true }) attributes_allowed_audiences;
|
||||||
|
@attr('string', { readOnly: true }) attributes_idp_ca_certs;
|
||||||
|
|
||||||
// =attributes
|
// =attributes
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attributes of this resource, if any, represented as a JSON fragment.
|
||||||
|
* @type {FragmentAuthMethodAttributesModel}
|
||||||
|
*/
|
||||||
|
@fragment('fragment-auth-method-attributes', { defaultValue: {} }) attributes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
*/
|
*/
|
||||||
@@ -22,4 +74,50 @@ export default class AuthMethodModel extends GeneratedAuthMethodModel {
|
|||||||
get isOIDC() {
|
get isOIDC() {
|
||||||
return this.type === 'oidc';
|
return this.type === 'oidc';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
get isInactive() {
|
||||||
|
return this.attributes.state === 'inactive';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
get isPrivate() {
|
||||||
|
return this.attributes.state === 'active-private';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
get isPublic() {
|
||||||
|
return this.attributes.state === 'active-public';
|
||||||
|
}
|
||||||
|
|
||||||
|
// =methods
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change the active and visibility state of an OIDC auth method
|
||||||
|
* given its ID.
|
||||||
|
* For OIDC auth methods only.
|
||||||
|
* @param {[string]} state
|
||||||
|
* @param {object} options
|
||||||
|
* @param {object} options.adapterOptions
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
changeState(state, options = { adapterOptions: {} }) {
|
||||||
|
const defaultAdapterOptions = {
|
||||||
|
method: 'change-state',
|
||||||
|
state,
|
||||||
|
};
|
||||||
|
return this.save({
|
||||||
|
...options,
|
||||||
|
adapterOptions: {
|
||||||
|
...defaultAdapterOptions,
|
||||||
|
...options.adapterOptions,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import GeneratedCredentialLibraryModel from '../generated/models/credential-library';
|
||||||
|
import { attr } from '@ember-data/model';
|
||||||
|
import { fragment } from 'ember-data-model-fragments/attributes';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum options for credential library.
|
||||||
|
*/
|
||||||
|
export const options = {
|
||||||
|
http_method: ['GET', 'POST'],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default class CredentialLibraryModel extends GeneratedCredentialLibraryModel {
|
||||||
|
// =error attributes
|
||||||
|
// These attributes exist solely to capture errors on nested fields.
|
||||||
|
// See the application adapter's error normalization method for
|
||||||
|
// more information.
|
||||||
|
|
||||||
|
@attr('string', { readOnly: true }) attributes_http_method;
|
||||||
|
@attr('string', { readOnly: true }) attributes_http_request_body;
|
||||||
|
@attr('string', { readOnly: true }) attributes_path;
|
||||||
|
|
||||||
|
// =attributes
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attributes of this resource, if any, represented as a JSON fragment.
|
||||||
|
* @type {FragmentCredentialLibraryAttributesModel}
|
||||||
|
*/
|
||||||
|
@fragment('fragment-credential-library-attributes', { defaultValue: {} })
|
||||||
|
attributes;
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import GeneratedCredentialStoreModel from '../generated/models/credential-store';
|
||||||
|
import { attr } from '@ember-data/model';
|
||||||
|
import { fragment } from 'ember-data-model-fragments/attributes';
|
||||||
|
import { equal } from '@ember/object/computed';
|
||||||
|
|
||||||
|
export default class CredentialStoreModel extends GeneratedCredentialStoreModel {
|
||||||
|
// =error attributes
|
||||||
|
// These attributes exist solely to capture errors on nested fields.
|
||||||
|
// See the application adapter's error normalization method for
|
||||||
|
// more information.
|
||||||
|
|
||||||
|
@attr('string', { readOnly: true }) attributes_address;
|
||||||
|
@attr('string', { readOnly: true }) attributes_namespace;
|
||||||
|
@attr('string', { readOnly: true }) attributes_ca_cert;
|
||||||
|
@attr('string', { readOnly: true }) attributes_tls_server_name;
|
||||||
|
@attr('string', { readOnly: true }) attributes_tls_skip_verify;
|
||||||
|
@attr('string', { readOnly: true }) attributes_token;
|
||||||
|
@attr('string', { readOnly: true }) attributes_client_certificate;
|
||||||
|
@attr('string', { readOnly: true }) attributes_client_certificate_key;
|
||||||
|
|
||||||
|
// =attributes
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attributes of this resource, if any, represented as a JSON fragment.
|
||||||
|
* @type {FragmentAuthMethodAttributesModel}
|
||||||
|
*/
|
||||||
|
@fragment('fragment-credential-store-attributes', { defaultValue: {} })
|
||||||
|
attributes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
@equal('type', 'vault') isVault;
|
||||||
|
}
|
||||||
@@ -2,8 +2,16 @@ import Fragment from 'ember-data-model-fragments/fragment';
|
|||||||
import { attr } from '@ember-data/model';
|
import { attr } from '@ember-data/model';
|
||||||
|
|
||||||
export default class FragmentAccountAttributesModel extends Fragment {
|
export default class FragmentAccountAttributesModel extends Fragment {
|
||||||
|
// =attributes (password)
|
||||||
@attr('string', {
|
@attr('string', {
|
||||||
|
for: 'password',
|
||||||
description: 'The account login name',
|
description: 'The account login name',
|
||||||
})
|
})
|
||||||
login_name;
|
login_name;
|
||||||
|
|
||||||
|
// =attributes (OIDC)
|
||||||
|
@attr('string', { for: 'oidc' }) subject;
|
||||||
|
@attr('string', { for: 'oidc' }) issuer;
|
||||||
|
@attr('string', { for: 'oidc', readOnly: true }) email;
|
||||||
|
@attr('string', { for: 'oidc', readOnly: true }) full_name;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import Fragment from 'ember-data-model-fragments/fragment';
|
||||||
|
import { attr } from '@ember-data/model';
|
||||||
|
|
||||||
|
export default class FragmentAuthMethodAttributesAccountClaimMapModel extends Fragment {
|
||||||
|
// =attributes (OIDC)
|
||||||
|
|
||||||
|
@attr('string') from;
|
||||||
|
@attr('string') to;
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import Fragment from 'ember-data-model-fragments/fragment';
|
||||||
|
import { attr } from '@ember-data/model';
|
||||||
|
import { fragmentArray } from 'ember-data-model-fragments/attributes';
|
||||||
|
|
||||||
|
export default class FragmentAuthMethodAttributesModel extends Fragment {
|
||||||
|
// =attributes (OIDC)
|
||||||
|
|
||||||
|
@attr('string', { readOnly: true }) state;
|
||||||
|
@attr('string') issuer;
|
||||||
|
@attr('string') client_id;
|
||||||
|
@attr('string') client_secret;
|
||||||
|
@attr('string', { readOnly: true }) client_secret_hmac;
|
||||||
|
@attr('number') max_age;
|
||||||
|
@attr('string') api_url_prefix;
|
||||||
|
@attr('string', { readOnly: true }) callback_url;
|
||||||
|
@attr('boolean') disable_discovered_config_validation;
|
||||||
|
@attr('boolean') dry_run;
|
||||||
|
|
||||||
|
@fragmentArray('fragment-auth-method-attributes-account-claim-map', {
|
||||||
|
emptyArrayIfMissing: true,
|
||||||
|
})
|
||||||
|
account_claim_maps;
|
||||||
|
|
||||||
|
@fragmentArray('fragment-string', {
|
||||||
|
emptyArrayIfMissing: true,
|
||||||
|
})
|
||||||
|
claims_scopes;
|
||||||
|
|
||||||
|
@fragmentArray('fragment-string', {
|
||||||
|
emptyArrayIfMissing: true,
|
||||||
|
})
|
||||||
|
signing_algorithms;
|
||||||
|
|
||||||
|
@fragmentArray('fragment-string', {
|
||||||
|
emptyArrayIfMissing: true,
|
||||||
|
})
|
||||||
|
allowed_audiences;
|
||||||
|
|
||||||
|
@fragmentArray('fragment-string', { emptyArrayIfMissing: true }) idp_ca_certs;
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import Fragment from 'ember-data-model-fragments/fragment';
|
||||||
|
import { attr } from '@ember-data/model';
|
||||||
|
import { options } from './credential-library';
|
||||||
|
|
||||||
|
export default class FragmentCredentialLibraryAttributesModel extends Fragment {
|
||||||
|
//= attributes (vault)
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
description:
|
||||||
|
'The HTTP method the library uses when requesting credentials from Vault.',
|
||||||
|
defaultValue: () => options.http_method[0],
|
||||||
|
})
|
||||||
|
http_method;
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
description:
|
||||||
|
'The body of the HTTP request the library sends to Vault when requesting credentials. Only valid if `http_method` is set to `POST`.',
|
||||||
|
})
|
||||||
|
http_request_body;
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
description: 'The path in Vault to request credentials from.',
|
||||||
|
})
|
||||||
|
path;
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
import Fragment from 'ember-data-model-fragments/fragment';
|
||||||
|
import { attr } from '@ember-data/model';
|
||||||
|
|
||||||
|
export default class FragmentCredentialStoreAttributesModel extends Fragment {
|
||||||
|
// =attributes (vault)
|
||||||
|
@attr('string', {
|
||||||
|
for: 'vault',
|
||||||
|
description:
|
||||||
|
"The address to Vault server. This should be a complete URL such as 'https://127.0.0.1:8200'",
|
||||||
|
})
|
||||||
|
address;
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
for: 'vault',
|
||||||
|
description: 'The namespace within Vault to use.',
|
||||||
|
})
|
||||||
|
namespace;
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
for: 'vault',
|
||||||
|
description:
|
||||||
|
"A PEM-encoded CA certificate to verify the Vault server's TLS certificate.",
|
||||||
|
})
|
||||||
|
ca_cert;
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
for: 'vault',
|
||||||
|
description:
|
||||||
|
'Name to use as the SNI host when connecting to Vault via TLS.',
|
||||||
|
})
|
||||||
|
tls_server_name;
|
||||||
|
|
||||||
|
@attr('boolean', {
|
||||||
|
for: 'vault',
|
||||||
|
description: 'Whether or not to skip TLS verification.',
|
||||||
|
})
|
||||||
|
tls_skip_verify;
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
for: 'vault',
|
||||||
|
description: 'A token used for accessing Vault.',
|
||||||
|
})
|
||||||
|
token;
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
for: 'vault',
|
||||||
|
description: 'The Vault token hmac.',
|
||||||
|
readOnly: true,
|
||||||
|
})
|
||||||
|
token_hmac;
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
for: 'vault',
|
||||||
|
description:
|
||||||
|
'A PEM-encoded client certificate to use for TLS authentication to the Vault server.',
|
||||||
|
})
|
||||||
|
client_certificate;
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
for: 'vault',
|
||||||
|
description:
|
||||||
|
"A PEM-encoded private key matching the client certificate from 'client_certificate'.",
|
||||||
|
})
|
||||||
|
client_certificate_key;
|
||||||
|
|
||||||
|
@attr('string', {
|
||||||
|
for: 'vault',
|
||||||
|
description: 'The Vault client certificate key hmac.',
|
||||||
|
readOnly: true,
|
||||||
|
})
|
||||||
|
client_certificate_key_hmac;
|
||||||
|
}
|
||||||
@@ -1,13 +1,95 @@
|
|||||||
import GeneratedSessionModel from '../generated/models/session';
|
import GeneratedSessionModel from '../generated/models/session';
|
||||||
import { computed } from '@ember/object';
|
import { computed } from '@ember/object';
|
||||||
import { equal } from '@ember/object/computed';
|
import { equal } from '@ember/object/computed';
|
||||||
import { attr } from '@ember-data/model';
|
import { tracked } from '@glimmer/tracking';
|
||||||
|
import { A } from '@ember/array';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class SessionCredential {
|
||||||
|
// =classes
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static Library = class Library {
|
||||||
|
id;
|
||||||
|
name;
|
||||||
|
description;
|
||||||
|
type;
|
||||||
|
|
||||||
|
constructor(id, name, description, type) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static SecretItem = class SecretItem {
|
||||||
|
key;
|
||||||
|
value;
|
||||||
|
|
||||||
|
constructor(key, value) {
|
||||||
|
this.key = key;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// =attributes
|
||||||
|
rawCredential;
|
||||||
|
library;
|
||||||
|
#payloadSecret;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The incoming payload may contain a JSON object under the `decoded` key only
|
||||||
|
* if it can be JSON-decoded. Some credential stores may not provide JSON,
|
||||||
|
* however, in which case we may have only the raw base64-encoded secret
|
||||||
|
* string. In the former case, we convert the key/value pairs of the JSON to
|
||||||
|
* an array of `SecretItem` instances. In the latter case, we return an
|
||||||
|
* array containing a single `SecretItem` instance with key `secret` and a
|
||||||
|
* string value equal to the base64-decoded raw secret.
|
||||||
|
* The credential secret as an array of key/value objects.
|
||||||
|
* @type {SessionCredential.SecretItem[]}
|
||||||
|
*/
|
||||||
|
get secrets() {
|
||||||
|
if (this.#payloadSecret?.decoded) {
|
||||||
|
const secretJSON = this.#payloadSecret.decoded;
|
||||||
|
return Object.keys(secretJSON).map(
|
||||||
|
(key) => new SessionCredential.SecretItem(key, secretJSON[key])
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// decode from base64
|
||||||
|
const decodedString = atob(this.#payloadSecret.raw);
|
||||||
|
return [new SessionCredential.SecretItem('secret', decodedString)];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// =methods
|
||||||
|
|
||||||
|
constructor(cred) {
|
||||||
|
const { id, name, description, type } = cred.credential_library;
|
||||||
|
this.library = new SessionCredential.Library(id, name, description, type);
|
||||||
|
this.#payloadSecret = cred.secret;
|
||||||
|
this.rawCredential = cred;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default class SessionModel extends GeneratedSessionModel {
|
export default class SessionModel extends GeneratedSessionModel {
|
||||||
// =attributes
|
// =attributes
|
||||||
|
|
||||||
@attr('string', { readOnly: true }) proxy_address;
|
// These transient attributes are used for values that come from the CLI
|
||||||
@attr('number', { readOnly: true }) proxy_port;
|
// `connect` command as triggered by Desktop. These attributes represent
|
||||||
|
// transient read-only values.
|
||||||
|
@tracked acknowledged;
|
||||||
|
@tracked started_desktop_client;
|
||||||
|
@tracked proxy_address;
|
||||||
|
@tracked proxy_port;
|
||||||
|
credentials = A();
|
||||||
|
|
||||||
@equal('status', 'active') isActive;
|
@equal('status', 'active') isActive;
|
||||||
@equal('status', 'pending') isPending;
|
@equal('status', 'pending') isPending;
|
||||||
@@ -41,6 +123,13 @@ export default class SessionModel extends GeneratedSessionModel {
|
|||||||
|
|
||||||
// =methods
|
// =methods
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
addCredential(cred) {
|
||||||
|
this.credentials.pushObject(new SessionCredential(cred));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancels the session via the `cancel` method.
|
* Cancels the session via the `cancel` method.
|
||||||
* See serializer and adapter for more information.
|
* See serializer and adapter for more information.
|
||||||
|
|||||||
@@ -20,6 +20,16 @@ export default class TargetModel extends GeneratedTargetModel {
|
|||||||
})
|
})
|
||||||
host_sets;
|
host_sets;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Credential library ids are read only and can be
|
||||||
|
* persisted via a dedicated call to `addCredentialLibraries()`.
|
||||||
|
*/
|
||||||
|
@fragmentArray('fragment-string', {
|
||||||
|
readOnly: true,
|
||||||
|
emptyArrayIfMissing: true,
|
||||||
|
})
|
||||||
|
application_credential_library_ids;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An array of resolved host set and host catalog instances. Model instances
|
* An array of resolved host set and host catalog instances. Model instances
|
||||||
* must already be loaded into the store (this method will not load unloaded
|
* must already be loaded into the store (this method will not load unloaded
|
||||||
@@ -36,6 +46,24 @@ export default class TargetModel extends GeneratedTargetModel {
|
|||||||
.filter((hostSetRef) => hostSetRef.model !== null);
|
.filter((hostSetRef) => hostSetRef.model !== null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An array of resolved credential library instances. Model instances
|
||||||
|
* must already be loaded into the store (this method will not load unloaded
|
||||||
|
* instances). Unresolvable instances are excluded from the array.
|
||||||
|
* @type {[CredentialLibraryModel]}
|
||||||
|
*/
|
||||||
|
@computed('application_credential_library_ids.[]', 'store')
|
||||||
|
get credentialLibraries() {
|
||||||
|
return this.application_credential_library_ids
|
||||||
|
.map((credential_library_fragment) =>
|
||||||
|
this.store.peekRecord(
|
||||||
|
'credential-library',
|
||||||
|
credential_library_fragment.value
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.filter(Boolean);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sessions associated with this target (but only already loaded sessions).
|
* Sessions associated with this target (but only already loaded sessions).
|
||||||
* @type {SessionModel[]}
|
* @type {SessionModel[]}
|
||||||
@@ -122,4 +150,66 @@ export default class TargetModel extends GeneratedTargetModel {
|
|||||||
removeHostSet(hostSetID, options) {
|
removeHostSet(hostSetID, options) {
|
||||||
return this.removeHostSets([hostSetID], options);
|
return this.removeHostSets([hostSetID], options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds credential libraries via the `add-credential-libraries` method.
|
||||||
|
* See serializer and adapter for more information.
|
||||||
|
* @param {[string]} credentialLibraryIDs
|
||||||
|
* @param {object} options
|
||||||
|
* @param {object} options.adapterOptions
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
addCredentialLibraries(
|
||||||
|
credentialLibraryIDs,
|
||||||
|
options = { adapterOptions: {} }
|
||||||
|
) {
|
||||||
|
const defaultAdapterOptions = {
|
||||||
|
method: 'add-credential-libraries',
|
||||||
|
credentialLibraryIDs,
|
||||||
|
};
|
||||||
|
// There is no "deep merge" in ES.
|
||||||
|
return this.save({
|
||||||
|
...options,
|
||||||
|
adapterOptions: {
|
||||||
|
...defaultAdapterOptions,
|
||||||
|
...options.adapterOptions,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete credential libraries via the `remove-credential-libraries` method.
|
||||||
|
* See serializer and adapter for more information.
|
||||||
|
* @param {[string]} credentialLibraryIDs
|
||||||
|
* @param {object} options
|
||||||
|
* @param {object} options.adapterOptions
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
removeCredentialLibraries(
|
||||||
|
credentialLibraryIDs,
|
||||||
|
options = { adapterOptions: {} }
|
||||||
|
) {
|
||||||
|
const defaultAdapterOptions = {
|
||||||
|
method: 'remove-credential-libraries',
|
||||||
|
credentialLibraryIDs,
|
||||||
|
};
|
||||||
|
// There is no "deep merge" in ES.
|
||||||
|
return this.save({
|
||||||
|
...options,
|
||||||
|
adapterOptions: {
|
||||||
|
...defaultAdapterOptions,
|
||||||
|
...options.adapterOptions,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a single credential library set via the `remove-credential-libraries` method.
|
||||||
|
* @param {number} credentialLibraryID
|
||||||
|
* @param {object} options
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
removeCredentialLibrary(credentialLibraryID, options) {
|
||||||
|
return this.removeCredentialLibraries([credentialLibraryID], options);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -20,13 +20,55 @@ export default class AccountSerializer extends ApplicationSerializer {
|
|||||||
* @return {object}
|
* @return {object}
|
||||||
*/
|
*/
|
||||||
serialize(snapshot) {
|
serialize(snapshot) {
|
||||||
|
switch (snapshot.record.type) {
|
||||||
|
case 'password':
|
||||||
|
return this.serializePassword(...arguments);
|
||||||
|
case 'oidc':
|
||||||
|
return this.serializeOIDC(...arguments);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OIDC serialization limits the `attributes` posted on create and omits
|
||||||
|
* `attributes` entirely on update.
|
||||||
|
*/
|
||||||
|
serializeOIDC(snapshot) {
|
||||||
|
const { isNew } = snapshot?.record;
|
||||||
|
let serialized = super.serialize(...arguments);
|
||||||
|
delete serialized.attributes;
|
||||||
|
if (isNew) {
|
||||||
|
serialized.attributes = {};
|
||||||
|
const { issuer, subject } = snapshot.attr('attributes').record;
|
||||||
|
if (issuer) serialized.attributes.issuer = issuer;
|
||||||
|
if (subject) serialized.attributes.subject = subject;
|
||||||
|
}
|
||||||
|
return serialized;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Password serialization omits `attributes` and handles password-related
|
||||||
|
* custom methods.
|
||||||
|
* @param {Snapshot} snapshot
|
||||||
|
* @return {object}
|
||||||
|
*/
|
||||||
|
serializePassword(snapshot) {
|
||||||
const password = snapshot?.adapterOptions?.password;
|
const password = snapshot?.adapterOptions?.password;
|
||||||
let serialized = super.serialize(...arguments);
|
let serialized = super.serialize(...arguments);
|
||||||
|
// Only login_name is serialized into password attributes.
|
||||||
|
const { login_name } = serialized.attributes;
|
||||||
|
if (login_name) {
|
||||||
|
serialized.attributes = { login_name };
|
||||||
|
} else {
|
||||||
|
serialized.attributes = {};
|
||||||
|
}
|
||||||
|
// New record case
|
||||||
if (password && snapshot?.record?.isNew)
|
if (password && snapshot?.record?.isNew)
|
||||||
serialized.attributes.password = password;
|
serialized.attributes.password = password;
|
||||||
|
// Set password custom method
|
||||||
if (snapshot?.adapterOptions?.method === 'set-password') {
|
if (snapshot?.adapterOptions?.method === 'set-password') {
|
||||||
serialized = this.serializeForSetPassword(snapshot, password);
|
serialized = this.serializeForSetPassword(snapshot, password);
|
||||||
}
|
}
|
||||||
|
// Change password custom method
|
||||||
if (snapshot?.adapterOptions?.method === 'change-password') {
|
if (snapshot?.adapterOptions?.method === 'change-password') {
|
||||||
const { currentPassword, newPassword } = snapshot?.adapterOptions;
|
const { currentPassword, newPassword } = snapshot?.adapterOptions;
|
||||||
serialized = this.serializeForChangePassword(
|
serialized = this.serializeForChangePassword(
|
||||||
|
|||||||
@@ -1,6 +1,64 @@
|
|||||||
import ApplicationSerializer from './application';
|
import ApplicationSerializer from './application';
|
||||||
|
import { copy } from 'ember-copy';
|
||||||
|
|
||||||
export default class AuthMethodSerializer extends ApplicationSerializer {
|
export default class AuthMethodSerializer extends ApplicationSerializer {
|
||||||
|
// =methods
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delegates to a type-specific serialization, or default.
|
||||||
|
* @override
|
||||||
|
* @param {Snapshot} snapshot
|
||||||
|
* @return {object}
|
||||||
|
*/
|
||||||
|
serialize(snapshot) {
|
||||||
|
switch (snapshot.record.type) {
|
||||||
|
case 'oidc':
|
||||||
|
return this.serializeOIDC(...arguments);
|
||||||
|
default:
|
||||||
|
return this.serializeDefault(...arguments);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default serialization omits `attributes`.
|
||||||
|
* @return {object}
|
||||||
|
*/
|
||||||
|
serializeDefault() {
|
||||||
|
let serialized = super.serialize(...arguments);
|
||||||
|
delete serialized.attributes;
|
||||||
|
return serialized;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If `adapterOptions.state` is set, the serialization should
|
||||||
|
* include **only state** and version. Normally, this is not serialized.
|
||||||
|
* @param {Snapshot} snapshot
|
||||||
|
* @return {object}
|
||||||
|
*/
|
||||||
|
serializeOIDC(snapshot) {
|
||||||
|
let serialized = super.serialize(...arguments);
|
||||||
|
const state = snapshot?.adapterOptions?.state;
|
||||||
|
if (state) {
|
||||||
|
serialized = this.serializeOIDCWithState(snapshot, state);
|
||||||
|
} else {
|
||||||
|
delete serialized.attributes.state;
|
||||||
|
}
|
||||||
|
return serialized;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a payload containing only state and version.
|
||||||
|
* @param {Snapshot} snapshot
|
||||||
|
* @param {string} state
|
||||||
|
* @return {object}
|
||||||
|
*/
|
||||||
|
serializeOIDCWithState(snapshot, state) {
|
||||||
|
return {
|
||||||
|
version: snapshot.attr('version'),
|
||||||
|
attributes: { state },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sorts the array in order of "is_primary" such that the primary method
|
* Sorts the array in order of "is_primary" such that the primary method
|
||||||
* appears first. The "natural" order of auth methods places primary first.
|
* appears first. The "natural" order of auth methods places primary first.
|
||||||
@@ -23,10 +81,19 @@ export default class AuthMethodSerializer extends ApplicationSerializer {
|
|||||||
*
|
*
|
||||||
* TODO: generalize this so that all zero values are reified.
|
* TODO: generalize this so that all zero values are reified.
|
||||||
* @override
|
* @override
|
||||||
* @return {object}
|
* @see FragmentScope
|
||||||
|
* @param {Model} typeClass
|
||||||
|
* @param {Object} hash
|
||||||
|
* @return {Object}
|
||||||
*/
|
*/
|
||||||
normalize() {
|
normalize(typeClass, hash, ...rest) {
|
||||||
const normalized = super.normalize(...arguments);
|
let normalizedHash = copy(hash, true);
|
||||||
|
// switch (normalizedHash.type) {
|
||||||
|
// case 'oidc':
|
||||||
|
// normalizedHash = this.normalizeOIDC(normalizedHash);
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
const normalized = super.normalize(typeClass, normalizedHash, ...rest);
|
||||||
if (!normalized.data.attributes.is_primary) {
|
if (!normalized.data.attributes.is_primary) {
|
||||||
normalized.data.attributes.is_primary = false;
|
normalized.data.attributes.is_primary = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import ApplicationSerializer from './application';
|
||||||
|
|
||||||
|
export default class CredentialLibrarySerializer extends ApplicationSerializer {}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import ApplicationSerializer from './application';
|
||||||
|
|
||||||
|
export default class CredentialStoreSerializer extends ApplicationSerializer {}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import JSONSerializer from '@ember-data/serializer/json';
|
||||||
|
|
||||||
|
export default class FragmentAccountAttributesSerializer extends JSONSerializer {
|
||||||
|
/**
|
||||||
|
* If an attribute is annotated as readOnly in the model, don't serialize it.
|
||||||
|
* Otherwise delegate to default attribute serializer.
|
||||||
|
*
|
||||||
|
* @override
|
||||||
|
* @method serializeAttribute
|
||||||
|
* @param {Snapshot} snapshot
|
||||||
|
* @param {Object} json
|
||||||
|
* @param {String} key
|
||||||
|
* @param {Object} attribute
|
||||||
|
*/
|
||||||
|
serializeAttribute(snapshot, json, key, attribute) {
|
||||||
|
const { type, options } = attribute;
|
||||||
|
let value = super.serializeAttribute(...arguments);
|
||||||
|
// Convert empty strings to null.
|
||||||
|
if (type === 'string' && json[key] === '') json[key] = null;
|
||||||
|
// Do not serialize read-only attributes.
|
||||||
|
if (options.readOnly) delete json[key];
|
||||||
|
// Client secret cannot be unset. If it's falsy, it must be removed.
|
||||||
|
if (key === 'client_secret' && !json[key]) delete json[key];
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import JSONSerializer from '@ember-data/serializer/json';
|
||||||
|
|
||||||
|
export default class FragmentHostSetSerializer extends JSONSerializer {
|
||||||
|
// =methods
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serializes an account claim to string.
|
||||||
|
* @param {Snapshot} snapshot
|
||||||
|
* @return {string}
|
||||||
|
*/
|
||||||
|
serialize(snapshot) {
|
||||||
|
const from = snapshot.attr('from');
|
||||||
|
const to = snapshot.attr('to');
|
||||||
|
return `${from}=${to}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Normalizes account claim strings into JSON API objects.
|
||||||
|
* @param {Model} typeClass
|
||||||
|
* @param {string} value
|
||||||
|
* @return {object}
|
||||||
|
*/
|
||||||
|
normalize(typeClass, value) {
|
||||||
|
const normalizedHash = {
|
||||||
|
from: value.split('=')[0],
|
||||||
|
to: value.split('=')[1],
|
||||||
|
};
|
||||||
|
return super.normalize(typeClass, normalizedHash);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import JSONSerializer from '@ember-data/serializer/json';
|
||||||
|
|
||||||
|
export default class FragmentAuthMethodAttributesSerializer extends JSONSerializer {
|
||||||
|
/**
|
||||||
|
* If an attribute is annotated as readOnly in the model, don't serialize it.
|
||||||
|
* Otherwise delegate to default attribute serializer.
|
||||||
|
*
|
||||||
|
* @override
|
||||||
|
* @method serializeAttribute
|
||||||
|
* @param {Snapshot} snapshot
|
||||||
|
* @param {Object} json
|
||||||
|
* @param {String} key
|
||||||
|
* @param {Object} attribute
|
||||||
|
*/
|
||||||
|
serializeAttribute(snapshot, json, key, attribute) {
|
||||||
|
const { type, options } = attribute;
|
||||||
|
let value = super.serializeAttribute(...arguments);
|
||||||
|
// Convert empty strings to null.
|
||||||
|
if (type === 'string' && json[key] === '') json[key] = null;
|
||||||
|
// Do not serialize read-only attributes.
|
||||||
|
if (options.readOnly) delete json[key];
|
||||||
|
// Client secret cannot be unset. If it's falsy, it must be removed.
|
||||||
|
if (key === 'client_secret' && !json[key]) delete json[key];
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import JSONSerializer from '@ember-data/serializer/json';
|
||||||
|
|
||||||
|
export default class FragmentCredentialLibraryAttributesSerializer extends JSONSerializer {
|
||||||
|
/**
|
||||||
|
* If an attribute is annotated as readOnly in the model, don't serialize it.
|
||||||
|
* Otherwise delegate to default attribute serializer.
|
||||||
|
* Only serialize http_request_body when `http_method` is set to `POST`.
|
||||||
|
* @override
|
||||||
|
* @method serializeAttribute
|
||||||
|
* @param {Snapshot} snapshot
|
||||||
|
* @param {Object} json
|
||||||
|
* @param {String} key
|
||||||
|
* @param {Object} attribute
|
||||||
|
*/
|
||||||
|
serializeAttribute(snapshot, json, key, attribute) {
|
||||||
|
const { type, options } = attribute;
|
||||||
|
let value = super.serializeAttribute(...arguments);
|
||||||
|
// Convert empty strings to null.
|
||||||
|
if (type === 'string' && json[key] === '') json[key] = null;
|
||||||
|
// Do not serialize read-only attributes.
|
||||||
|
if (options.readOnly) delete json[key];
|
||||||
|
// Do not serialize http_request_body unless http_method is POST
|
||||||
|
if (key === 'http_request_body' && !json['http_method']?.match(/post/i))
|
||||||
|
delete json[key];
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import JSONSerializer from '@ember-data/serializer/json';
|
||||||
|
|
||||||
|
export default class FragmentCredentialStoreAttributesSerializer extends JSONSerializer {
|
||||||
|
/**
|
||||||
|
* If an attribute is annotated as readOnly in the model, don't serialize it.
|
||||||
|
* Otherwise delegate to default attribute serializer.
|
||||||
|
*
|
||||||
|
* @override
|
||||||
|
* @method serializeAttribute
|
||||||
|
* @param {Snapshot} snapshot
|
||||||
|
* @param {Object} json
|
||||||
|
* @param {String} key
|
||||||
|
* @param {Object} attribute
|
||||||
|
*/
|
||||||
|
serializeAttribute(snapshot, json, key, attribute) {
|
||||||
|
const { type, options } = attribute;
|
||||||
|
let value = super.serializeAttribute(...arguments);
|
||||||
|
// Convert empty strings to null.
|
||||||
|
if (type === 'string' && json[key] === '') json[key] = null;
|
||||||
|
// Do not serialize read-only attributes.
|
||||||
|
if (options.readOnly) delete json[key];
|
||||||
|
// Token cannot be unset. If it's falsy, it must be removed.
|
||||||
|
if (key === 'token' && !json[key]) delete json[key];
|
||||||
|
// Client certificate key cannot be unset when certificate is set.
|
||||||
|
// If it's falsy, it must be removed.
|
||||||
|
if (
|
||||||
|
key === 'client_certificate_key' &&
|
||||||
|
!json[key] &&
|
||||||
|
json['client_certificate']
|
||||||
|
)
|
||||||
|
delete json[key];
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import JSONSerializer from '@ember-data/serializer/json';
|
||||||
|
|
||||||
|
export default class FragmentStringSerializer extends JSONSerializer {
|
||||||
|
// =methods
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serializes a to string.
|
||||||
|
* @param {Snapshot} snapshot
|
||||||
|
* @return {string}
|
||||||
|
*/
|
||||||
|
serialize(snapshot) {
|
||||||
|
return snapshot.attr('value');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Normalizes from strings.
|
||||||
|
* @param {Model} typeClass
|
||||||
|
* @param {string} value
|
||||||
|
* @return {object}
|
||||||
|
*/
|
||||||
|
normalize(typeClass, value) {
|
||||||
|
return super.normalize(typeClass, { value });
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -37,21 +37,4 @@ export default class HostSetSerializer extends ApplicationSerializer {
|
|||||||
host_ids: hostIDs,
|
host_ids: hostIDs,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Converts string arrays to object arrays for use with `fragment-string`.
|
|
||||||
* E.g. `"foo"` -> `{value: "foo"}`
|
|
||||||
* @override
|
|
||||||
* @param {Model} modelClass
|
|
||||||
* @param {Object} resourceHash
|
|
||||||
* @return {Object}
|
|
||||||
*/
|
|
||||||
normalize(modelClass, resourceHash) {
|
|
||||||
// TODO: can fragment string normalization be handled generically?
|
|
||||||
// TODO: host_ids might actually be attributes.host_ids
|
|
||||||
if (resourceHash.host_ids) {
|
|
||||||
resourceHash.host_ids = resourceHash.host_ids.map((value) => ({ value }));
|
|
||||||
}
|
|
||||||
return super.normalize(modelClass, resourceHash);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,11 @@ export default class TargetSerializer extends ApplicationSerializer {
|
|||||||
/**
|
/**
|
||||||
* If `adapterOptions.hostSets` is set to an array of host set models,
|
* If `adapterOptions.hostSets` is set to an array of host set models,
|
||||||
* the resulting target serialization should include **only host sets**
|
* the resulting target serialization should include **only host sets**
|
||||||
* and the version. Normally, host sets are not serialized.
|
* and the version.
|
||||||
|
* If `adapterOptions.credentialLibraries` is set to an array of
|
||||||
|
* credential library models, the resulting target serialization should
|
||||||
|
* include **only credential libraries** and the version.
|
||||||
|
* Normally, neither host sets or credential libraries are not serialized.
|
||||||
* @override
|
* @override
|
||||||
* @param {Snapshot} snapshot
|
* @param {Snapshot} snapshot
|
||||||
* @return {object}
|
* @return {object}
|
||||||
@@ -16,6 +20,12 @@ export default class TargetSerializer extends ApplicationSerializer {
|
|||||||
const hostSetIDs = snapshot?.adapterOptions?.hostSetIDs;
|
const hostSetIDs = snapshot?.adapterOptions?.hostSetIDs;
|
||||||
if (hostSetIDs)
|
if (hostSetIDs)
|
||||||
serialized = this.serializeWithHostSets(snapshot, hostSetIDs);
|
serialized = this.serializeWithHostSets(snapshot, hostSetIDs);
|
||||||
|
const credentialLibraryIDs = snapshot?.adapterOptions?.credentialLibraryIDs;
|
||||||
|
if (credentialLibraryIDs)
|
||||||
|
serialized = this.serializeWithCredentialLibraries(
|
||||||
|
snapshot,
|
||||||
|
credentialLibraryIDs
|
||||||
|
);
|
||||||
return serialized;
|
return serialized;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,4 +42,18 @@ export default class TargetSerializer extends ApplicationSerializer {
|
|||||||
host_set_ids: hostSetIDs,
|
host_set_ids: hostSetIDs,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a payload containing only the credential_library_ids array using IDs
|
||||||
|
* passed into the function (rather than existing credential libraries on the model).
|
||||||
|
* @param {Snapshot} snapshot
|
||||||
|
* @param {[string]} credentialLibraryIDs
|
||||||
|
* @return {object}
|
||||||
|
*/
|
||||||
|
serializeWithCredentialLibraries(snapshot, credentialLibraryIDs) {
|
||||||
|
return {
|
||||||
|
version: snapshot.attr('version'),
|
||||||
|
application_credential_library_ids: credentialLibraryIDs,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -76,8 +76,9 @@ export default class StorageService extends Service {
|
|||||||
const inMemory = get(config, 'storage.memory');
|
const inMemory = get(config, 'storage.memory');
|
||||||
// Get the global context object (window) via service lookup,
|
// Get the global context object (window) via service lookup,
|
||||||
// because just reaching for a global is icky
|
// because just reaching for a global is icky
|
||||||
const globalContext = getOwner(this).lookup('service:-document')
|
const globalContext =
|
||||||
.documentElement.parentNode.defaultView;
|
getOwner(this).lookup('service:-document').documentElement.parentNode
|
||||||
|
.defaultView;
|
||||||
// If memory storage enabled, return the memory storage instance,
|
// If memory storage enabled, return the memory storage instance,
|
||||||
// otherwise return localStorage.
|
// otherwise return localStorage.
|
||||||
return inMemory ? this.#memoryStorage : globalContext.localStorage;
|
return inMemory ? this.#memoryStorage : globalContext.localStorage;
|
||||||
|
|||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
export {
|
||||||
|
default,
|
||||||
|
initialize,
|
||||||
|
} from 'api/initializers/fragment-auth-method-attributes-account-claim-map-serializer';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default, initialize } from 'api/initializers/fragment-string';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from 'api/models/credential-library';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from 'api/models/credential-store';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from 'api/models/fragment-auth-method-attributes-account-claim-map';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from 'api/models/fragment-auth-method-attributes';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from 'api/models/fragment-credential-library-attributes';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from 'api/models/fragment-credential-store-attributes';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from 'api/serializers/credential-library';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from 'api/serializers/credential-store';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from 'api/serializers/fragment-account-attributes';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from 'api/serializers/fragment-auth-method-attributes';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from 'api/serializers/fragment-credential-library-attributes';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from 'api/serializers/fragment-credential-store-attributes';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from 'api/serializers/fragment-string';
|
||||||
@@ -13,7 +13,7 @@ export default function () {
|
|||||||
// make this `/api`, for example, if your API is namespaced
|
// make this `/api`, for example, if your API is namespaced
|
||||||
this.namespace = config.api.namespace;
|
this.namespace = config.api.namespace;
|
||||||
// delay for each request, automatically set to 0 during testing
|
// delay for each request, automatically set to 0 during testing
|
||||||
this.timing = 350;
|
this.timing = 1;
|
||||||
|
|
||||||
// Allow any configured API host to passthrough, which is useful in
|
// Allow any configured API host to passthrough, which is useful in
|
||||||
// development for testing against a locally running backend.
|
// development for testing against a locally running backend.
|
||||||
@@ -106,8 +106,9 @@ export default function () {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// Authenticate/deauthenticate routes
|
// Authenticate + auth methods custom routes
|
||||||
this.post('/auth-methods/:id_method', authHandler);
|
this.post('/auth-methods/:id_method', authHandler);
|
||||||
|
// Deauthenticate route
|
||||||
this.post('/scopes/:id_method', deauthHandler);
|
this.post('/scopes/:id_method', deauthHandler);
|
||||||
|
|
||||||
// IAM : Users
|
// IAM : Users
|
||||||
@@ -365,10 +366,10 @@ export default function () {
|
|||||||
const target = targets.find(id);
|
const target = targets.find(id);
|
||||||
const updatedAttrs = {
|
const updatedAttrs = {
|
||||||
version: attrs.version,
|
version: attrs.version,
|
||||||
hostSetIds: target.hostSetIds,
|
|
||||||
};
|
};
|
||||||
// If adding host sets, push them into the array
|
// If adding host sets, push them into the array
|
||||||
if (method === 'add-host-sets') {
|
if (method === 'add-host-sets') {
|
||||||
|
updatedAttrs.hostSetIds = target.hostSetIds;
|
||||||
attrs.hostSetIds.forEach((id) => {
|
attrs.hostSetIds.forEach((id) => {
|
||||||
if (!updatedAttrs.hostSetIds.includes(id)) {
|
if (!updatedAttrs.hostSetIds.includes(id)) {
|
||||||
updatedAttrs.hostSetIds.push(id);
|
updatedAttrs.hostSetIds.push(id);
|
||||||
@@ -377,10 +378,28 @@ export default function () {
|
|||||||
}
|
}
|
||||||
// If deleting host sets, filter them out of the array
|
// If deleting host sets, filter them out of the array
|
||||||
if (method === 'remove-host-sets') {
|
if (method === 'remove-host-sets') {
|
||||||
|
updatedAttrs.hostSetIds = target.hostSetIds;
|
||||||
updatedAttrs.hostSetIds = updatedAttrs.hostSetIds.filter((id) => {
|
updatedAttrs.hostSetIds = updatedAttrs.hostSetIds.filter((id) => {
|
||||||
return !attrs.hostSetIds.includes(id);
|
return !attrs.hostSetIds.includes(id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// If adding credential libraries, push them into the array
|
||||||
|
if (method === 'add-credential-libraries') {
|
||||||
|
updatedAttrs.credentialLibraryIds = target.credentialLibraryIds;
|
||||||
|
attrs.applicationCredentialLibraryIds.forEach((id) => {
|
||||||
|
if (!updatedAttrs.credentialLibraryIds.includes(id)) {
|
||||||
|
updatedAttrs.credentialLibraryIds.push(id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// If deleting credential libraries, filter them out of the array
|
||||||
|
if (method === 'remove-credential-libraries') {
|
||||||
|
updatedAttrs.credentialLibraryIds = target.credentialLibraryIds;
|
||||||
|
updatedAttrs.credentialLibraryIds =
|
||||||
|
updatedAttrs.credentialLibraryIds.filter((id) => {
|
||||||
|
return !attrs.applicationCredentialLibraryIds.includes(id);
|
||||||
|
});
|
||||||
|
}
|
||||||
return target.update(updatedAttrs);
|
return target.update(updatedAttrs);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -455,6 +474,41 @@ export default function () {
|
|||||||
return new Response(200);
|
return new Response(200);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// credential-stores
|
||||||
|
|
||||||
|
this.get(
|
||||||
|
'/credential-stores',
|
||||||
|
({ credentialStores }, { queryParams: { scope_id: scopeId } }) =>
|
||||||
|
credentialStores.where({ scopeId })
|
||||||
|
);
|
||||||
|
|
||||||
|
this.get('/credential-stores/:id');
|
||||||
|
this.post('/credential-stores');
|
||||||
|
this.patch('/credential-stores/:id');
|
||||||
|
this.del('/credential-stores/:id');
|
||||||
|
|
||||||
|
// credential-libraries
|
||||||
|
|
||||||
|
this.get(
|
||||||
|
'/credential-libraries',
|
||||||
|
(
|
||||||
|
{ credentialLibraries },
|
||||||
|
{ queryParams: { credential_store_id: credentialStoreId } }
|
||||||
|
) => credentialLibraries.where({ credentialStoreId })
|
||||||
|
);
|
||||||
|
this.get('/credential-libraries/:id');
|
||||||
|
this.post(
|
||||||
|
'/credential-libraries',
|
||||||
|
function ({ credentialStores, credentialLibraries }) {
|
||||||
|
const attrs = this.normalizedRequestAttrs();
|
||||||
|
const credentialStore = credentialStores.find(attrs.credentialStoreId);
|
||||||
|
attrs.scopeId = credentialStore.scope.id;
|
||||||
|
return credentialLibraries.create(attrs);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
this.del('/credential-libraries/:id');
|
||||||
|
this.patch('/credential-libraries/:id');
|
||||||
|
|
||||||
/* Uncomment the following line and the Response import above
|
/* Uncomment the following line and the Response import above
|
||||||
* Then change the response code to simulate error responses.
|
* Then change the response code to simulate error responses.
|
||||||
* this.get('/scopes', () => new Response(505));
|
* this.get('/scopes', () => new Response(505));
|
||||||
|
|||||||
@@ -1,3 +1,18 @@
|
|||||||
import factory from '../generated/factories/account';
|
import factory from '../generated/factories/account';
|
||||||
|
import { random, internet } from 'faker';
|
||||||
|
|
||||||
export default factory.extend();
|
export default factory.extend({
|
||||||
|
attributes() {
|
||||||
|
switch (this.type) {
|
||||||
|
case 'password':
|
||||||
|
return { login_name: random.words() };
|
||||||
|
case 'oidc':
|
||||||
|
return {
|
||||||
|
issuer: internet.ip(),
|
||||||
|
subject: 'sub',
|
||||||
|
email: internet.email(),
|
||||||
|
full_name: random.words(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -14,9 +14,9 @@ export default factory.extend({
|
|||||||
*/
|
*/
|
||||||
withAccountsAndUsers: trait({
|
withAccountsAndUsers: trait({
|
||||||
afterCreate(authMethod, server) {
|
afterCreate(authMethod, server) {
|
||||||
const { scope } = authMethod;
|
const { scope, type } = authMethod;
|
||||||
server.createList('user', 5, { scope }).map((user) => {
|
server.createList('user', 5, { scope }).map((user) => {
|
||||||
const { id } = server.create('account', { scope, authMethod });
|
const { id } = server.create('account', { scope, type, authMethod });
|
||||||
user.update({ accountIds: [id] });
|
user.update({ accountIds: [id] });
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import factory from '../generated/factories/credential-library';
|
||||||
|
import { random, system } from 'faker';
|
||||||
|
|
||||||
|
const types = ['vault'];
|
||||||
|
|
||||||
|
export default factory.extend({
|
||||||
|
id: (i) => `credential-library-id-${i}`,
|
||||||
|
type: (i) => types[i % types.length],
|
||||||
|
|
||||||
|
attributes() {
|
||||||
|
switch (this.type) {
|
||||||
|
case 'vault':
|
||||||
|
return {
|
||||||
|
http_method: 'GET',
|
||||||
|
http_request_body: random.word(),
|
||||||
|
path: system.directoryPath(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import factory from '../generated/factories/credential-store';
|
||||||
|
import { random, internet, datatype } from 'faker';
|
||||||
|
import { trait } from 'ember-cli-mirage';
|
||||||
|
|
||||||
|
const types = ['vault'];
|
||||||
|
|
||||||
|
export default factory.extend({
|
||||||
|
id: (i) => `credential-store-id-${i}`,
|
||||||
|
type: (i) => types[i % types.length],
|
||||||
|
|
||||||
|
attributes() {
|
||||||
|
switch (this.type) {
|
||||||
|
case 'vault':
|
||||||
|
return {
|
||||||
|
address: internet.ip(),
|
||||||
|
namespace: random.word(),
|
||||||
|
ca_cert: 'ca-cert-123',
|
||||||
|
tls_server_name: internet.domainName(),
|
||||||
|
tls_skip_verify: datatype.boolean(),
|
||||||
|
token_hmac: 'token-hmac-abcde0987654321',
|
||||||
|
client_certificate: 'client-cert-123',
|
||||||
|
client_certificate_key_hmac: 'client-cert-key-hmac-abcde0987654321',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
withAssociations: trait({
|
||||||
|
afterCreate(credentialStore, server) {
|
||||||
|
const { scope } = credentialStore;
|
||||||
|
server.createList('credential-library', 2, {
|
||||||
|
scope,
|
||||||
|
credentialStore,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
@@ -7,7 +7,7 @@ const hostSetChance = 0.3;
|
|||||||
|
|
||||||
export default factory.extend({
|
export default factory.extend({
|
||||||
/**
|
/**
|
||||||
* -1 means "unlimited" and we want to generate these on occassion.
|
* -1 means "unlimited" and we want to generate these on occasion.
|
||||||
*/
|
*/
|
||||||
session_connection_limit: () => random.arrayElement([-1, datatype.number()]),
|
session_connection_limit: () => random.arrayElement([-1, datatype.number()]),
|
||||||
|
|
||||||
@@ -25,11 +25,11 @@ export default factory.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Randomly selects existing host sets to assign to target.
|
* Randomly selects existing host sets and credential libraries to assign to target.
|
||||||
*/
|
*/
|
||||||
withRandomHostSets: trait({
|
withAssociations: trait({
|
||||||
afterCreate(target, server) {
|
afterCreate(target, server) {
|
||||||
let randomlySelectedHostSets;
|
let randomlySelectedHostSets, randomlySelectedCredentialLibraries;
|
||||||
randomlySelectedHostSets = server.schema.hostSets
|
randomlySelectedHostSets = server.schema.hostSets
|
||||||
// BLERG: fun fact, for no reason at all, the element passed
|
// BLERG: fun fact, for no reason at all, the element passed
|
||||||
// into a where function is not a full model instance, as you might
|
// into a where function is not a full model instance, as you might
|
||||||
@@ -38,7 +38,17 @@ export default factory.extend({
|
|||||||
// the result set of `where` _is a collection of model instances_.
|
// the result set of `where` _is a collection of model instances_.
|
||||||
.where((hostSet) => hostSet.scopeId === target.scope.id)
|
.where((hostSet) => hostSet.scopeId === target.scope.id)
|
||||||
.models.filter(() => randomBoolean(hostSetChance));
|
.models.filter(() => randomBoolean(hostSetChance));
|
||||||
target.update({ hostSets: randomlySelectedHostSets });
|
|
||||||
|
randomlySelectedCredentialLibraries = server.schema.credentialLibraries
|
||||||
|
.where(
|
||||||
|
(credentialLibrary) => credentialLibrary.scopeId === target.scope.id
|
||||||
|
)
|
||||||
|
.models.filter(() => randomBoolean());
|
||||||
|
|
||||||
|
target.update({
|
||||||
|
hostSets: randomlySelectedHostSets,
|
||||||
|
credentialLibraries: randomlySelectedCredentialLibraries,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
@@ -1,15 +1,14 @@
|
|||||||
import { Factory } from 'ember-cli-mirage';
|
import { Factory } from 'ember-cli-mirage';
|
||||||
import { random, date, datatype } from 'faker';
|
import { date, datatype } from 'faker';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GeneratedAccountFactory
|
* GeneratedAccountFactory
|
||||||
*/
|
*/
|
||||||
export default Factory.extend({
|
export default Factory.extend({
|
||||||
type: 'password',
|
type: 'password',
|
||||||
name: () => random.words(),
|
// name: () => random.words(),
|
||||||
description: () => random.words(),
|
// description: () => random.words(),
|
||||||
created_time: () => date.recent(),
|
created_time: () => date.recent(),
|
||||||
updated_time: () => date.recent(),
|
updated_time: () => date.recent(),
|
||||||
version: () => datatype.number(),
|
version: () => datatype.number(),
|
||||||
attributes: () => ({ login_name: random.words() }),
|
|
||||||
});
|
});
|
||||||
@@ -11,4 +11,29 @@ export default Factory.extend({
|
|||||||
created_time: () => date.recent(),
|
created_time: () => date.recent(),
|
||||||
updated_time: () => date.recent(),
|
updated_time: () => date.recent(),
|
||||||
disabled: () => datatype.boolean(),
|
disabled: () => datatype.boolean(),
|
||||||
|
|
||||||
|
attributes: function () {
|
||||||
|
let attrs;
|
||||||
|
switch (this.type) {
|
||||||
|
case 'oidc':
|
||||||
|
attrs = {
|
||||||
|
api_url_prefix: 'http://127.0.0.1:9200',
|
||||||
|
callback_url:
|
||||||
|
'http://127.0.0.1:9200/v1/auth-methods/oidc:authenticate:callback',
|
||||||
|
client_id: 'YTwdJBB55LpKnuXb9n65',
|
||||||
|
client_secret_hmac: 'GY7blb4ynM5TEPNi_qnphJ9aDWhW8FpmN3D-eP_L7Zk',
|
||||||
|
issuer: 'http://127.0.0.1:57070',
|
||||||
|
max_age: 1800,
|
||||||
|
disable_discovered_config_validation: false,
|
||||||
|
state: 'active-public',
|
||||||
|
account_claim_maps: ['oid=sub', 'full_name=name'],
|
||||||
|
claims_scopes: ['profile', 'email'],
|
||||||
|
signing_algorithms: ['RS256', 'RS384'],
|
||||||
|
allowed_audiences: ['www.alice.com', 'www.alice.com/admin'],
|
||||||
|
idp_ca_certs: ['certificate-1234', 'certificate-5678'],
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return attrs;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { Factory } from 'ember-cli-mirage';
|
||||||
|
import { random, date } from 'faker';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GeneratedCredentialLibraryModelFactory
|
||||||
|
*/
|
||||||
|
export default Factory.extend({
|
||||||
|
name: () => random.words(),
|
||||||
|
description: () => random.words(),
|
||||||
|
created_time: () => date.recent(),
|
||||||
|
updated_time: () => date.recent(),
|
||||||
|
});
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { Factory } from 'ember-cli-mirage';
|
||||||
|
import { random, date } from 'faker';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GeneratedCredentialStoreModelFactory
|
||||||
|
*/
|
||||||
|
export default Factory.extend({
|
||||||
|
name: () => random.words(),
|
||||||
|
description: () => random.words(),
|
||||||
|
created_time: () => date.recent(),
|
||||||
|
updated_time: () => date.recent(),
|
||||||
|
});
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import { Model, belongsTo } from 'ember-cli-mirage';
|
||||||
|
|
||||||
|
export default Model.extend({
|
||||||
|
scope: belongsTo(),
|
||||||
|
credentialStore: belongsTo(),
|
||||||
|
});
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { Model, belongsTo } from 'ember-cli-mirage';
|
||||||
|
|
||||||
|
export default Model.extend({
|
||||||
|
scope: belongsTo(),
|
||||||
|
});
|
||||||
@@ -3,4 +3,5 @@ import { Model, belongsTo, hasMany } from 'ember-cli-mirage';
|
|||||||
export default Model.extend({
|
export default Model.extend({
|
||||||
scope: belongsTo(),
|
scope: belongsTo(),
|
||||||
hostSets: hasMany(),
|
hostSets: hasMany(),
|
||||||
|
credentialLibraries: hasMany(),
|
||||||
});
|
});
|
||||||
@@ -107,14 +107,34 @@ const commandHandlers = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handles all custom methods on /auth-methods/:id route
|
||||||
export function authHandler({ scopes, authMethods }, request) {
|
export function authHandler({ scopes, authMethods }, request) {
|
||||||
const payload = JSON.parse(request.requestBody);
|
const [, id, method] = request.params.id_method.match(
|
||||||
const [, id] = request.params.id_method.match(/(?<id>.[^:]*)/);
|
/(?<id>.[^:]*):(?<method>(.*))/
|
||||||
const { command } = payload;
|
);
|
||||||
const authMethod = authMethods.find(id);
|
const authMethod = authMethods.find(id);
|
||||||
const scope = scopes.find(authMethod.scopeId);
|
|
||||||
const scopeAttrs = this.serialize(scopes.find(scope.id));
|
if (method === 'authenticate') {
|
||||||
return commandHandlers[authMethod.type][command](payload, scopeAttrs);
|
const payload = JSON.parse(request.requestBody);
|
||||||
|
const { command } = payload;
|
||||||
|
const scope = scopes.find(authMethod.scopeId);
|
||||||
|
const scopeAttrs = this.serialize(scopes.find(scope.id));
|
||||||
|
return commandHandlers[authMethod.type][command](payload, scopeAttrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: this handler doesn't really belong here, but we already route
|
||||||
|
// POST requests on existing auth methods to this route handler file under the
|
||||||
|
// assumption it would be for authentication. While authentication should
|
||||||
|
// still occur here, we should handle other custom methods in the
|
||||||
|
// mirage config and route here only for auth.
|
||||||
|
if (method === 'change-state') {
|
||||||
|
const attrs = this.normalizedRequestAttrs();
|
||||||
|
return authMethod.update({
|
||||||
|
attributes: {
|
||||||
|
state: attrs.attributes.state,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function deauthHandler() {
|
export function deauthHandler() {
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ export default function (server) {
|
|||||||
// Other resources
|
// Other resources
|
||||||
server.schema.scopes.where({ type: 'project' }).models.forEach((scope) => {
|
server.schema.scopes.where({ type: 'project' }).models.forEach((scope) => {
|
||||||
server.createList('host-catalog', 2, { scope }, 'withChildren');
|
server.createList('host-catalog', 2, { scope }, 'withChildren');
|
||||||
server.createList('target', 2, { scope }, 'withRandomHostSets');
|
|
||||||
server.createList('session', 4, { scope }, 'withAssociations');
|
server.createList('session', 4, { scope }, 'withAssociations');
|
||||||
|
server.createList('credential-store', 3, { scope }, 'withAssociations');
|
||||||
|
server.createList('target', 2, { scope }, 'withAssociations');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -53,13 +53,93 @@ export default function initializeMockIPC(server) {
|
|||||||
type,
|
type,
|
||||||
created_time: new Date().toISOString(),
|
created_time: new Date().toISOString(),
|
||||||
});
|
});
|
||||||
|
const decoded = {
|
||||||
|
key1: 'value 1',
|
||||||
|
key2: true,
|
||||||
|
key3: 'test',
|
||||||
|
};
|
||||||
|
const raw = btoa(JSON.stringify(decoded));
|
||||||
return {
|
return {
|
||||||
address: window.location.hostname,
|
address: window.location.hostname,
|
||||||
port: datatype.number(),
|
port: datatype.number(),
|
||||||
protocol: type,
|
protocol: type,
|
||||||
session_id: newSession.id,
|
session_id: newSession.id,
|
||||||
|
credentials: [
|
||||||
|
{
|
||||||
|
credential_library: {
|
||||||
|
id: 'clvlt_4cvscMTl0N',
|
||||||
|
name: 'Library Name',
|
||||||
|
description: 'Library Description',
|
||||||
|
credential_store_id: 'csvlt_Q1HFGt7Jpm',
|
||||||
|
type: 'vault',
|
||||||
|
},
|
||||||
|
secret: {
|
||||||
|
raw: btoa('just-a-random-string'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
credential_library: {
|
||||||
|
id: 'clvlt_4cvscMTl0N',
|
||||||
|
name: 'Library Name',
|
||||||
|
description: 'Library Description',
|
||||||
|
credential_store_id: 'csvlt_Q1HFGt7Jpm',
|
||||||
|
type: 'vault',
|
||||||
|
},
|
||||||
|
secret: {
|
||||||
|
raw,
|
||||||
|
decoded,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
credential_library: {
|
||||||
|
id: 'clvlt_9KWscxpcY7',
|
||||||
|
name: 'Library Name',
|
||||||
|
description: 'Library Description',
|
||||||
|
credential_store_id: 'csvlt_Q1HFGt7Jpm',
|
||||||
|
type: 'vault',
|
||||||
|
},
|
||||||
|
secret: {
|
||||||
|
raw: btoa('just-a-random-string'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
credential_library: {
|
||||||
|
id: 'clvlt_9KWscxpcY7',
|
||||||
|
name: 'Library Name',
|
||||||
|
description: 'Library Description',
|
||||||
|
credential_store_id: 'csvlt_Q1HFGt7Jpm',
|
||||||
|
type: 'vault',
|
||||||
|
},
|
||||||
|
secret: {
|
||||||
|
raw,
|
||||||
|
decoded,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check for browsers running on mac OS
|
||||||
|
*/
|
||||||
|
isMacOS() {
|
||||||
|
return Boolean(window.navigator.userAgent.match(/(macintosh)/i));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check for browsers running on windows OS
|
||||||
|
*/
|
||||||
|
isWindowsOS() {
|
||||||
|
return Boolean(window.navigator.userAgent.match(/(windows)/i));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do nothing when attempting to minimize, toggle fullscreen,
|
||||||
|
* and close a browser window
|
||||||
|
*/
|
||||||
|
minimizeWindow() {}
|
||||||
|
closeWindow() {}
|
||||||
|
toggleFullScreenWindow() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import ApplicationSerializer from './application';
|
||||||
|
|
||||||
|
export default ApplicationSerializer.extend({
|
||||||
|
modelName: 'credential-library',
|
||||||
|
|
||||||
|
_hashForModel(model) {
|
||||||
|
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
||||||
|
this,
|
||||||
|
arguments
|
||||||
|
);
|
||||||
|
json.credential_store_id = model.credentialStoreId;
|
||||||
|
return json;
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import ApplicationSerializer from './application';
|
||||||
|
|
||||||
|
export default ApplicationSerializer.extend({
|
||||||
|
modelName: 'credential-store',
|
||||||
|
|
||||||
|
_hashForModel(/* model */) {
|
||||||
|
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
||||||
|
this,
|
||||||
|
arguments
|
||||||
|
);
|
||||||
|
// in a real API, the following fields are set-only and returned in
|
||||||
|
// associated HMAC fields
|
||||||
|
delete json.attributes?.token;
|
||||||
|
delete json.attributes?.client_certificate_key;
|
||||||
|
return json;
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -23,6 +23,9 @@ export default ApplicationSerializer.extend({
|
|||||||
return { id: host_set_id, host_catalog_id };
|
return { id: host_set_id, host_catalog_id };
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (model.credentialLibraryIds?.length) {
|
||||||
|
json.application_credential_library_ids = model.credentialLibraryIds;
|
||||||
|
}
|
||||||
return json;
|
return json;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -28,21 +28,21 @@
|
|||||||
"ember-cli-htmlbars": "^5.3.1",
|
"ember-cli-htmlbars": "^5.3.1",
|
||||||
"ember-cli-mirage": "^1.1.8",
|
"ember-cli-mirage": "^1.1.8",
|
||||||
"ember-data": "^3.20.0",
|
"ember-data": "^3.20.0",
|
||||||
"ember-data-model-fragments": "5.0.0-beta.0",
|
"ember-data-model-fragments": "5.0.0-beta.2",
|
||||||
"ember-fetch": "^8.0.1"
|
"ember-fetch": "^8.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@ember/optional-features": "^2.0.0",
|
"@ember/optional-features": "^2.0.0",
|
||||||
"@ember/test-helpers": "^2.1.4",
|
"@ember/test-helpers": "^2.2.8",
|
||||||
"@glimmer/component": "^1.0.3",
|
"@glimmer/component": "^1.0.3",
|
||||||
"@glimmer/tracking": "^1.0.3",
|
"@glimmer/tracking": "^1.0.3",
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"broccoli-asset-rev": "^3.0.0",
|
"broccoli-asset-rev": "^3.0.0",
|
||||||
"doctoc": "^1.4.0",
|
"doctoc": "^2.0.0",
|
||||||
"ember-auto-import": "^1.10.1",
|
"ember-auto-import": "^1.10.1",
|
||||||
"ember-cli": "~3.24.0",
|
"ember-cli": "~3.27.0",
|
||||||
"ember-cli-dependency-checker": "^3.2.0",
|
"ember-cli-dependency-checker": "^3.2.0",
|
||||||
"ember-cli-inject-live-reload": "^2.0.2",
|
"ember-cli-inject-live-reload": "^2.1.0",
|
||||||
"ember-cli-sri": "^2.1.1",
|
"ember-cli-sri": "^2.1.1",
|
||||||
"ember-cli-terser": "^4.0.1",
|
"ember-cli-terser": "^4.0.1",
|
||||||
"ember-cli-update": "^0.54.6",
|
"ember-cli-update": "^0.54.6",
|
||||||
@@ -59,8 +59,8 @@
|
|||||||
"ember-source-channel-url": "^3.0.0",
|
"ember-source-channel-url": "^3.0.0",
|
||||||
"ember-template-lint": "^2.15.0",
|
"ember-template-lint": "^2.15.0",
|
||||||
"ember-try": "^1.4.0",
|
"ember-try": "^1.4.0",
|
||||||
"eslint": "^7.17.0",
|
"eslint": "^7.31.0",
|
||||||
"eslint-config-prettier": "^7.1.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-ember": "^10.1.1",
|
"eslint-plugin-ember": "^10.1.1",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-prettier": "^3.3.1",
|
"eslint-plugin-prettier": "^3.3.1",
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
"qunit-dom": "^1.6.0"
|
"qunit-dom": "^1.6.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "10.* || >= 12"
|
"node": ">=10 <=15"
|
||||||
},
|
},
|
||||||
"ember": {
|
"ember": {
|
||||||
"edition": "octane"
|
"edition": "octane"
|
||||||
|
|||||||
+35
@@ -0,0 +1,35 @@
|
|||||||
|
import Application from '@ember/application';
|
||||||
|
|
||||||
|
import { initialize } from 'dummy/initializers/fragment-auth-method-attributes-account-claim-map-serializer';
|
||||||
|
import { module, test } from 'qunit';
|
||||||
|
import Resolver from 'ember-resolver';
|
||||||
|
import { run } from '@ember/runloop';
|
||||||
|
|
||||||
|
module(
|
||||||
|
'Unit | Initializer | fragment-auth-method-attributes-account-claim-map-serializer',
|
||||||
|
function (hooks) {
|
||||||
|
hooks.beforeEach(function () {
|
||||||
|
this.TestApplication = class TestApplication extends Application {};
|
||||||
|
this.TestApplication.initializer({
|
||||||
|
name: 'initializer under test',
|
||||||
|
initialize,
|
||||||
|
});
|
||||||
|
|
||||||
|
this.application = this.TestApplication.create({
|
||||||
|
autoboot: false,
|
||||||
|
Resolver,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
hooks.afterEach(function () {
|
||||||
|
run(this.application, 'destroy');
|
||||||
|
});
|
||||||
|
|
||||||
|
// TODO: Replace this with your real tests.
|
||||||
|
test('it works', async function (assert) {
|
||||||
|
await this.application.boot();
|
||||||
|
|
||||||
|
assert.ok(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import Application from '@ember/application';
|
||||||
|
|
||||||
|
import { initialize } from 'dummy/initializers/fragment-string';
|
||||||
|
import { module, test } from 'qunit';
|
||||||
|
import Resolver from 'ember-resolver';
|
||||||
|
import { run } from '@ember/runloop';
|
||||||
|
|
||||||
|
module('Unit | Initializer | fragment-string', function (hooks) {
|
||||||
|
hooks.beforeEach(function () {
|
||||||
|
this.TestApplication = class TestApplication extends Application {};
|
||||||
|
this.TestApplication.initializer({
|
||||||
|
name: 'initializer under test',
|
||||||
|
initialize,
|
||||||
|
});
|
||||||
|
|
||||||
|
this.application = this.TestApplication.create({
|
||||||
|
autoboot: false,
|
||||||
|
Resolver,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
hooks.afterEach(function () {
|
||||||
|
run(this.application, 'destroy');
|
||||||
|
});
|
||||||
|
|
||||||
|
// TODO: Replace this with your real tests.
|
||||||
|
test('it works', async function (assert) {
|
||||||
|
await this.application.boot();
|
||||||
|
|
||||||
|
assert.ok(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -10,15 +10,14 @@ module('Unit | Model | account', function (hooks) {
|
|||||||
assert.ok(model);
|
assert.ok(model);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('it has an username attribute for password account', function (assert) {
|
test('it has an accountName attribute for password account', function (assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
const store = this.owner.lookup('service:store');
|
const store = this.owner.lookup('service:store');
|
||||||
let model = store.createRecord('account', {
|
let model = store.createRecord('account', {
|
||||||
name: 'name',
|
|
||||||
type: 'password',
|
type: 'password',
|
||||||
});
|
});
|
||||||
assert.notOk(model.username);
|
assert.notOk(model.accountName);
|
||||||
model.attributes.login_name = 'username';
|
model.attributes.login_name = 'foobar';
|
||||||
assert.equal(model.username, 'username');
|
assert.equal(model.accountName, 'foobar');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1,13 +1,49 @@
|
|||||||
import { module, test } from 'qunit';
|
import { module, test } from 'qunit';
|
||||||
import { setupTest } from 'ember-qunit';
|
import { setupTest } from 'ember-qunit';
|
||||||
|
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
|
||||||
|
|
||||||
module('Unit | Model | auth method', function (hooks) {
|
module('Unit | Model | auth method', function (hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
|
setupMirage(hooks);
|
||||||
|
|
||||||
// Replace this with your real tests.
|
|
||||||
test('it exists', function (assert) {
|
test('it exists', function (assert) {
|
||||||
let store = this.owner.lookup('service:store');
|
let store = this.owner.lookup('service:store');
|
||||||
let model = store.createRecord('auth-method', {});
|
let model = store.createRecord('auth-method', {});
|
||||||
assert.ok(model);
|
assert.ok(model);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('it has a `changeState` method that targets a specific POST API endpoint and serialization', async function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
this.server.post(
|
||||||
|
'/v1/auth-methods/123abc:change-state',
|
||||||
|
(schema, request) => {
|
||||||
|
const body = JSON.parse(request.requestBody);
|
||||||
|
assert.deepEqual(body, {
|
||||||
|
attributes: {
|
||||||
|
state: 'foobar',
|
||||||
|
},
|
||||||
|
version: 1,
|
||||||
|
});
|
||||||
|
return { id: '123abc' };
|
||||||
|
}
|
||||||
|
);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
store.push({
|
||||||
|
data: {
|
||||||
|
id: '123abc',
|
||||||
|
type: 'auth-method',
|
||||||
|
attributes: {
|
||||||
|
type: 'oidc',
|
||||||
|
state: 'foobar',
|
||||||
|
version: 1,
|
||||||
|
scope: {
|
||||||
|
scope_id: 'o_1',
|
||||||
|
type: 'scope',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const model = store.peekRecord('auth-method', '123abc');
|
||||||
|
await model.changeState('foobar');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
@@ -4,7 +4,6 @@ import { setupTest } from 'ember-qunit';
|
|||||||
module('Unit | Model | auth token', function (hooks) {
|
module('Unit | Model | auth token', function (hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
|
|
||||||
// Replace this with your real tests.
|
|
||||||
test('it exists', function (assert) {
|
test('it exists', function (assert) {
|
||||||
let store = this.owner.lookup('service:store');
|
let store = this.owner.lookup('service:store');
|
||||||
let model = store.createRecord('auth-token', {});
|
let model = store.createRecord('auth-token', {});
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { module, test } from 'qunit';
|
||||||
|
import { setupTest } from 'ember-qunit';
|
||||||
|
|
||||||
|
module('Unit | Model | credential library', function (hooks) {
|
||||||
|
setupTest(hooks);
|
||||||
|
|
||||||
|
// Replace this with your real tests.
|
||||||
|
test('it exists', function (assert) {
|
||||||
|
let store = this.owner.lookup('service:store');
|
||||||
|
let model = store.createRecord('credential-library', {});
|
||||||
|
assert.ok(model);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { module, test } from 'qunit';
|
||||||
|
import { setupTest } from 'ember-qunit';
|
||||||
|
|
||||||
|
module('Unit | Model | credential store', function (hooks) {
|
||||||
|
setupTest(hooks);
|
||||||
|
|
||||||
|
// Replace this with your real tests.
|
||||||
|
test('it exists', function (assert) {
|
||||||
|
let store = this.owner.lookup('service:store');
|
||||||
|
let model = store.createRecord('credential-store', {});
|
||||||
|
assert.ok(model);
|
||||||
|
});
|
||||||
|
});
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
import { module, test } from 'qunit';
|
||||||
|
import { setupTest } from 'ember-qunit';
|
||||||
|
|
||||||
|
module(
|
||||||
|
'Unit | Model | fragment auth method attributes account claim map',
|
||||||
|
function (hooks) {
|
||||||
|
setupTest(hooks);
|
||||||
|
|
||||||
|
test('it exists', function (assert) {
|
||||||
|
let store = this.owner.lookup('service:store');
|
||||||
|
let model = store.createRecord(
|
||||||
|
'fragment-auth-method-attributes-account-claim-map',
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
assert.ok(model);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { module, test } from 'qunit';
|
||||||
|
import { setupTest } from 'ember-qunit';
|
||||||
|
|
||||||
|
module('Unit | Model | fragment auth method attributes', function (hooks) {
|
||||||
|
setupTest(hooks);
|
||||||
|
|
||||||
|
test('it exists', function (assert) {
|
||||||
|
let store = this.owner.lookup('service:store');
|
||||||
|
let model = store.createRecord('fragment-auth-method-attributes', {});
|
||||||
|
assert.ok(model);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import { module, test } from 'qunit';
|
||||||
|
import { setupTest } from 'ember-qunit';
|
||||||
|
|
||||||
|
module(
|
||||||
|
'Unit | Model | fragment credential library attributes',
|
||||||
|
function (hooks) {
|
||||||
|
setupTest(hooks);
|
||||||
|
|
||||||
|
// Replace this with your real tests.
|
||||||
|
test('it exists', function (assert) {
|
||||||
|
let store = this.owner.lookup('service:store');
|
||||||
|
let model = store.createRecord(
|
||||||
|
'fragment-credential-library-attributes',
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
assert.ok(model);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { module, test } from 'qunit';
|
||||||
|
import { setupTest } from 'ember-qunit';
|
||||||
|
|
||||||
|
module('Unit | Model | fragment credential store attributes', function (hooks) {
|
||||||
|
setupTest(hooks);
|
||||||
|
|
||||||
|
// Replace this with your real tests.
|
||||||
|
test('it exists', function (assert) {
|
||||||
|
let store = this.owner.lookup('service:store');
|
||||||
|
let model = store.createRecord('fragment-credential-store-attributes', {});
|
||||||
|
assert.ok(model);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -4,7 +4,6 @@ import { setupTest } from 'ember-qunit';
|
|||||||
module('Unit | Model | fragment host set', function (hooks) {
|
module('Unit | Model | fragment host set', function (hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
|
|
||||||
// Replace this with your real tests.
|
|
||||||
test('it exists', function (assert) {
|
test('it exists', function (assert) {
|
||||||
let store = this.owner.lookup('service:store');
|
let store = this.owner.lookup('service:store');
|
||||||
let model = store.createRecord('fragment-host-set', {});
|
let model = store.createRecord('fragment-host-set', {});
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { setupTest } from 'ember-qunit';
|
|||||||
module('Unit | Model | fragment principal', function (hooks) {
|
module('Unit | Model | fragment principal', function (hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
|
|
||||||
// Replace this with your real tests.
|
|
||||||
test('it exists', function (assert) {
|
test('it exists', function (assert) {
|
||||||
let store = this.owner.lookup('service:store');
|
let store = this.owner.lookup('service:store');
|
||||||
let model = store.createRecord('fragment-principal', {});
|
let model = store.createRecord('fragment-principal', {});
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { setupTest } from 'ember-qunit';
|
|||||||
module('Unit | Model | fragment string', function (hooks) {
|
module('Unit | Model | fragment string', function (hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
|
|
||||||
// Replace this with your real tests.
|
|
||||||
test('it exists', function (assert) {
|
test('it exists', function (assert) {
|
||||||
let store = this.owner.lookup('service:store');
|
let store = this.owner.lookup('service:store');
|
||||||
let model = store.createRecord('fragment-string', {});
|
let model = store.createRecord('fragment-string', {});
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { setupTest } from 'ember-qunit';
|
|||||||
module('Unit | Model | host', function (hooks) {
|
module('Unit | Model | host', function (hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
|
|
||||||
// Replace this with your real tests.
|
|
||||||
test('it exists', function (assert) {
|
test('it exists', function (assert) {
|
||||||
let store = this.owner.lookup('service:store');
|
let store = this.owner.lookup('service:store');
|
||||||
let model = store.createRecord('host', {});
|
let model = store.createRecord('host', {});
|
||||||
|
|||||||
@@ -223,4 +223,162 @@ module('Unit | Model | target', function (hooks) {
|
|||||||
'Target has two associated sessions loaded in the store'
|
'Target has two associated sessions loaded in the store'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('it has a `credentialLibraries` array of resolved model instances (if those instances are already in the store)', function (assert) {
|
||||||
|
assert.expect(4);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
store.push({
|
||||||
|
data: {
|
||||||
|
id: '123abc',
|
||||||
|
type: 'target',
|
||||||
|
attributes: {
|
||||||
|
application_credential_library_ids: [{ value: '1' }, { value: '2' }],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const target = store.peekRecord('target', '123abc');
|
||||||
|
assert.equal(
|
||||||
|
target.application_credential_library_ids.length,
|
||||||
|
2,
|
||||||
|
'Target has two entires in application_credential_library_ids'
|
||||||
|
);
|
||||||
|
assert.equal(
|
||||||
|
target.credentialLibraries.length,
|
||||||
|
0,
|
||||||
|
'Target has no resolved credentialLibraries because they are not loaded yet'
|
||||||
|
);
|
||||||
|
store.push({
|
||||||
|
data: {
|
||||||
|
id: '1',
|
||||||
|
type: 'credential-library',
|
||||||
|
attributes: {},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
store.push({
|
||||||
|
data: {
|
||||||
|
id: '2',
|
||||||
|
type: 'credential-library',
|
||||||
|
attributes: {},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
// Since `credentialLibraries` is computed on `application_credential_library_ids`,
|
||||||
|
// not the store itself, it's necessary to do this assignment to kick-off the
|
||||||
|
// computed update.
|
||||||
|
/* eslint-disable no-self-assign */
|
||||||
|
target.application_credential_library_ids =
|
||||||
|
target.application_credential_library_ids;
|
||||||
|
/* eslint-enable no-self-assign */
|
||||||
|
assert.equal(
|
||||||
|
target.application_credential_library_ids.length,
|
||||||
|
2,
|
||||||
|
'Target has two entires in application_credential_library_ids'
|
||||||
|
);
|
||||||
|
assert.equal(
|
||||||
|
target.credentialLibraries.length,
|
||||||
|
2,
|
||||||
|
'Target has two resolved credentialLibraries'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it has an `addCredentialLibraries` method that targets a specific POST API endpoint and serialization', async function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
this.server.post(
|
||||||
|
'/v1/targets/123abc:add-credential-libraries',
|
||||||
|
(schema, request) => {
|
||||||
|
const body = JSON.parse(request.requestBody);
|
||||||
|
assert.deepEqual(body, {
|
||||||
|
application_credential_library_ids: ['123_abc', 'foobar'],
|
||||||
|
version: 1,
|
||||||
|
});
|
||||||
|
return { id: '123abc' };
|
||||||
|
}
|
||||||
|
);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
store.push({
|
||||||
|
data: {
|
||||||
|
id: '123abc',
|
||||||
|
type: 'target',
|
||||||
|
attributes: {
|
||||||
|
name: 'Target',
|
||||||
|
description: 'Description',
|
||||||
|
application_credential_library_ids: [{ value: '1' }, { value: '2' }],
|
||||||
|
version: 1,
|
||||||
|
scope: {
|
||||||
|
scope_id: 'o_1',
|
||||||
|
type: 'scope',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const model = store.peekRecord('target', '123abc');
|
||||||
|
await model.addCredentialLibraries(['123_abc', 'foobar']);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it has a `removeCredentialLibraries` method that targets a specific POST API endpoint and serialization', async function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
this.server.post(
|
||||||
|
'/v1/targets/123abc:remove-credential-libraries',
|
||||||
|
(schema, request) => {
|
||||||
|
const body = JSON.parse(request.requestBody);
|
||||||
|
assert.deepEqual(body, {
|
||||||
|
application_credential_library_ids: ['1', '2'],
|
||||||
|
version: 1,
|
||||||
|
});
|
||||||
|
return { id: '123abc' };
|
||||||
|
}
|
||||||
|
);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
store.push({
|
||||||
|
data: {
|
||||||
|
id: '123abc',
|
||||||
|
type: 'target',
|
||||||
|
attributes: {
|
||||||
|
name: 'Target',
|
||||||
|
description: 'Description',
|
||||||
|
application_credential_library_ids: [{ value: '1' }, { value: '2' }],
|
||||||
|
version: 1,
|
||||||
|
scope: {
|
||||||
|
scope_id: 'o_1',
|
||||||
|
type: 'scope',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const model = store.peekRecord('target', '123abc');
|
||||||
|
await model.removeCredentialLibraries(['1', '2']);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it has a `removeCredentialLibrary` method that deletes a single credential library using `removeCredentialLibraries` method', async function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
this.server.post(
|
||||||
|
'/v1/targets/123abc:remove-credential-libraries',
|
||||||
|
(schema, request) => {
|
||||||
|
const body = JSON.parse(request.requestBody);
|
||||||
|
assert.deepEqual(body, {
|
||||||
|
application_credential_library_ids: ['2'],
|
||||||
|
version: 1,
|
||||||
|
});
|
||||||
|
return { id: '123abc' };
|
||||||
|
}
|
||||||
|
);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
store.push({
|
||||||
|
data: {
|
||||||
|
id: '123abc',
|
||||||
|
type: 'target',
|
||||||
|
attributes: {
|
||||||
|
name: 'Target',
|
||||||
|
description: 'Description',
|
||||||
|
application_credential_library_ids: [{ value: '1' }, { value: '2' }],
|
||||||
|
version: 1,
|
||||||
|
scope: {
|
||||||
|
scope_id: 'o_1',
|
||||||
|
type: 'scope',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const model = store.peekRecord('target', '123abc');
|
||||||
|
await model.removeCredentialLibrary('2');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
@@ -4,7 +4,75 @@ import { setupTest } from 'ember-qunit';
|
|||||||
module('Unit | Serializer | account', function (hooks) {
|
module('Unit | Serializer | account', function (hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
|
|
||||||
test('it serializes normally', function (assert) {
|
test('it serializes OIDC-type with only issuer and subject in `attributes` on create', function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
const serializer = store.serializerFor('account');
|
||||||
|
const record = store.createRecord('account', {
|
||||||
|
type: 'oidc',
|
||||||
|
name: 'Name',
|
||||||
|
auth_method_id: '1',
|
||||||
|
description: 'Description',
|
||||||
|
attributes: {
|
||||||
|
issuer: 'issuer',
|
||||||
|
subject: 'sub',
|
||||||
|
full_name: 'full_name',
|
||||||
|
email: 'email',
|
||||||
|
},
|
||||||
|
version: 1,
|
||||||
|
});
|
||||||
|
const snapshot = record._createSnapshot();
|
||||||
|
const serializedRecord = serializer.serialize(snapshot);
|
||||||
|
assert.deepEqual(serializedRecord, {
|
||||||
|
type: 'oidc',
|
||||||
|
name: 'Name',
|
||||||
|
auth_method_id: '1',
|
||||||
|
description: 'Description',
|
||||||
|
version: 1,
|
||||||
|
attributes: {
|
||||||
|
issuer: 'issuer',
|
||||||
|
subject: 'sub',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it serializes OIDC-type without `attributes` on update', function (assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
const serializer = store.serializerFor('account');
|
||||||
|
store.push({
|
||||||
|
data: {
|
||||||
|
id: '1',
|
||||||
|
type: 'account',
|
||||||
|
attributes: {
|
||||||
|
type: 'oidc',
|
||||||
|
name: 'Name',
|
||||||
|
auth_method_id: '1',
|
||||||
|
description: 'Description',
|
||||||
|
attributes: {
|
||||||
|
issuer: 'issuer',
|
||||||
|
subject: 'sub',
|
||||||
|
full_name: 'full_name',
|
||||||
|
email: 'email',
|
||||||
|
},
|
||||||
|
version: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const record = store.peekRecord('account', '1');
|
||||||
|
const snapshot = record._createSnapshot();
|
||||||
|
const serializedRecord = serializer.serialize(snapshot);
|
||||||
|
assert.notOk(serializedRecord.attributes);
|
||||||
|
assert.deepEqual(serializedRecord, {
|
||||||
|
type: 'oidc',
|
||||||
|
name: 'Name',
|
||||||
|
auth_method_id: '1',
|
||||||
|
description: 'Description',
|
||||||
|
version: 1,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it serializes password-type normally', function (assert) {
|
||||||
assert.expect(1);
|
assert.expect(1);
|
||||||
const store = this.owner.lookup('service:store');
|
const store = this.owner.lookup('service:store');
|
||||||
const serializer = store.serializerFor('account');
|
const serializer = store.serializerFor('account');
|
||||||
@@ -19,7 +87,6 @@ module('Unit | Serializer | account', function (hooks) {
|
|||||||
version: 1,
|
version: 1,
|
||||||
});
|
});
|
||||||
const snapshot = record._createSnapshot();
|
const snapshot = record._createSnapshot();
|
||||||
snapshot.adapterOptions = {};
|
|
||||||
const serializedRecord = serializer.serialize(snapshot);
|
const serializedRecord = serializer.serialize(snapshot);
|
||||||
assert.deepEqual(serializedRecord, {
|
assert.deepEqual(serializedRecord, {
|
||||||
type: 'password',
|
type: 'password',
|
||||||
|
|||||||
@@ -203,6 +203,7 @@ module('Unit | Serializer | application', function (hooks) {
|
|||||||
name: 'Target 1',
|
name: 'Target 1',
|
||||||
scope: { scope_id: 'o_123' },
|
scope: { scope_id: 'o_123' },
|
||||||
host_sets: [],
|
host_sets: [],
|
||||||
|
application_credential_library_ids: [],
|
||||||
},
|
},
|
||||||
relationships: {},
|
relationships: {},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { module, test } from 'qunit';
|
import { module, test } from 'qunit';
|
||||||
import { setupTest } from 'ember-qunit';
|
import { setupTest } from 'ember-qunit';
|
||||||
|
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
|
||||||
|
|
||||||
module('Unit | Serializer | auth method', function (hooks) {
|
module('Unit | Serializer | auth method', function (hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
|
setupMirage(hooks);
|
||||||
|
|
||||||
// Replace this with your real tests.
|
|
||||||
test('it exists', function (assert) {
|
test('it exists', function (assert) {
|
||||||
let store = this.owner.lookup('service:store');
|
let store = this.owner.lookup('service:store');
|
||||||
let serializer = store.serializerFor('auth-method');
|
let serializer = store.serializerFor('auth-method');
|
||||||
@@ -12,13 +13,94 @@ module('Unit | Serializer | auth method', function (hooks) {
|
|||||||
assert.ok(serializer);
|
assert.ok(serializer);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('it serializes records', function (assert) {
|
test('it serializes password records', function (assert) {
|
||||||
|
assert.expect(2);
|
||||||
let store = this.owner.lookup('service:store');
|
let store = this.owner.lookup('service:store');
|
||||||
let record = store.createRecord('auth-method', {});
|
let record = store.createRecord('auth-method', { type: 'password' });
|
||||||
|
|
||||||
let serializedRecord = record.serialize();
|
let serializedRecord = record.serialize();
|
||||||
|
|
||||||
assert.ok(serializedRecord);
|
assert.ok(serializedRecord);
|
||||||
|
assert.notOk(
|
||||||
|
serializedRecord.attributes,
|
||||||
|
'Password should not have attributes'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it serializes OIDC records without state', function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
let store = this.owner.lookup('service:store');
|
||||||
|
let record = store.createRecord('auth-method', {
|
||||||
|
type: 'oidc',
|
||||||
|
name: 'OIDC Auth Method',
|
||||||
|
attributes: {
|
||||||
|
state: 'foo',
|
||||||
|
account_claim_maps: [{ from: 'foo', to: 'bar' }],
|
||||||
|
claims_scopes: [{ value: 'profile' }, { value: 'email' }],
|
||||||
|
signing_algorithms: [{ value: 'RS256' }, { value: 'RS384' }],
|
||||||
|
allowed_audiences: [
|
||||||
|
{ value: 'www.alice.com' },
|
||||||
|
{ value: 'www.alice.com/admin' },
|
||||||
|
],
|
||||||
|
idp_ca_certs: [
|
||||||
|
{ value: 'certificate-1234' },
|
||||||
|
{ value: 'certificate-5678' },
|
||||||
|
],
|
||||||
|
api_url_prefix: 'protocol://host:port/foo',
|
||||||
|
client_id: 'id123',
|
||||||
|
client_secret: 'secret456',
|
||||||
|
disable_discovered_config_validation: true,
|
||||||
|
dry_run: true,
|
||||||
|
issuer: 'http://www.example.net',
|
||||||
|
max_age: 500,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
let serializedRecord = record.serialize();
|
||||||
|
|
||||||
|
assert.deepEqual(serializedRecord, {
|
||||||
|
type: 'oidc',
|
||||||
|
name: 'OIDC Auth Method',
|
||||||
|
description: null,
|
||||||
|
attributes: {
|
||||||
|
account_claim_maps: ['foo=bar'],
|
||||||
|
claims_scopes: ['profile', 'email'],
|
||||||
|
signing_algorithms: ['RS256', 'RS384'],
|
||||||
|
allowed_audiences: ['www.alice.com', 'www.alice.com/admin'],
|
||||||
|
idp_ca_certs: ['certificate-1234', 'certificate-5678'],
|
||||||
|
api_url_prefix: 'protocol://host:port/foo',
|
||||||
|
client_id: 'id123',
|
||||||
|
client_secret: 'secret456',
|
||||||
|
disable_discovered_config_validation: true,
|
||||||
|
dry_run: true,
|
||||||
|
issuer: 'http://www.example.net',
|
||||||
|
max_age: 500,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it serializes OIDC records with only state and version when `adapterOptions.state` is passed', function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
const serializer = store.serializerFor('auth-method');
|
||||||
|
const record = store.createRecord('auth-method', {
|
||||||
|
type: 'oidc',
|
||||||
|
attributes: {
|
||||||
|
state: 'foo',
|
||||||
|
},
|
||||||
|
version: 1,
|
||||||
|
});
|
||||||
|
const snapshot = record._createSnapshot();
|
||||||
|
snapshot.adapterOptions = {
|
||||||
|
state: 'bar',
|
||||||
|
};
|
||||||
|
const serializedRecord = serializer.serialize(snapshot);
|
||||||
|
assert.deepEqual(serializedRecord, {
|
||||||
|
attributes: {
|
||||||
|
state: 'bar',
|
||||||
|
},
|
||||||
|
version: 1,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('it sorts primary first in normalizeArrayResponse', function (assert) {
|
test('it sorts primary first in normalizeArrayResponse', function (assert) {
|
||||||
@@ -63,4 +145,22 @@ module('Unit | Serializer | auth method', function (hooks) {
|
|||||||
'First normalized item is primary'
|
'First normalized item is primary'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('it normalizes OIDC records', async function (assert) {
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
this.server.get('/v1/auth-methods/oidc123', () => ({
|
||||||
|
attributes: {
|
||||||
|
account_claim_maps: ['from=to', 'foo=bar'],
|
||||||
|
},
|
||||||
|
version: 1,
|
||||||
|
type: 'oidc',
|
||||||
|
id: 'oidc123',
|
||||||
|
}));
|
||||||
|
const record = await store.findRecord('auth-method', 'oidc123');
|
||||||
|
const { account_claim_maps } = record.attributes;
|
||||||
|
assert.equal(account_claim_maps.firstObject.from, 'from');
|
||||||
|
assert.equal(account_claim_maps.firstObject.to, 'to');
|
||||||
|
assert.equal(account_claim_maps.lastObject.from, 'foo');
|
||||||
|
assert.equal(account_claim_maps.lastObject.to, 'bar');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
import { module, test } from 'qunit';
|
||||||
|
import { setupTest } from 'ember-qunit';
|
||||||
|
|
||||||
|
module('Unit | Serializer | credential library', function (hooks) {
|
||||||
|
setupTest(hooks);
|
||||||
|
|
||||||
|
test('it serializes correctly on create', function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
const serializer = store.serializerFor('credential-library');
|
||||||
|
const record = store.createRecord('credential-library', {
|
||||||
|
type: 'vault',
|
||||||
|
name: 'Name',
|
||||||
|
description: 'Description',
|
||||||
|
attributes: {
|
||||||
|
path: '/vault/path',
|
||||||
|
http_method: 'GET',
|
||||||
|
},
|
||||||
|
version: 1,
|
||||||
|
});
|
||||||
|
const snapshot = record._createSnapshot();
|
||||||
|
const serializedRecord = serializer.serialize(snapshot);
|
||||||
|
assert.deepEqual(serializedRecord, {
|
||||||
|
type: 'vault',
|
||||||
|
credential_store_id: null,
|
||||||
|
name: 'Name',
|
||||||
|
description: 'Description',
|
||||||
|
version: 1,
|
||||||
|
attributes: {
|
||||||
|
path: '/vault/path',
|
||||||
|
http_method: 'GET',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it serializes correctly on update', function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
const serializer = store.serializerFor('credential-library');
|
||||||
|
store.push({
|
||||||
|
data: {
|
||||||
|
id: '1',
|
||||||
|
type: 'credential-library',
|
||||||
|
attributes: {
|
||||||
|
type: 'vault',
|
||||||
|
name: 'Name',
|
||||||
|
description: 'Description',
|
||||||
|
attributes: {
|
||||||
|
path: '/vault/path',
|
||||||
|
http_method: 'GET',
|
||||||
|
},
|
||||||
|
version: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const record = store.peekRecord('credential-library', '1');
|
||||||
|
const snapshot = record._createSnapshot();
|
||||||
|
const serializedRecord = serializer.serialize(snapshot);
|
||||||
|
assert.deepEqual(serializedRecord, {
|
||||||
|
type: 'vault',
|
||||||
|
credential_store_id: null,
|
||||||
|
name: 'Name',
|
||||||
|
description: 'Description',
|
||||||
|
attributes: {
|
||||||
|
path: '/vault/path',
|
||||||
|
http_method: 'GET',
|
||||||
|
},
|
||||||
|
version: 1,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
import { module, test } from 'qunit';
|
||||||
|
import { setupTest } from 'ember-qunit';
|
||||||
|
|
||||||
|
module('Unit | Serializer | credential store', function (hooks) {
|
||||||
|
setupTest(hooks);
|
||||||
|
|
||||||
|
test('it serializes vault-type correctly on create', function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
const serializer = store.serializerFor('credential-store');
|
||||||
|
const record = store.createRecord('credential-store', {
|
||||||
|
type: 'vault',
|
||||||
|
name: 'Name',
|
||||||
|
description: 'Description',
|
||||||
|
attributes: {
|
||||||
|
address: 'http://localhost:5000',
|
||||||
|
ca_cert: 'ca-cert-123',
|
||||||
|
client_certificate: 'client-cert-123',
|
||||||
|
client_certificate_key: 'client-cert-key-456',
|
||||||
|
namespace: 'foobar',
|
||||||
|
tls_server_name: 'yes',
|
||||||
|
tls_skip_verify: false,
|
||||||
|
token: 'foo',
|
||||||
|
},
|
||||||
|
version: 1,
|
||||||
|
});
|
||||||
|
const snapshot = record._createSnapshot();
|
||||||
|
const serializedRecord = serializer.serialize(snapshot);
|
||||||
|
assert.deepEqual(serializedRecord, {
|
||||||
|
type: 'vault',
|
||||||
|
name: 'Name',
|
||||||
|
description: 'Description',
|
||||||
|
version: 1,
|
||||||
|
attributes: {
|
||||||
|
address: 'http://localhost:5000',
|
||||||
|
ca_cert: 'ca-cert-123',
|
||||||
|
client_certificate: 'client-cert-123',
|
||||||
|
client_certificate_key: 'client-cert-key-456',
|
||||||
|
namespace: 'foobar',
|
||||||
|
tls_server_name: 'yes',
|
||||||
|
tls_skip_verify: false,
|
||||||
|
token: 'foo',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it serializes vault-type correctly on update', function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
const serializer = store.serializerFor('credential-store');
|
||||||
|
store.push({
|
||||||
|
data: {
|
||||||
|
id: '1',
|
||||||
|
type: 'credential-store',
|
||||||
|
attributes: {
|
||||||
|
type: 'vault',
|
||||||
|
name: 'Name',
|
||||||
|
description: 'Description',
|
||||||
|
attributes: {
|
||||||
|
address: 'http://localhost:5000',
|
||||||
|
ca_cert: 'ca-cert-123',
|
||||||
|
client_certificate: 'client-cert-123',
|
||||||
|
client_certificate_key: 'client-cert-key-456',
|
||||||
|
namespace: 'foobar',
|
||||||
|
tls_server_name: 'yes',
|
||||||
|
tls_skip_verify: false,
|
||||||
|
token: 'foo',
|
||||||
|
},
|
||||||
|
version: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const record = store.peekRecord('credential-store', '1');
|
||||||
|
const snapshot = record._createSnapshot();
|
||||||
|
const serializedRecord = serializer.serialize(snapshot);
|
||||||
|
assert.deepEqual(serializedRecord, {
|
||||||
|
type: 'vault',
|
||||||
|
name: 'Name',
|
||||||
|
description: 'Description',
|
||||||
|
attributes: {
|
||||||
|
address: 'http://localhost:5000',
|
||||||
|
ca_cert: 'ca-cert-123',
|
||||||
|
client_certificate: 'client-cert-123',
|
||||||
|
client_certificate_key: 'client-cert-key-456',
|
||||||
|
namespace: 'foobar',
|
||||||
|
tls_server_name: 'yes',
|
||||||
|
tls_skip_verify: false,
|
||||||
|
token: 'foo',
|
||||||
|
},
|
||||||
|
version: 1,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { module, test } from 'qunit';
|
||||||
|
import { setupTest } from 'ember-qunit';
|
||||||
|
|
||||||
|
module('Unit | Serializer | fragment account attributes', function (hooks) {
|
||||||
|
setupTest(hooks);
|
||||||
|
|
||||||
|
// Replace this with your real tests.
|
||||||
|
test('it exists', function (assert) {
|
||||||
|
let store = this.owner.lookup('service:store');
|
||||||
|
let serializer = store.serializerFor('fragment-account-attributes');
|
||||||
|
|
||||||
|
assert.ok(serializer);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it serializes records', function (assert) {
|
||||||
|
let store = this.owner.lookup('service:store');
|
||||||
|
let record = store.createRecord('fragment-account-attributes', {});
|
||||||
|
|
||||||
|
let serializedRecord = record.serialize();
|
||||||
|
|
||||||
|
assert.ok(serializedRecord);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
import { module, test } from 'qunit';
|
||||||
|
import { setupTest } from 'ember-qunit';
|
||||||
|
|
||||||
|
module('Unit | Serializer | fragment auth method attributes', function (hooks) {
|
||||||
|
setupTest(hooks);
|
||||||
|
|
||||||
|
test('it serializes empty strings to null', function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
const record = store.createRecord('user', {
|
||||||
|
name: '',
|
||||||
|
description: '',
|
||||||
|
version: null,
|
||||||
|
});
|
||||||
|
let serializedRecord = record.serialize();
|
||||||
|
assert.deepEqual(serializedRecord, {
|
||||||
|
name: null,
|
||||||
|
description: null,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it does not serialize client_secret if present but falsy', function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
const record = store.createRecord('user', {
|
||||||
|
name: '',
|
||||||
|
description: '',
|
||||||
|
version: null,
|
||||||
|
client_secret: false,
|
||||||
|
});
|
||||||
|
let serializedRecord = record.serialize();
|
||||||
|
assert.deepEqual(serializedRecord, {
|
||||||
|
name: null,
|
||||||
|
description: null,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
import { module, test } from 'qunit';
|
||||||
|
import { setupTest } from 'ember-qunit';
|
||||||
|
|
||||||
|
module(
|
||||||
|
'Unit | Serializer | fragment credential library attributes',
|
||||||
|
function (hooks) {
|
||||||
|
setupTest(hooks);
|
||||||
|
|
||||||
|
test('it serializes empty strings to null', function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
const record = store.createRecord(
|
||||||
|
'fragment-credential-library-attributes',
|
||||||
|
{
|
||||||
|
http_method: '',
|
||||||
|
path: null,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
let serializedRecord = record.serialize();
|
||||||
|
assert.deepEqual(serializedRecord, {
|
||||||
|
http_method: null,
|
||||||
|
path: null,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it does not serialize http_request_body unless http_method is set to POST', function (assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
const record = store.createRecord(
|
||||||
|
'fragment-credential-library-attributes',
|
||||||
|
{
|
||||||
|
http_method: 'GET',
|
||||||
|
http_request_body: 'body',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
let serializedRecord = record.serialize();
|
||||||
|
assert.deepEqual(
|
||||||
|
serializedRecord,
|
||||||
|
{
|
||||||
|
http_method: 'GET',
|
||||||
|
path: null,
|
||||||
|
},
|
||||||
|
'http_request_body attribute is not expected'
|
||||||
|
);
|
||||||
|
|
||||||
|
record.http_method = 'POST';
|
||||||
|
serializedRecord = record.serialize();
|
||||||
|
assert.deepEqual(
|
||||||
|
serializedRecord,
|
||||||
|
{
|
||||||
|
http_method: 'POST',
|
||||||
|
http_request_body: 'body',
|
||||||
|
path: null,
|
||||||
|
},
|
||||||
|
'http_request_body attribute is expected'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
import { module, test } from 'qunit';
|
||||||
|
import { setupTest } from 'ember-qunit';
|
||||||
|
|
||||||
|
module(
|
||||||
|
'Unit | Serializer | fragment credential store attributes',
|
||||||
|
function (hooks) {
|
||||||
|
setupTest(hooks);
|
||||||
|
|
||||||
|
test('it serializes empty strings to null', function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
const record = store.createRecord(
|
||||||
|
'fragment-credential-store-attributes',
|
||||||
|
{
|
||||||
|
address: '',
|
||||||
|
ca_cert: '',
|
||||||
|
client_certificate: '',
|
||||||
|
client_certificate_key: '',
|
||||||
|
namespace: '',
|
||||||
|
tls_server_name: '',
|
||||||
|
tls_skip_verify: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
let serializedRecord = record.serialize();
|
||||||
|
assert.deepEqual(serializedRecord, {
|
||||||
|
address: null,
|
||||||
|
ca_cert: null,
|
||||||
|
client_certificate: null,
|
||||||
|
client_certificate_key: null,
|
||||||
|
namespace: null,
|
||||||
|
tls_server_name: null,
|
||||||
|
tls_skip_verify: false,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it does not serialize token if present but falsy', function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
const record = store.createRecord(
|
||||||
|
'fragment-credential-store-attributes',
|
||||||
|
{
|
||||||
|
token: null,
|
||||||
|
address: 'http://localhost:5000',
|
||||||
|
ca_cert: 'ca-cert-123',
|
||||||
|
client_certificate: 'client-cert-123',
|
||||||
|
client_certificate_key: 'client-cert-key-456',
|
||||||
|
namespace: 'foobar',
|
||||||
|
tls_server_name: 'yes',
|
||||||
|
tls_skip_verify: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
let serializedRecord = record.serialize();
|
||||||
|
assert.deepEqual(
|
||||||
|
serializedRecord,
|
||||||
|
{
|
||||||
|
address: 'http://localhost:5000',
|
||||||
|
ca_cert: 'ca-cert-123',
|
||||||
|
client_certificate: 'client-cert-123',
|
||||||
|
client_certificate_key: 'client-cert-key-456',
|
||||||
|
namespace: 'foobar',
|
||||||
|
tls_server_name: 'yes',
|
||||||
|
tls_skip_verify: false,
|
||||||
|
},
|
||||||
|
'token attribute is not expected'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it does not serialize client certificate key if present but falsy when client certificate is present', function (assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
const record = store.createRecord(
|
||||||
|
'fragment-credential-store-attributes',
|
||||||
|
{
|
||||||
|
client_certificate: 'client-cert-123',
|
||||||
|
client_certificate_key: '',
|
||||||
|
address: 'http://localhost:5000',
|
||||||
|
token: 'foo',
|
||||||
|
ca_cert: 'ca-cert-123',
|
||||||
|
namespace: 'foobar',
|
||||||
|
tls_server_name: 'yes',
|
||||||
|
tls_skip_verify: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
let serializedRecord = record.serialize();
|
||||||
|
assert.deepEqual(
|
||||||
|
serializedRecord,
|
||||||
|
{
|
||||||
|
client_certificate: 'client-cert-123',
|
||||||
|
address: 'http://localhost:5000',
|
||||||
|
token: 'foo',
|
||||||
|
ca_cert: 'ca-cert-123',
|
||||||
|
namespace: 'foobar',
|
||||||
|
tls_server_name: 'yes',
|
||||||
|
tls_skip_verify: false,
|
||||||
|
},
|
||||||
|
'client certificate key attribute is not expected'
|
||||||
|
);
|
||||||
|
|
||||||
|
record.client_certificate_key = 'client-cert-key-456';
|
||||||
|
serializedRecord = record.serialize();
|
||||||
|
assert.deepEqual(
|
||||||
|
serializedRecord,
|
||||||
|
{
|
||||||
|
client_certificate: 'client-cert-123',
|
||||||
|
client_certificate_key: 'client-cert-key-456',
|
||||||
|
address: 'http://localhost:5000',
|
||||||
|
token: 'foo',
|
||||||
|
ca_cert: 'ca-cert-123',
|
||||||
|
namespace: 'foobar',
|
||||||
|
tls_server_name: 'yes',
|
||||||
|
tls_skip_verify: false,
|
||||||
|
},
|
||||||
|
'client certificate key attribute is expected'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import { module, test } from 'qunit';
|
||||||
|
import { setupTest } from 'ember-qunit';
|
||||||
|
|
||||||
|
module('Unit | Serializer | fragment string', function (hooks) {
|
||||||
|
setupTest(hooks);
|
||||||
|
|
||||||
|
// Replace this with your real tests.
|
||||||
|
test('it exists', function (assert) {
|
||||||
|
let store = this.owner.lookup('service:store');
|
||||||
|
let serializer = store.serializerFor('fragment-string');
|
||||||
|
|
||||||
|
assert.ok(serializer);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it serializes records', function (assert) {
|
||||||
|
let store = this.owner.lookup('service:store');
|
||||||
|
let record = store.createRecord('fragment-string', {
|
||||||
|
value: 'string value',
|
||||||
|
});
|
||||||
|
|
||||||
|
let serializedRecord = record.serialize();
|
||||||
|
|
||||||
|
assert.equal(serializedRecord, 'string value');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it normalizes records', function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
const serializer = store.serializerFor('fragment-string');
|
||||||
|
const modelClass = store.createRecord('fragment-string').constructor;
|
||||||
|
const payload = 'string value';
|
||||||
|
const normalized = serializer.normalizeSingleResponse(
|
||||||
|
store,
|
||||||
|
modelClass,
|
||||||
|
payload
|
||||||
|
);
|
||||||
|
assert.deepEqual(normalized, {
|
||||||
|
included: [],
|
||||||
|
data: {
|
||||||
|
id: null,
|
||||||
|
type: 'fragment-string',
|
||||||
|
attributes: {
|
||||||
|
value: 'string value',
|
||||||
|
},
|
||||||
|
relationships: {},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -4,7 +4,6 @@ import { setupTest } from 'ember-qunit';
|
|||||||
module('Unit | Serializer | host', function (hooks) {
|
module('Unit | Serializer | host', function (hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
|
|
||||||
// Replace this with your real tests.
|
|
||||||
test('it exists', function (assert) {
|
test('it exists', function (assert) {
|
||||||
let store = this.owner.lookup('service:store');
|
let store = this.owner.lookup('service:store');
|
||||||
let serializer = store.serializerFor('host');
|
let serializer = store.serializerFor('host');
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { setupTest } from 'ember-qunit';
|
|||||||
module('Unit | Serializer | session', function (hooks) {
|
module('Unit | Serializer | session', function (hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
|
|
||||||
// Replace this with your real tests.
|
|
||||||
test('it exists', function (assert) {
|
test('it exists', function (assert) {
|
||||||
let store = this.owner.lookup('service:store');
|
let store = this.owner.lookup('service:store');
|
||||||
let serializer = store.serializerFor('session');
|
let serializer = store.serializerFor('session');
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { setupTest } from 'ember-qunit';
|
|||||||
module('Unit | Serializer | target', function (hooks) {
|
module('Unit | Serializer | target', function (hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
|
|
||||||
test('it serializes targets normally, without host sets', function (assert) {
|
test('it serializes targets normally, without host sets or credential libraries', function (assert) {
|
||||||
assert.expect(1);
|
assert.expect(1);
|
||||||
const store = this.owner.lookup('service:store');
|
const store = this.owner.lookup('service:store');
|
||||||
const serializer = store.serializerFor('target');
|
const serializer = store.serializerFor('target');
|
||||||
@@ -15,6 +15,7 @@ module('Unit | Serializer | target', function (hooks) {
|
|||||||
{ host_set_id: '1', host_catalog_id: '2' },
|
{ host_set_id: '1', host_catalog_id: '2' },
|
||||||
{ host_set_id: '3', host_catalog_id: '4' },
|
{ host_set_id: '3', host_catalog_id: '4' },
|
||||||
],
|
],
|
||||||
|
application_credential_library_ids: [{ value: '1' }, { value: '2' }],
|
||||||
scope: {
|
scope: {
|
||||||
scope_id: 'org_1',
|
scope_id: 'org_1',
|
||||||
type: 'org',
|
type: 'org',
|
||||||
@@ -63,6 +64,27 @@ module('Unit | Serializer | target', function (hooks) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('it serializes only credential libraries and version when an `adapterOptions.credentialLibraryIDs` array is passed', function (assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
const store = this.owner.lookup('service:store');
|
||||||
|
const serializer = store.serializerFor('target');
|
||||||
|
const record = store.createRecord('target', {
|
||||||
|
name: 'User',
|
||||||
|
description: 'Description',
|
||||||
|
application_credential_library_ids: [{ value: '1' }, { value: '2' }],
|
||||||
|
version: 1,
|
||||||
|
});
|
||||||
|
const snapshot = record._createSnapshot();
|
||||||
|
snapshot.adapterOptions = {
|
||||||
|
credentialLibraryIDs: ['4', '5'],
|
||||||
|
};
|
||||||
|
const serializedRecord = serializer.serialize(snapshot);
|
||||||
|
assert.deepEqual(serializedRecord, {
|
||||||
|
application_credential_library_ids: ['4', '5'],
|
||||||
|
version: 1,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
test('it normalizes records with array fields', function (assert) {
|
test('it normalizes records with array fields', function (assert) {
|
||||||
assert.expect(1);
|
assert.expect(1);
|
||||||
const store = this.owner.lookup('service:store');
|
const store = this.owner.lookup('service:store');
|
||||||
@@ -75,6 +97,7 @@ module('Unit | Serializer | target', function (hooks) {
|
|||||||
{ host_set_id: '1', host_catalog_id: '2' },
|
{ host_set_id: '1', host_catalog_id: '2' },
|
||||||
{ host_set_id: '3', host_catalog_id: '4' },
|
{ host_set_id: '3', host_catalog_id: '4' },
|
||||||
],
|
],
|
||||||
|
application_credential_library_ids: ['1'],
|
||||||
};
|
};
|
||||||
const normalized = serializer.normalizeSingleResponse(
|
const normalized = serializer.normalizeSingleResponse(
|
||||||
store,
|
store,
|
||||||
@@ -92,13 +115,14 @@ module('Unit | Serializer | target', function (hooks) {
|
|||||||
{ host_set_id: '1', host_catalog_id: '2' },
|
{ host_set_id: '1', host_catalog_id: '2' },
|
||||||
{ host_set_id: '3', host_catalog_id: '4' },
|
{ host_set_id: '3', host_catalog_id: '4' },
|
||||||
],
|
],
|
||||||
|
application_credential_library_ids: [{ value: '1' }],
|
||||||
},
|
},
|
||||||
relationships: {},
|
relationships: {},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('it normalizes missing host_sets to empty array', function (assert) {
|
test('it normalizes missing host_sets and credential libraries to empty array', function (assert) {
|
||||||
assert.expect(1);
|
assert.expect(1);
|
||||||
const store = this.owner.lookup('service:store');
|
const store = this.owner.lookup('service:store');
|
||||||
const serializer = store.serializerFor('target');
|
const serializer = store.serializerFor('target');
|
||||||
@@ -122,6 +146,7 @@ module('Unit | Serializer | target', function (hooks) {
|
|||||||
name: 'Target 1',
|
name: 'Target 1',
|
||||||
scope: { scope_id: 'o_123' },
|
scope: { scope_id: 'o_123' },
|
||||||
host_sets: [],
|
host_sets: [],
|
||||||
|
application_credential_library_ids: [],
|
||||||
},
|
},
|
||||||
relationships: {},
|
relationships: {},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -72,10 +72,9 @@ export default class BaseAuthenticator extends SimpleAuthBaseAuthenticator {
|
|||||||
*/
|
*/
|
||||||
async restore(data) {
|
async restore(data) {
|
||||||
if (!data) return reject();
|
if (!data) return reject();
|
||||||
return this.validateToken(
|
return this.validateToken(data.attributes.token, data.attributes.id).then(
|
||||||
data.attributes.token,
|
() => this.normalizeData(data)
|
||||||
data.attributes.id
|
);
|
||||||
).then(() => this.normalizeData(data));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -27,17 +27,17 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@ember/optional-features": "^2.0.0",
|
"@ember/optional-features": "^2.0.0",
|
||||||
"@ember/test-helpers": "^2.1.4",
|
"@ember/test-helpers": "^2.2.8",
|
||||||
"@glimmer/component": "^1.0.3",
|
"@glimmer/component": "^1.0.3",
|
||||||
"@glimmer/tracking": "^1.0.3",
|
"@glimmer/tracking": "^1.0.3",
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"broccoli-asset-rev": "^3.0.0",
|
"broccoli-asset-rev": "^3.0.0",
|
||||||
"core": "*",
|
"core": "*",
|
||||||
"doctoc": "^1.4.0",
|
"doctoc": "^2.0.0",
|
||||||
"ember-auto-import": "^1.10.1",
|
"ember-auto-import": "^1.10.1",
|
||||||
"ember-cli": "~3.24.0",
|
"ember-cli": "~3.27.0",
|
||||||
"ember-cli-dependency-checker": "^3.2.0",
|
"ember-cli-dependency-checker": "^3.2.0",
|
||||||
"ember-cli-inject-live-reload": "^2.0.2",
|
"ember-cli-inject-live-reload": "^2.1.0",
|
||||||
"ember-cli-sri": "^2.1.1",
|
"ember-cli-sri": "^2.1.1",
|
||||||
"ember-cli-terser": "^4.0.1",
|
"ember-cli-terser": "^4.0.1",
|
||||||
"ember-cli-update": "^0.54.6",
|
"ember-cli-update": "^0.54.6",
|
||||||
@@ -53,8 +53,8 @@
|
|||||||
"ember-source-channel-url": "^3.0.0",
|
"ember-source-channel-url": "^3.0.0",
|
||||||
"ember-template-lint": "^2.15.0",
|
"ember-template-lint": "^2.15.0",
|
||||||
"ember-try": "^1.4.0",
|
"ember-try": "^1.4.0",
|
||||||
"eslint": "^7.17.0",
|
"eslint": "^7.31.0",
|
||||||
"eslint-config-prettier": "^7.1.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-ember": "^10.1.1",
|
"eslint-plugin-ember": "^10.1.1",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-prettier": "^3.3.1",
|
"eslint-plugin-prettier": "^3.3.1",
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
"qunit-dom": "^1.6.0"
|
"qunit-dom": "^1.6.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "10.* || >= 12"
|
"node": ">=10 <=15"
|
||||||
},
|
},
|
||||||
"ember": {
|
"ember": {
|
||||||
"edition": "octane"
|
"edition": "octane"
|
||||||
|
|||||||
@@ -7,6 +7,25 @@ helpers.
|
|||||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
|
|
||||||
|
- [Add core to an App](#add-core-to-an-app)
|
||||||
|
- [Installation](#installation)
|
||||||
|
- [I18n](#i18n)
|
||||||
|
- [Notifications](#notifications)
|
||||||
|
- [Confirmations](#confirmations)
|
||||||
|
- [App and Company Names](#app-and-company-names)
|
||||||
|
- [Documentation URLs](#documentation-urls)
|
||||||
|
- [Loading Helper](#loading-helper)
|
||||||
|
- [Scope Service](#scope-service)
|
||||||
|
- [Yarn Commands](#yarn-commands)
|
||||||
|
- [Linting](#linting)
|
||||||
|
- [Formatting](#formatting)
|
||||||
|
- [Running tests](#running-tests)
|
||||||
|
- [Running the dummy application](#running-the-dummy-application)
|
||||||
|
- [Contributing](#contributing)
|
||||||
|
- [Building ToC](#building-toc)
|
||||||
|
|
||||||
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
|
|
||||||
- [Add core to an App](#add-core-to-an-app)
|
- [Add core to an App](#add-core-to-an-app)
|
||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
- [Yarn Commands](#yarn-commands)
|
- [Yarn Commands](#yarn-commands)
|
||||||
|
|||||||
@@ -76,8 +76,8 @@ export default class OIDCAuthenticator extends BaseOIDCAuthenticator {
|
|||||||
* @param {string} token
|
* @param {string} token
|
||||||
*/
|
*/
|
||||||
addTokenToAuthorization(token) {
|
addTokenToAuthorization(token) {
|
||||||
const adapterPrototype = this.store.adapterFor('application').constructor
|
const adapterPrototype =
|
||||||
.prototype;
|
this.store.adapterFor('application').constructor.prototype;
|
||||||
const headers = adapterPrototype?.headers;
|
const headers = adapterPrototype?.headers;
|
||||||
if (!headers) adapterPrototype.headers = {};
|
if (!headers) adapterPrototype.headers = {};
|
||||||
adapterPrototype.headers.Authorization = null;
|
adapterPrototype.headers.Authorization = null;
|
||||||
|
|||||||
Loaded 100 of 498 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user