Compare commits
	
		
			705 Commits
		
	
	
		
			version/0.
			...
			version/20
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 677a181b9c | |||
| 4b551add1a | |||
| 217cca822d | |||
| e6f897c7e6 | |||
| 65c9d4bf4c | |||
| 6e88e52d78 | |||
| 6e69edf1af | |||
| 08e7ef3c1e | |||
| d728163eea | |||
| cf76652a4c | |||
| c525ecc334 | |||
| 49d40d4337 | |||
| 94182f88a4 | |||
| 1c25f4f09b | |||
| 6495d6c50a | |||
| b81f3e4a38 | |||
| aad3b43ac3 | |||
| 60f52f102a | |||
| f3ccb5341d | |||
| cb73210447 | |||
| 81efc9a673 | |||
| 72c6c0da9b | |||
| 8fef839965 | |||
| 87b830ff9a | |||
| 8acb9dde5f | |||
| 36e8b1004c | |||
| f959212692 | |||
| 2d2a404028 | |||
| 394ad6ade5 | |||
| 4baf9e4a22 | |||
| d020599e09 | |||
| 4f28a89e63 | |||
| f8b4b92e8d | |||
| 33f208657c | |||
| c1fbfc63ab | |||
| 192dbe05c4 | |||
| 0b41cb84f0 | |||
| d637bd0bf9 | |||
| a2bddc6d91 | |||
| 2e42da11ea | |||
| f297d1256d | |||
| 5e1e5afb24 | |||
| da59e7c4a7 | |||
| 8684d106d5 | |||
| 2579e168c3 | |||
| 7f5caf901d | |||
| 1c686e19b5 | |||
| 3cc92f6c97 | |||
| 8f5b33a3a2 | |||
| 4447345345 | |||
| 42c6401ba7 | |||
| eef111bcfd | |||
| 6192b2787f | |||
| c7d28f8ca9 | |||
| 1342266368 | |||
| 7ff679b1a3 | |||
| 8beddcddb0 | |||
| 9fe8554f28 | |||
| 812fe72e60 | |||
| d0e4533cdd | |||
| b1b5d94ddc | |||
| 59722e0bbe | |||
| 9c5bb3998c | |||
| c180c4b1a2 | |||
| 308896719d | |||
| 95c1473dd2 | |||
| b14c5039ed | |||
| b6948334f2 | |||
| 29e08e7477 | |||
| 36bc1dc020 | |||
| 61d1407804 | |||
| 47ddf0d7f2 | |||
| cb36a3c8c7 | |||
| cac94792fa | |||
| 6f56c37d2f | |||
| 8369fa16ae | |||
| f30bdbecd6 | |||
| c727c845df | |||
| b2b737e59e | |||
| e2b930afe3 | |||
| 36c0b924bc | |||
| 1ccf6dcf6f | |||
| f8a426f0e8 | |||
| f8756d0fc9 | |||
| fd6d99f4f9 | |||
| 04379f2c90 | |||
| ba1195cf70 | |||
| b0bd9212c7 | |||
| 209179e012 | |||
| df16f635fa | |||
| 14ccf47a2b | |||
| 2aac024477 | |||
| 4743e72e18 | |||
| cab2942c4e | |||
| 9fb5ce2a1a | |||
| 0eab4489c5 | |||
| 3aae030b23 | |||
| e7060cb90a | |||
| 6c0b9e3525 | |||
| 82bb179bc2 | |||
| 774eb0388b | |||
| 6ed78830a0 | |||
| 6fe323f1a7 | |||
| 85c2db018e | |||
| bc9e7e8b93 | |||
| 08c58ce3fb | |||
| c3bc986473 | |||
| 2e69efe699 | |||
| 4daa373dcf | |||
| a85b8a65c0 | |||
| d8dc1f8bb5 | |||
| 0f4d5bc3b0 | |||
| 6eed549577 | |||
| be54ba4fe2 | |||
| 68b9c34f78 | |||
| 3584bdf530 | |||
| e712719333 | |||
| 9a21c2f6bd | |||
| 0632d8ff37 | |||
| 6bfaf71c12 | |||
| b6c8c319e5 | |||
| 4fde1b7365 | |||
| 412f5b9210 | |||
| a9e53cd52a | |||
| d0ee7908ab | |||
| e69834dec4 | |||
| 1b9d22615c | |||
| e995536a15 | |||
| e6818faab1 | |||
| 010e834149 | |||
| 16d5e1d9ff | |||
| 765ae80698 | |||
| bbd0ff24d8 | |||
| 7a403613b2 | |||
| 4ad184a3fb | |||
| 48d5f28e7a | |||
| 0cb48121b2 | |||
| 4194ffe2d4 | |||
| 4636fe7e64 | |||
| 182d714b16 | |||
| 540c22ce15 | |||
| 8c3008abce | |||
| 8a22c86aaa | |||
| 22ce142cb8 | |||
| 1a292feebb | |||
| 09f4d812b3 | |||
| 2bab4ebfe8 | |||
| a8647caca9 | |||
| 590597caf6 | |||
| 7b43777b22 | |||
| 77861b52e3 | |||
| 5f9c1e229c | |||
| 119adb3e7b | |||
| 5db38bd0b7 | |||
| 0e1587bc1a | |||
| dc16a8a4c9 | |||
| a6d0c8c26c | |||
| 5797a3743a | |||
| b7e43efb34 | |||
| 48df12d045 | |||
| 4fea0f5939 | |||
| a7bdd63e4d | |||
| e216efb6ec | |||
| 378fe38b12 | |||
| ce9fb8801c | |||
| 67ca83c228 | |||
| ee2e737782 | |||
| b04c9a2098 | |||
| 7f7b7e37c1 | |||
| e7c96eb70d | |||
| e8debce9c8 | |||
| bcd0686a33 | |||
| 55322995a1 | |||
| dff5eb69c8 | |||
| b747022bc1 | |||
| 885fcff495 | |||
| 5b18e28753 | |||
| 9848c5f3eb | |||
| fc98c3934a | |||
| 7964061466 | |||
| 5f90f54195 | |||
| 49eb568d3c | |||
| d47d9103c7 | |||
| 12cbe464fc | |||
| d17b2b0d1b | |||
| f17d809219 | |||
| 6c8e9fb553 | |||
| 43bb29e16a | |||
| 29edbb0357 | |||
| 12ae867759 | |||
| a20ca9136b | |||
| 3759e96e7d | |||
| 480d882a82 | |||
| e5e1e3737d | |||
| 8dddcf891e | |||
| 319104c39b | |||
| a9336f069c | |||
| 33f5169f36 | |||
| 4c690a20ef | |||
| f68c8f7d90 | |||
| 95b56a0005 | |||
| 811c569b54 | |||
| 3ac3a8eebe | |||
| 6a5a243dac | |||
| 3549a9ecdd | |||
| ee916a68a4 | |||
| e9ca42cbb9 | |||
| 692d577217 | |||
| f192ee5052 | |||
| c95f8e8418 | |||
| 9549a7188b | |||
| 4998ccbe41 | |||
| a56ddb2b8e | |||
| 3cc6b8ee38 | |||
| 927ab509a1 | |||
| c85506f43c | |||
| 4157a0780d | |||
| 79da2bf698 | |||
| c3e9168b46 | |||
| d16838bbed | |||
| 6032efb67d | |||
| 322c6f01c2 | |||
| 71a58955f2 | |||
| f035da440a | |||
| 001de38d85 | |||
| 3ea39fe122 | |||
| 7bfa217cae | |||
| fdb9b45c51 | |||
| 116375084c | |||
| 1fca1df9dc | |||
| 4464ecc060 | |||
| 1af4373d97 | |||
| 28bbf5ac7f | |||
| 23f61e6b4f | |||
| db135a6dbc | |||
| a4dc6d13b5 | |||
| 4d88dcff08 | |||
| 6a835ad192 | |||
| efc849e760 | |||
| e62333dfb3 | |||
| e23afd18e4 | |||
| c2a30b760a | |||
| 6e24856d45 | |||
| 98a58b74e3 | |||
| 5f3ab22bea | |||
| 1ed5d5da35 | |||
| 76193e0031 | |||
| 50109ca7ad | |||
| e4b66d991c | |||
| 68adc2d5a5 | |||
| 349a3a67d5 | |||
| e1394207e7 | |||
| f265c1f10b | |||
| 1aecdc7f8f | |||
| a18edaf62b | |||
| c91abe448c | |||
| e531e52403 | |||
| cae536fa65 | |||
| 316b15b8a9 | |||
| e6ccd4fa76 | |||
| 86aabba3ed | |||
| 0b36aad5c8 | |||
| 64d2a216f0 | |||
| a5e5e140d6 | |||
| 29f98abd00 | |||
| 7b5ce4e98a | |||
| d7fa52ebf3 | |||
| 2ffaa94825 | |||
| b80b2626a6 | |||
| 3b7bba5a62 | |||
| 2d9efe035e | |||
| 48438e28fd | |||
| 885a2f0a58 | |||
| cf46ee06b7 | |||
| 9e33b49d29 | |||
| 1179ba4ef2 | |||
| 3c12c8b3ff | |||
| 4d22659b6e | |||
| 2c0709eeee | |||
| c24d1b6b84 | |||
| 040e148a73 | |||
| b85d550ee0 | |||
| ce95139d66 | |||
| 46436a5780 | |||
| 835a9aaaf2 | |||
| 42005e7def | |||
| d9956e1e9c | |||
| 4b1e73251a | |||
| 736dbdca33 | |||
| 789b8e5d3e | |||
| 074b55f66b | |||
| d9bc5ea4d1 | |||
| 716bb9f188 | |||
| dd496619a2 | |||
| 51d07f7913 | |||
| 5c4163579b | |||
| 5a73413d58 | |||
| 51a5d4bf49 | |||
| 8bbb854073 | |||
| 9f2e9e8444 | |||
| a3d361f500 | |||
| e9bb583b32 | |||
| efccf47c83 | |||
| a5b144cf8f | |||
| afc5a17fc2 | |||
| b3e0884b2e | |||
| 078d648551 | |||
| 41f9097592 | |||
| 562175741c | |||
| 24e24cb97e | |||
| 69b0a23a7d | |||
| f0f3245388 | |||
| 99ca0d1f9f | |||
| c9f0d048a8 | |||
| 90a94b5e3e | |||
| ae1a8842db | |||
| a3b17d1ed4 | |||
| 41576e27be | |||
| 07082cb3aa | |||
| 426cb33fab | |||
| 9e4f840d2d | |||
| e120d274e9 | |||
| 977d3f6ef9 | |||
| ecdbc917a5 | |||
| 0083cd55df | |||
| d380194e13 | |||
| 32f5d5ba72 | |||
| e818416863 | |||
| 7eed70cfe9 | |||
| ea6ca23f57 | |||
| f056b026d6 | |||
| 1c0a6efeb1 | |||
| 17732eea08 | |||
| aa5381fd59 | |||
| ffee86fcf3 | |||
| 7ff7398aff | |||
| 67925a39f2 | |||
| 3b5e1c7b34 | |||
| 3e49acf7ae | |||
| 76764c4374 | |||
| 9f6f8e1b55 | |||
| 9590180c6c | |||
| aef5c60a7b | |||
| d4c9c667c9 | |||
| 96f0d582f0 | |||
| 7e8702a71e | |||
| 1524061480 | |||
| 434922f702 | |||
| d2862ddc93 | |||
| 6e55431d4c | |||
| 01548c5e9c | |||
| bf1dae2dbe | |||
| 59c93defcf | |||
| a2a1a27502 | |||
| e3227e7d54 | |||
| 1f4a8fffdb | |||
| 86b1183883 | |||
| f781f4848c | |||
| 19824d693c | |||
| 0694b911a4 | |||
| 71e7a03f71 | |||
| 0a874c98cb | |||
| 488e8f769a | |||
| e6a776be07 | |||
| 4fd1dafd82 | |||
| e535cb0ec8 | |||
| 8c1f55d3e3 | |||
| c3a2cb44cd | |||
| 682401bbf2 | |||
| 3e6e167348 | |||
| d08c1b7b02 | |||
| 94d70d252c | |||
| ccfe746dd5 | |||
| ef5dffa96a | |||
| 2caa1e7650 | |||
| 2246f3a534 | |||
| 95ba00cb79 | |||
| 2ab4d6620f | |||
| 01482d8468 | |||
| 45c4469d47 | |||
| 8a526ad452 | |||
| 773943e044 | |||
| c0166aec20 | |||
| c03754abec | |||
| 3487c41ce0 | |||
| d4d4a4ab94 | |||
| 05d87a2314 | |||
| 5b83c5a191 | |||
| 867e161f32 | |||
| ff15514d5b | |||
| 58497bb63f | |||
| e0bc4f1da5 | |||
| 1cfe1aff13 | |||
| 810a7ab50b | |||
| 3b12de23ff | |||
| 12f788661c | |||
| 6164db5a18 | |||
| c17623323a | |||
| 05aeeafacc | |||
| dc4a7d98e8 | |||
| cc5a0c23aa | |||
| 821458373d | |||
| 832a3dda41 | |||
| 728befbda8 | |||
| a77c3f73cc | |||
| ebae03c399 | |||
| ffa4ac7efa | |||
| 16373d2143 | |||
| 1779b4d888 | |||
| b218ded241 | |||
| 8c8ff4643a | |||
| e6391b64f0 | |||
| 7195b77606 | |||
| add7ecc7aa | |||
| bce75dc047 | |||
| 71fbb23a2f | |||
| 7bb26b5903 | |||
| 93bfe60369 | |||
| 93bf977709 | |||
| 760dca0f76 | |||
| a777ecc933 | |||
| 0231bcf685 | |||
| a312ad2ad1 | |||
| 8e25970c01 | |||
| b1c4d0c716 | |||
| 43c391aa1c | |||
| 2a0b4c8f14 | |||
| 1193608631 | |||
| 775d80de6d | |||
| 05f8f92082 | |||
| f7022dd11f | |||
| 606e32603e | |||
| 5c5adfcccc | |||
| 0a2c0464df | |||
| 902953a2c7 | |||
| a8dad2e393 | |||
| 2417d5a59e | |||
| 66b3635648 | |||
| 7f821c484c | |||
| f51acb97a9 | |||
| c4db907a50 | |||
| 5650bd2d4c | |||
| 9466f91466 | |||
| 127ffbd456 | |||
| 2fbf06a1aa | |||
| 55f2ae5d08 | |||
| 47fe867803 | |||
| 28980d932a | |||
| 1e640fac76 | |||
| c7b6eac33d | |||
| f83087d04d | |||
| 14ab9bbd05 | |||
| a91d0ddc6c | |||
| 89400b4ea4 | |||
| afcbe24ff5 | |||
| 9c00c86e9b | |||
| 7efed56acc | |||
| 81a2c3992a | |||
| feabd38173 | |||
| 1432f0648f | |||
| 04f876af7b | |||
| 2449c63d0a | |||
| c738ea573c | |||
| 987b3a47d0 | |||
| 4dd397d9d9 | |||
| 5973f8bbca | |||
| 43f27c2401 | |||
| 7c73d2c2fb | |||
| 3f67da8f54 | |||
| afbecadba0 | |||
| 2de4023d43 | |||
| 6573d2e8f6 | |||
| bc412466b2 | |||
| 7a481396c6 | |||
| 7f40c89ade | |||
| 3c0f640b48 | |||
| 2f6ba42ce3 | |||
| aa8589d377 | |||
| cb2bad0a36 | |||
| 665839133f | |||
| 91e9f176a5 | |||
| 1a64edb89f | |||
| 6874265f94 | |||
| 9889dedcac | |||
| 275ac587a1 | |||
| 2f43b5b5ec | |||
| 416b2c60a1 | |||
| b39bee7a30 | |||
| 9714e5583d | |||
| bef25929a7 | |||
| 34f54a96cf | |||
| 401359a73f | |||
| 88f1cbb29c | |||
| bd9bce4c9b | |||
| 49c7ab701e | |||
| 35db60f2c8 | |||
| c0fd3e79bc | |||
| 8a54014a13 | |||
| 3cfe144394 | |||
| 5da8caf0d4 | |||
| c26d928eb0 | |||
| 02d4118f73 | |||
| d97b2bf503 | |||
| 2a50e36027 | |||
| eff3208ff7 | |||
| 551aff9455 | |||
| 22b4757971 | |||
| fa004876e9 | |||
| d5e34bb71d | |||
| e0dbeca657 | |||
| 1b6bd5b997 | |||
| a340378ce1 | |||
| 962f7d5f5c | |||
| a10404f34b | |||
| ed72595ae0 | |||
| 82dd597881 | |||
| 0c2d46e0af | |||
| 8b11616cf8 | |||
| 4b4a49bc66 | |||
| b770508d68 | |||
| 8934a0d4f0 | |||
| fcf763ed3e | |||
| be8cc77086 | |||
| ffea308480 | |||
| c9712facf3 | |||
| 07773ed934 | |||
| 3c311ca527 | |||
| bc02fb04f8 | |||
| 37979291b5 | |||
| 49899a9ceb | |||
| bc2113a935 | |||
| eb9df38e92 | |||
| 372e51ee07 | |||
| 30bf4f5747 | |||
| ef2b8cf802 | |||
| c455a9a6b6 | |||
| 7dac6841fb | |||
| a8669ffe40 | |||
| 1ed392c53c | |||
| 4bd433d69e | |||
| f3010726d6 | |||
| 812d699fd6 | |||
| e32cbec072 | |||
| 1cb227305c | |||
| e42ad3f659 | |||
| 6a2ae67c31 | |||
| aa1b99204a | |||
| 6681289a5a | |||
| 322ad0890a | |||
| b849b2aef3 | |||
| 92c0ad4154 | |||
| 49397cef70 | |||
| 517b811a99 | |||
| 6bdcbfbf0e | |||
| b555c151dc | |||
| 12f211d07d | |||
| 277f960113 | |||
| aa6eacaf6b | |||
| 80866f00f4 | |||
| 59e7d9b81e | |||
| d6d91c8180 | |||
| d10d645c02 | |||
| a2c7921c1f | |||
| 582dfface9 | |||
| 592f2cc558 | |||
| 1e1a002ab2 | |||
| ba2bd4fdaf | |||
| 9a407dcc5a | |||
| f8c720f8cd | |||
| 9c3bc4eb38 | |||
| 0a8d4eecae | |||
| 120f5f2e44 | |||
| e99812a6f5 | |||
| 1c5fedb177 | |||
| 8cc063ded2 | |||
| 5faafbbca6 | |||
| dda1217735 | |||
| d21f187673 | |||
| 8a105cf5a0 | |||
| 9e384df79e | |||
| c0bfd32d39 | |||
| 7be680cbe5 | |||
| 93bf8eaa82 | |||
| 1248585dca | |||
| 1319c480c4 | |||
| 1911e8e3a9 | |||
| 4198c5363f | |||
| 207aae15a8 | |||
| 50531b8a36 | |||
| e5e4824920 | |||
| 085247e2dc | |||
| f766594ab0 | |||
| d1e469e282 | |||
| 79e4500827 | |||
| 42702fa96a | |||
| 9deb3ad80f | |||
| 9877ef99c4 | |||
| c304b40e1b | |||
| f0e6d6f417 | |||
| 54de5c981e | |||
| a446775fe2 | |||
| 7393d8720b | |||
| 287cb72d6f | |||
| c5eff4bdd6 | |||
| e9a33ed8ab | |||
| 875173a86e | |||
| df7642b365 | |||
| 3bc1c0aa8b | |||
| 8951f5695e | |||
| 7401278707 | |||
| e99f6e289b | |||
| 07da6ffa69 | |||
| dc18730094 | |||
| a202679bfb | |||
| 1edcda58ba | |||
| 5cb7f0794e | |||
| 7e8e3893eb | |||
| e91e286ebc | |||
| ef4a115b61 | |||
| b79b73f5c6 | |||
| 056e3ed15b | |||
| fb5e210af8 | |||
| e5e2615f15 | |||
| 6c72a9e2e8 | |||
| c04d0a373a | |||
| bd74e518a7 | |||
| 3b76af4eaa | |||
| 706448dc14 | |||
| 34793f7cef | |||
| ba96c9526e | |||
| 617432deaa | |||
| 36bf2be16d | |||
| 912ed343e6 | |||
| 2e15df295a | |||
| eaab3f62cb | |||
| aa615b0fd6 | |||
| b775f2788c | |||
| 9c28db3d89 | |||
| 67360bd6e9 | |||
| 4f6f8c7cae | |||
| 3b82ad798b | |||
| 8827f06ac1 | |||
| 251672a67d | |||
| 4ffc0e2a08 | |||
| 4e1808632d | |||
| 791627d3ce | |||
| f3df3a0157 | |||
| 6aaae53a19 | |||
| 4d84f6d598 | |||
| 4e2349b6d9 | |||
| cd57b8f7f3 | |||
| 40b1fc06b0 | |||
| 02fa217e28 | |||
| 6652514358 | |||
| dcd3dc9744 | |||
| d6afdc575e | |||
| 287b38efee | |||
| e805fb62fb | |||
| c92dda77f1 | |||
| f12fd78822 | |||
| caba183c9b | |||
| 3aeaa121a3 | |||
| a9f3118a7d | |||
| 054b819262 | |||
| 6b3411f63b | |||
| 6a8000ea0d | |||
| 352d4db0d7 | |||
| 4b665cfb8f | |||
| 4e12003944 | |||
| 6bfd465855 | |||
| e8670aa693 | |||
| 5263e750b1 | |||
| a2a9d73296 | |||
| 6befc9d627 | |||
| 73497a27cc | |||
| f3098418f2 | |||
| a5197963b2 | |||
| e4634bcc78 | |||
| 74da44a6a9 | |||
| 3324473cd0 | |||
| 39d8038533 | |||
| bbcf58705f | |||
| 7b5a0964b2 | |||
| 8eca76e464 | |||
| fb9ab368f8 | |||
| 877279b2ee | |||
| 301be4b411 | |||
| 728f527ccb | |||
| 3f1c790b1d | |||
| b00573bde2 | |||
| aeee3ad7f9 | |||
| ef021495ef | |||
| 061eab4b36 | |||
| 870e01f836 | |||
| e2ca72adf0 | |||
| 395ef43eae | |||
| a4cc653757 | |||
| db4ff20906 | |||
| 1f0fbd33b6 | |||
| 5de8d2721e | |||
| 0d65da9a9e | |||
| 4316ee4330 | |||
| 2ed9a1dbe3 | |||
| 8e03824d20 | |||
| 754dbdd0e5 | 
@ -1,10 +1,10 @@
 | 
				
			|||||||
[bumpversion]
 | 
					[bumpversion]
 | 
				
			||||||
current_version = 0.12.2-stable
 | 
					current_version = 2021.1.1-stable
 | 
				
			||||||
tag = True
 | 
					tag = True
 | 
				
			||||||
commit = True
 | 
					commit = True
 | 
				
			||||||
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\-(?P<release>.*)
 | 
					parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\-(?P<release>.*)
 | 
				
			||||||
serialize = {major}.{minor}.{patch}-{release}
 | 
					serialize = {major}.{minor}.{patch}-{release}
 | 
				
			||||||
message = new release: {new_version}
 | 
					message = release: {new_version}
 | 
				
			||||||
tag_name = version/{new_version}
 | 
					tag_name = version/{new_version}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[bumpversion:part:release]
 | 
					[bumpversion:part:release]
 | 
				
			||||||
@ -15,18 +15,22 @@ values =
 | 
				
			|||||||
	beta
 | 
						beta
 | 
				
			||||||
	stable
 | 
						stable
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[bumpversion:file:docs/installation/docker-compose.md]
 | 
					[bumpversion:file:website/docs/installation/docker-compose.md]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[bumpversion:file:docs/installation/kubernetes.md]
 | 
					[bumpversion:file:website/docs/installation/kubernetes.md]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[bumpversion:file:docker-compose.yml]
 | 
					[bumpversion:file:docker-compose.yml]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[bumpversion:file:helm/values.yaml]
 | 
					[bumpversion:file:helm/values.yaml]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[bumpversion:file:helm/README.md]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[bumpversion:file:helm/Chart.yaml]
 | 
					[bumpversion:file:helm/Chart.yaml]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[bumpversion:file:.github/workflows/release.yml]
 | 
					[bumpversion:file:.github/workflows/release.yml]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[bumpversion:file:passbook/__init__.py]
 | 
					[bumpversion:file:authentik/__init__.py]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[bumpversion:file:proxy/pkg/version.go]
 | 
					[bumpversion:file:outpost/pkg/version.go]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[bumpversion:file:web/src/constants.ts]
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										33
									
								
								.coveragerc
									
									
									
									
									
								
							
							
						
						
									
										33
									
								
								.coveragerc
									
									
									
									
									
								
							@ -1,33 +0,0 @@
 | 
				
			|||||||
[run]
 | 
					 | 
				
			||||||
source = passbook
 | 
					 | 
				
			||||||
relative_files = true
 | 
					 | 
				
			||||||
omit =
 | 
					 | 
				
			||||||
    */asgi.py
 | 
					 | 
				
			||||||
    manage.py
 | 
					 | 
				
			||||||
    */migrations/*
 | 
					 | 
				
			||||||
    */apps.py
 | 
					 | 
				
			||||||
    docs/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[report]
 | 
					 | 
				
			||||||
sort = Cover
 | 
					 | 
				
			||||||
skip_covered = True
 | 
					 | 
				
			||||||
precision = 2
 | 
					 | 
				
			||||||
exclude_lines =
 | 
					 | 
				
			||||||
  pragma: no cover
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Don't complain about missing debug-only code:
 | 
					 | 
				
			||||||
    def __unicode__
 | 
					 | 
				
			||||||
    def __str__
 | 
					 | 
				
			||||||
    def __repr__
 | 
					 | 
				
			||||||
    if self\.debug
 | 
					 | 
				
			||||||
    if TYPE_CHECKING
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Don't complain if tests don't hit defensive assertion code:
 | 
					 | 
				
			||||||
    raise AssertionError
 | 
					 | 
				
			||||||
    raise NotImplementedError
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Don't complain if non-runnable code isn't run:
 | 
					 | 
				
			||||||
    if 0:
 | 
					 | 
				
			||||||
    if __name__ == .__main__.:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
show_missing = True
 | 
					 | 
				
			||||||
@ -1,6 +1,6 @@
 | 
				
			|||||||
env
 | 
					env
 | 
				
			||||||
helm
 | 
					helm
 | 
				
			||||||
passbook-ui
 | 
					 | 
				
			||||||
static
 | 
					static
 | 
				
			||||||
 | 
					htmlcov
 | 
				
			||||||
*.env.yml
 | 
					*.env.yml
 | 
				
			||||||
node_modules/
 | 
					**/node_modules
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								.github/FUNDING.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/FUNDING.yml
									
									
									
									
										vendored
									
									
								
							@ -1 +1 @@
 | 
				
			|||||||
custom: ["https://www.paypal.me/beryju"]
 | 
					github: [BeryJu]
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								.github/ISSUE_TEMPLATE/bug_report.md
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/ISSUE_TEMPLATE/bug_report.md
									
									
									
									
										vendored
									
									
								
							@ -27,7 +27,7 @@ If applicable, add screenshots to help explain your problem.
 | 
				
			|||||||
Output of docker-compose logs or kubectl logs respectively
 | 
					Output of docker-compose logs or kubectl logs respectively
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**Version and Deployment (please complete the following information):**
 | 
					**Version and Deployment (please complete the following information):**
 | 
				
			||||||
 - passbook version: [e.g. 0.10.0-stable]
 | 
					 - authentik version: [e.g. 0.10.0-stable]
 | 
				
			||||||
 - Deployment: [e.g. docker-compose, helm]
 | 
					 - Deployment: [e.g. docker-compose, helm]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**Additional context**
 | 
					**Additional context**
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										18
									
								
								.github/dependabot.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.github/dependabot.yml
									
									
									
									
										vendored
									
									
								
							@ -9,7 +9,7 @@ updates:
 | 
				
			|||||||
  assignees:
 | 
					  assignees:
 | 
				
			||||||
  - BeryJu
 | 
					  - BeryJu
 | 
				
			||||||
- package-ecosystem: npm
 | 
					- package-ecosystem: npm
 | 
				
			||||||
  directory: "/passbook/static/static"
 | 
					  directory: "/web"
 | 
				
			||||||
  schedule:
 | 
					  schedule:
 | 
				
			||||||
    interval: daily
 | 
					    interval: daily
 | 
				
			||||||
    time: "04:00"
 | 
					    time: "04:00"
 | 
				
			||||||
@ -24,3 +24,19 @@ updates:
 | 
				
			|||||||
  open-pull-requests-limit: 10
 | 
					  open-pull-requests-limit: 10
 | 
				
			||||||
  assignees:
 | 
					  assignees:
 | 
				
			||||||
  - BeryJu
 | 
					  - BeryJu
 | 
				
			||||||
 | 
					- package-ecosystem: docker
 | 
				
			||||||
 | 
					  directory: "/"
 | 
				
			||||||
 | 
					  schedule:
 | 
				
			||||||
 | 
					    interval: daily
 | 
				
			||||||
 | 
					    time: "04:00"
 | 
				
			||||||
 | 
					  open-pull-requests-limit: 10
 | 
				
			||||||
 | 
					  assignees:
 | 
				
			||||||
 | 
					  - BeryJu
 | 
				
			||||||
 | 
					- package-ecosystem: docker
 | 
				
			||||||
 | 
					  directory: "/proxy"
 | 
				
			||||||
 | 
					  schedule:
 | 
				
			||||||
 | 
					    interval: daily
 | 
				
			||||||
 | 
					    time: "04:00"
 | 
				
			||||||
 | 
					  open-pull-requests-limit: 10
 | 
				
			||||||
 | 
					  assignees:
 | 
				
			||||||
 | 
					  - BeryJu
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										61
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										61
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
								
							@ -1,4 +1,4 @@
 | 
				
			|||||||
name: passbook-on-release
 | 
					name: authentik-on-release
 | 
				
			||||||
 | 
					
 | 
				
			||||||
on:
 | 
					on:
 | 
				
			||||||
  release:
 | 
					  release:
 | 
				
			||||||
@ -18,13 +18,13 @@ jobs:
 | 
				
			|||||||
      - name: Building Docker Image
 | 
					      - name: Building Docker Image
 | 
				
			||||||
        run: docker build
 | 
					        run: docker build
 | 
				
			||||||
          --no-cache
 | 
					          --no-cache
 | 
				
			||||||
          -t beryju/passbook:0.12.2-stable
 | 
					          -t beryju/authentik:2021.1.1-stable
 | 
				
			||||||
          -t beryju/passbook:latest
 | 
					          -t beryju/authentik:latest
 | 
				
			||||||
          -f Dockerfile .
 | 
					          -f Dockerfile .
 | 
				
			||||||
      - name: Push Docker Container to Registry (versioned)
 | 
					      - name: Push Docker Container to Registry (versioned)
 | 
				
			||||||
        run: docker push beryju/passbook:0.12.2-stable
 | 
					        run: docker push beryju/authentik:2021.1.1-stable
 | 
				
			||||||
      - name: Push Docker Container to Registry (latest)
 | 
					      - name: Push Docker Container to Registry (latest)
 | 
				
			||||||
        run: docker push beryju/passbook:latest
 | 
					        run: docker push beryju/authentik:latest
 | 
				
			||||||
  build-proxy:
 | 
					  build-proxy:
 | 
				
			||||||
    runs-on: ubuntu-latest
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
@ -34,9 +34,9 @@ jobs:
 | 
				
			|||||||
          go-version: "^1.15"
 | 
					          go-version: "^1.15"
 | 
				
			||||||
      - name: prepare go api client
 | 
					      - name: prepare go api client
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          cd proxy
 | 
					          cd outpost
 | 
				
			||||||
          go get -u github.com/go-swagger/go-swagger/cmd/swagger
 | 
					          go get -u github.com/go-swagger/go-swagger/cmd/swagger
 | 
				
			||||||
          swagger generate client -f ../swagger.yaml -A passbook -t pkg/
 | 
					          swagger generate client -f ../swagger.yaml -A authentik -t pkg/
 | 
				
			||||||
          go build -v .
 | 
					          go build -v .
 | 
				
			||||||
      - name: Docker Login Registry
 | 
					      - name: Docker Login Registry
 | 
				
			||||||
        env:
 | 
					        env:
 | 
				
			||||||
@ -45,27 +45,18 @@ jobs:
 | 
				
			|||||||
        run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
 | 
					        run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
 | 
				
			||||||
      - name: Building Docker Image
 | 
					      - name: Building Docker Image
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          cd proxy
 | 
					          cd outpost/
 | 
				
			||||||
          docker build \
 | 
					          docker build \
 | 
				
			||||||
          --no-cache \
 | 
					          --no-cache \
 | 
				
			||||||
          -t beryju/passbook-proxy:0.12.2-stable \
 | 
					          -t beryju/authentik-proxy:2021.1.1-stable \
 | 
				
			||||||
          -t beryju/passbook-proxy:latest \
 | 
					          -t beryju/authentik-proxy:latest \
 | 
				
			||||||
          -f Dockerfile .
 | 
					          -f proxy.Dockerfile .
 | 
				
			||||||
      - name: Push Docker Container to Registry (versioned)
 | 
					      - name: Push Docker Container to Registry (versioned)
 | 
				
			||||||
        run: docker push beryju/passbook-proxy:0.12.2-stable
 | 
					        run: docker push beryju/authentik-proxy:2021.1.1-stable
 | 
				
			||||||
      - name: Push Docker Container to Registry (latest)
 | 
					      - name: Push Docker Container to Registry (latest)
 | 
				
			||||||
        run: docker push beryju/passbook-proxy:latest
 | 
					        run: docker push beryju/authentik-proxy:latest
 | 
				
			||||||
  build-static:
 | 
					  build-static:
 | 
				
			||||||
    runs-on: ubuntu-latest
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
    services:
 | 
					 | 
				
			||||||
      postgres:
 | 
					 | 
				
			||||||
        image: postgres:latest
 | 
					 | 
				
			||||||
        env:
 | 
					 | 
				
			||||||
          POSTGRES_DB: passbook
 | 
					 | 
				
			||||||
          POSTGRES_USER: passbook
 | 
					 | 
				
			||||||
          POSTGRES_PASSWORD: "EK-5jnKfjrGRm<77"
 | 
					 | 
				
			||||||
      redis:
 | 
					 | 
				
			||||||
        image: redis:latest
 | 
					 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - uses: actions/checkout@v1
 | 
					      - uses: actions/checkout@v1
 | 
				
			||||||
      - name: Docker Login Registry
 | 
					      - name: Docker Login Registry
 | 
				
			||||||
@ -74,20 +65,22 @@ jobs:
 | 
				
			|||||||
          DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
 | 
					          DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
 | 
				
			||||||
        run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
 | 
					        run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
 | 
				
			||||||
      - name: Building Docker Image
 | 
					      - name: Building Docker Image
 | 
				
			||||||
        run: docker build
 | 
					        run: |
 | 
				
			||||||
          --no-cache
 | 
					          cd web/
 | 
				
			||||||
          --network=$(docker network ls | grep github | awk '{print $1}')
 | 
					          docker build \
 | 
				
			||||||
          -t beryju/passbook-static:0.12.2-stable
 | 
					          --no-cache \
 | 
				
			||||||
          -t beryju/passbook-static:latest
 | 
					          -t beryju/authentik-static:2021.1.1-stable \
 | 
				
			||||||
          -f static.Dockerfile .
 | 
					          -t beryju/authentik-static:latest \
 | 
				
			||||||
 | 
					          -f Dockerfile .
 | 
				
			||||||
      - name: Push Docker Container to Registry (versioned)
 | 
					      - name: Push Docker Container to Registry (versioned)
 | 
				
			||||||
        run: docker push beryju/passbook-static:0.12.2-stable
 | 
					        run: docker push beryju/authentik-static:2021.1.1-stable
 | 
				
			||||||
      - name: Push Docker Container to Registry (latest)
 | 
					      - name: Push Docker Container to Registry (latest)
 | 
				
			||||||
        run: docker push beryju/passbook-static:latest
 | 
					        run: docker push beryju/authentik-static:latest
 | 
				
			||||||
  test-release:
 | 
					  test-release:
 | 
				
			||||||
    needs:
 | 
					    needs:
 | 
				
			||||||
      - build-server
 | 
					      - build-server
 | 
				
			||||||
      - build-static
 | 
					      - build-static
 | 
				
			||||||
 | 
					      - build-proxy
 | 
				
			||||||
    runs-on: ubuntu-latest
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - uses: actions/checkout@v1
 | 
					      - uses: actions/checkout@v1
 | 
				
			||||||
@ -95,11 +88,11 @@ jobs:
 | 
				
			|||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          sudo apt-get install -y pwgen
 | 
					          sudo apt-get install -y pwgen
 | 
				
			||||||
          echo "PG_PASS=$(pwgen 40 1)" >> .env
 | 
					          echo "PG_PASS=$(pwgen 40 1)" >> .env
 | 
				
			||||||
          echo "PASSBOOK_SECRET_KEY=$(pwgen 50 1)" >> .env
 | 
					          echo "AUTHENTIK_SECRET_KEY=$(pwgen 50 1)" >> .env
 | 
				
			||||||
          docker-compose pull -q
 | 
					          docker-compose pull -q
 | 
				
			||||||
          docker-compose up --no-start
 | 
					          docker-compose up --no-start
 | 
				
			||||||
          docker-compose start postgresql redis
 | 
					          docker-compose start postgresql redis
 | 
				
			||||||
          docker-compose run -u root --entrypoint /bin/bash server -c "pip install --no-cache -r requirements-dev.txt && ./manage.py test passbook"
 | 
					          docker-compose run -u root --entrypoint /bin/bash server -c "pip install --no-cache -r requirements-dev.txt && ./manage.py test authentik"
 | 
				
			||||||
  sentry-release:
 | 
					  sentry-release:
 | 
				
			||||||
    needs:
 | 
					    needs:
 | 
				
			||||||
      - test-release
 | 
					      - test-release
 | 
				
			||||||
@ -111,8 +104,8 @@ jobs:
 | 
				
			|||||||
        env:
 | 
					        env:
 | 
				
			||||||
          SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
 | 
					          SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
 | 
				
			||||||
          SENTRY_ORG: beryjuorg
 | 
					          SENTRY_ORG: beryjuorg
 | 
				
			||||||
          SENTRY_PROJECT: passbook
 | 
					          SENTRY_PROJECT: authentik
 | 
				
			||||||
          SENTRY_URL: https://sentry.beryju.org
 | 
					          SENTRY_URL: https://sentry.beryju.org
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          tagName: 0.12.2-stable
 | 
					          tagName: 2021.1.1-stable
 | 
				
			||||||
          environment: beryjuorg-prod
 | 
					          environment: beryjuorg-prod
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										16
									
								
								.github/workflows/tag.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								.github/workflows/tag.yml
									
									
									
									
										vendored
									
									
								
							@ -1,4 +1,4 @@
 | 
				
			|||||||
name: passbook-on-tag
 | 
					name: authentik-on-tag
 | 
				
			||||||
 | 
					
 | 
				
			||||||
on:
 | 
					on:
 | 
				
			||||||
  push:
 | 
					  push:
 | 
				
			||||||
@ -14,17 +14,17 @@ jobs:
 | 
				
			|||||||
      - name: Pre-release test
 | 
					      - name: Pre-release test
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          sudo apt-get install -y pwgen
 | 
					          sudo apt-get install -y pwgen
 | 
				
			||||||
          echo "PASSBOOK_TAG=latest" >> .env
 | 
					          echo "AUTHENTIK_TAG=latest" >> .env
 | 
				
			||||||
          echo "PG_PASS=$(pwgen 40 1)" >> .env
 | 
					          echo "PG_PASS=$(pwgen 40 1)" >> .env
 | 
				
			||||||
          echo "PASSBOOK_SECRET_KEY=$(pwgen 50 1)" >> .env
 | 
					          echo "AUTHENTIK_SECRET_KEY=$(pwgen 50 1)" >> .env
 | 
				
			||||||
          docker-compose pull -q
 | 
					          docker-compose pull -q
 | 
				
			||||||
          docker build \
 | 
					          docker build \
 | 
				
			||||||
            --no-cache \
 | 
					            --no-cache \
 | 
				
			||||||
            -t beryju/passbook:latest \
 | 
					            -t beryju/authentik:latest \
 | 
				
			||||||
            -f Dockerfile .
 | 
					            -f Dockerfile .
 | 
				
			||||||
          docker-compose up --no-start
 | 
					          docker-compose up --no-start
 | 
				
			||||||
          docker-compose start postgresql redis
 | 
					          docker-compose start postgresql redis
 | 
				
			||||||
          docker-compose run -u root --entrypoint /bin/bash server -c "pip install --no-cache -r requirements-dev.txt && ./manage.py test passbook"
 | 
					          docker-compose run -u root --entrypoint /bin/bash server -c "pip install --no-cache -r requirements-dev.txt && ./manage.py test authentik"
 | 
				
			||||||
      - name: Install Helm
 | 
					      - name: Install Helm
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          apt update && apt install -y curl
 | 
					          apt update && apt install -y curl
 | 
				
			||||||
@ -33,7 +33,7 @@ jobs:
 | 
				
			|||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          helm dependency update helm/
 | 
					          helm dependency update helm/
 | 
				
			||||||
          helm package helm/
 | 
					          helm package helm/
 | 
				
			||||||
          mv passbook-*.tgz passbook-chart.tgz
 | 
					          mv authentik-*.tgz authentik-chart.tgz
 | 
				
			||||||
      - name: Extract version number
 | 
					      - name: Extract version number
 | 
				
			||||||
        id: get_version
 | 
					        id: get_version
 | 
				
			||||||
        uses: actions/github-script@0.2.0
 | 
					        uses: actions/github-script@0.2.0
 | 
				
			||||||
@ -58,6 +58,6 @@ jobs:
 | 
				
			|||||||
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | 
					          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          upload_url: ${{ steps.create_release.outputs.upload_url }}
 | 
					          upload_url: ${{ steps.create_release.outputs.upload_url }}
 | 
				
			||||||
          asset_path: ./passbook-chart.tgz
 | 
					          asset_path: ./authentik-chart.tgz
 | 
				
			||||||
          asset_name: passbook-chart.tgz
 | 
					          asset_name: authentik-chart.tgz
 | 
				
			||||||
          asset_content_type: application/gzip
 | 
					          asset_content_type: application/gzip
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										6
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -27,12 +27,12 @@ media
 | 
				
			|||||||
.Python
 | 
					.Python
 | 
				
			||||||
build/
 | 
					build/
 | 
				
			||||||
develop-eggs/
 | 
					develop-eggs/
 | 
				
			||||||
dist/
 | 
					 | 
				
			||||||
downloads/
 | 
					downloads/
 | 
				
			||||||
eggs/
 | 
					eggs/
 | 
				
			||||||
.eggs/
 | 
					.eggs/
 | 
				
			||||||
lib64/
 | 
					lib64/
 | 
				
			||||||
parts/
 | 
					parts/
 | 
				
			||||||
 | 
					dist/
 | 
				
			||||||
sdist/
 | 
					sdist/
 | 
				
			||||||
var/
 | 
					var/
 | 
				
			||||||
wheels/
 | 
					wheels/
 | 
				
			||||||
@ -198,4 +198,6 @@ local.env.yml
 | 
				
			|||||||
**/charts/*.tgz
 | 
					**/charts/*.tgz
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Selenium Screenshots
 | 
					# Selenium Screenshots
 | 
				
			||||||
selenium_screenshots/**
 | 
					selenium_screenshots/
 | 
				
			||||||
 | 
					backups/
 | 
				
			||||||
 | 
					media/
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +0,0 @@
 | 
				
			|||||||
[settings]
 | 
					 | 
				
			||||||
multi_line_output=3
 | 
					 | 
				
			||||||
include_trailing_comma=True
 | 
					 | 
				
			||||||
force_grid_wrap=0
 | 
					 | 
				
			||||||
use_parentheses=True
 | 
					 | 
				
			||||||
line_length=88
 | 
					 | 
				
			||||||
@ -9,3 +9,4 @@ ignore-paths:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
uses:
 | 
					uses:
 | 
				
			||||||
  - django
 | 
					  - django
 | 
				
			||||||
 | 
					  - celery
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										21
									
								
								.pylintrc
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								.pylintrc
									
									
									
									
									
								
							@ -1,16 +1,29 @@
 | 
				
			|||||||
[MASTER]
 | 
					[MASTER]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
disable=arguments-differ,no-self-use,fixme,locally-disabled,too-many-ancestors,too-few-public-methods,import-outside-toplevel,bad-continuation,signature-differs,similarities,cyclic-import
 | 
					disable =
 | 
				
			||||||
 | 
					    arguments-differ,
 | 
				
			||||||
 | 
					    no-self-use,
 | 
				
			||||||
 | 
					    fixme,
 | 
				
			||||||
 | 
					    locally-disabled,
 | 
				
			||||||
 | 
					    too-many-ancestors,
 | 
				
			||||||
 | 
					    too-few-public-methods,
 | 
				
			||||||
 | 
					    import-outside-toplevel,
 | 
				
			||||||
 | 
					    bad-continuation,
 | 
				
			||||||
 | 
					    signature-differs,
 | 
				
			||||||
 | 
					    similarities,
 | 
				
			||||||
 | 
					    cyclic-import,
 | 
				
			||||||
 | 
					    protected-access,
 | 
				
			||||||
 | 
					    unsubscriptable-object # remove when pylint is upgraded to 2.6
 | 
				
			||||||
 | 
					
 | 
				
			||||||
load-plugins=pylint_django,pylint.extensions.bad_builtin
 | 
					load-plugins=pylint_django,pylint.extensions.bad_builtin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extension-pkg-whitelist=lxml
 | 
					extension-pkg-whitelist=lxml,xmlsec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Allow constants to be shorter than normal (and lowercase, for settings.py)
 | 
					# Allow constants to be shorter than normal (and lowercase, for settings.py)
 | 
				
			||||||
const-rgx=[a-zA-Z0-9_]{1,40}$
 | 
					const-rgx=[a-zA-Z0-9_]{1,40}$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ignored-modules=django-otp
 | 
					ignored-modules=django-otp
 | 
				
			||||||
 | 
					generated-members=xmlsec.constants.*,xmlsec.tree.*,xmlsec.template.*
 | 
				
			||||||
ignore=migrations
 | 
					ignore=migrations
 | 
				
			||||||
max-attributes=12
 | 
					max-attributes=12
 | 
				
			||||||
 | 
					max-branches=20
 | 
				
			||||||
jobs=12
 | 
					 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										26
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								Dockerfile
									
									
									
									
									
								
							@ -1,4 +1,4 @@
 | 
				
			|||||||
FROM python:3.8-slim-buster as locker
 | 
					FROM python:3.9-slim-buster as locker
 | 
				
			||||||
 | 
					
 | 
				
			||||||
COPY ./Pipfile /app/
 | 
					COPY ./Pipfile /app/
 | 
				
			||||||
COPY ./Pipfile.lock /app/
 | 
					COPY ./Pipfile.lock /app/
 | 
				
			||||||
@ -9,7 +9,7 @@ RUN pip install pipenv && \
 | 
				
			|||||||
    pipenv lock -r > requirements.txt && \
 | 
					    pipenv lock -r > requirements.txt && \
 | 
				
			||||||
    pipenv lock -rd > requirements-dev.txt
 | 
					    pipenv lock -rd > requirements-dev.txt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FROM python:3.8-slim-buster
 | 
					FROM python:3.9-slim-buster
 | 
				
			||||||
 | 
					
 | 
				
			||||||
WORKDIR /
 | 
					WORKDIR /
 | 
				
			||||||
COPY --from=locker /app/requirements.txt /
 | 
					COPY --from=locker /app/requirements.txt /
 | 
				
			||||||
@ -20,17 +20,29 @@ RUN apt-get update && \
 | 
				
			|||||||
    curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
 | 
					    curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
 | 
				
			||||||
    echo "deb http://apt.postgresql.org/pub/repos/apt buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
 | 
					    echo "deb http://apt.postgresql.org/pub/repos/apt buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
 | 
				
			||||||
    apt-get update && \
 | 
					    apt-get update && \
 | 
				
			||||||
    apt-get install -y --no-install-recommends postgresql-client-12 postgresql-client-11 build-essential && \
 | 
					    apt-get install -y --no-install-recommends postgresql-client-12 postgresql-client-11 build-essential libxmlsec1-dev pkg-config && \
 | 
				
			||||||
    apt-get clean && \
 | 
					    apt-get clean && \
 | 
				
			||||||
    pip install -r /requirements.txt --no-cache-dir && \
 | 
					    pip install -r /requirements.txt --no-cache-dir && \
 | 
				
			||||||
    apt-get remove --purge -y build-essential && \
 | 
					    apt-get remove --purge -y build-essential && \
 | 
				
			||||||
    apt-get autoremove --purge -y && \
 | 
					    apt-get autoremove --purge -y && \
 | 
				
			||||||
    adduser --system --no-create-home --uid 1000 --group --home /passbook passbook
 | 
					    # This is quite hacky, but docker has no guaranteed Group ID
 | 
				
			||||||
 | 
					    # we could instead check for the GID of the socket and add the user dynamically,
 | 
				
			||||||
 | 
					    # but then we have to drop permmissions later
 | 
				
			||||||
 | 
					    groupadd -g 998 docker_998 && \
 | 
				
			||||||
 | 
					    groupadd -g 999 docker_999 && \
 | 
				
			||||||
 | 
					    adduser --system --no-create-home --uid 1000 --group --home /authentik authentik && \
 | 
				
			||||||
 | 
					    usermod -a -G docker_998 authentik && \
 | 
				
			||||||
 | 
					    usermod -a -G docker_999 authentik && \
 | 
				
			||||||
 | 
					    mkdir /backups && \
 | 
				
			||||||
 | 
					    chown authentik:authentik /backups
 | 
				
			||||||
 | 
					
 | 
				
			||||||
COPY ./passbook/ /passbook
 | 
					COPY ./authentik/ /authentik
 | 
				
			||||||
 | 
					COPY ./pytest.ini /
 | 
				
			||||||
 | 
					COPY ./xml /xml
 | 
				
			||||||
COPY ./manage.py /
 | 
					COPY ./manage.py /
 | 
				
			||||||
COPY ./lifecycle/ /lifecycle
 | 
					COPY ./lifecycle/ /lifecycle
 | 
				
			||||||
 | 
					
 | 
				
			||||||
USER passbook
 | 
					USER authentik
 | 
				
			||||||
 | 
					STOPSIGNAL SIGINT
 | 
				
			||||||
 | 
					ENV TMPDIR /dev/shm/
 | 
				
			||||||
ENTRYPOINT [ "/lifecycle/bootstrap.sh" ]
 | 
					ENTRYPOINT [ "/lifecycle/bootstrap.sh" ]
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										687
									
								
								LICENSE
									
									
									
									
									
								
							
							
						
						
									
										687
									
								
								LICENSE
									
									
									
									
									
								
							@ -1,21 +1,674 @@
 | 
				
			|||||||
MIT License
 | 
					                    GNU GENERAL PUBLIC LICENSE
 | 
				
			||||||
 | 
					                       Version 3, 29 June 2007
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Copyright (c) 2019 BeryJu.org
 | 
					 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 | 
				
			||||||
 | 
					 Everyone is permitted to copy and distribute verbatim copies
 | 
				
			||||||
 | 
					 of this license document, but changing it is not allowed.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
					                            Preamble
 | 
				
			||||||
of this software and associated documentation files (the "Software"), to deal
 | 
					 | 
				
			||||||
in the Software without restriction, including without limitation the rights
 | 
					 | 
				
			||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | 
					 | 
				
			||||||
copies of the Software, and to permit persons to whom the Software is
 | 
					 | 
				
			||||||
furnished to do so, subject to the following conditions:
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
The above copyright notice and this permission notice shall be included in all
 | 
					  The GNU General Public License is a free, copyleft license for
 | 
				
			||||||
copies or substantial portions of the Software.
 | 
					software and other kinds of works.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
					  The licenses for most software and other practical works are designed
 | 
				
			||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
					to take away your freedom to share and change the works.  By contrast,
 | 
				
			||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 | 
					the GNU General Public License is intended to guarantee your freedom to
 | 
				
			||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
					share and change all versions of a program--to make sure it remains free
 | 
				
			||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 | 
					software for all its users.  We, the Free Software Foundation, use the
 | 
				
			||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 | 
					GNU General Public License for most of our software; it applies also to
 | 
				
			||||||
SOFTWARE.
 | 
					any other work released this way by its authors.  You can apply it to
 | 
				
			||||||
 | 
					your programs, too.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  When we speak of free software, we are referring to freedom, not
 | 
				
			||||||
 | 
					price.  Our General Public Licenses are designed to make sure that you
 | 
				
			||||||
 | 
					have the freedom to distribute copies of free software (and charge for
 | 
				
			||||||
 | 
					them if you wish), that you receive source code or can get it if you
 | 
				
			||||||
 | 
					want it, that you can change the software or use pieces of it in new
 | 
				
			||||||
 | 
					free programs, and that you know you can do these things.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  To protect your rights, we need to prevent others from denying you
 | 
				
			||||||
 | 
					these rights or asking you to surrender the rights.  Therefore, you have
 | 
				
			||||||
 | 
					certain responsibilities if you distribute copies of the software, or if
 | 
				
			||||||
 | 
					you modify it: responsibilities to respect the freedom of others.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  For example, if you distribute copies of such a program, whether
 | 
				
			||||||
 | 
					gratis or for a fee, you must pass on to the recipients the same
 | 
				
			||||||
 | 
					freedoms that you received.  You must make sure that they, too, receive
 | 
				
			||||||
 | 
					or can get the source code.  And you must show them these terms so they
 | 
				
			||||||
 | 
					know their rights.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Developers that use the GNU GPL protect your rights with two steps:
 | 
				
			||||||
 | 
					(1) assert copyright on the software, and (2) offer you this License
 | 
				
			||||||
 | 
					giving you legal permission to copy, distribute and/or modify it.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  For the developers' and authors' protection, the GPL clearly explains
 | 
				
			||||||
 | 
					that there is no warranty for this free software.  For both users' and
 | 
				
			||||||
 | 
					authors' sake, the GPL requires that modified versions be marked as
 | 
				
			||||||
 | 
					changed, so that their problems will not be attributed erroneously to
 | 
				
			||||||
 | 
					authors of previous versions.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Some devices are designed to deny users access to install or run
 | 
				
			||||||
 | 
					modified versions of the software inside them, although the manufacturer
 | 
				
			||||||
 | 
					can do so.  This is fundamentally incompatible with the aim of
 | 
				
			||||||
 | 
					protecting users' freedom to change the software.  The systematic
 | 
				
			||||||
 | 
					pattern of such abuse occurs in the area of products for individuals to
 | 
				
			||||||
 | 
					use, which is precisely where it is most unacceptable.  Therefore, we
 | 
				
			||||||
 | 
					have designed this version of the GPL to prohibit the practice for those
 | 
				
			||||||
 | 
					products.  If such problems arise substantially in other domains, we
 | 
				
			||||||
 | 
					stand ready to extend this provision to those domains in future versions
 | 
				
			||||||
 | 
					of the GPL, as needed to protect the freedom of users.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Finally, every program is threatened constantly by software patents.
 | 
				
			||||||
 | 
					States should not allow patents to restrict development and use of
 | 
				
			||||||
 | 
					software on general-purpose computers, but in those that do, we wish to
 | 
				
			||||||
 | 
					avoid the special danger that patents applied to a free program could
 | 
				
			||||||
 | 
					make it effectively proprietary.  To prevent this, the GPL assures that
 | 
				
			||||||
 | 
					patents cannot be used to render the program non-free.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The precise terms and conditions for copying, distribution and
 | 
				
			||||||
 | 
					modification follow.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                       TERMS AND CONDITIONS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  0. Definitions.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  "This License" refers to version 3 of the GNU General Public License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  "Copyright" also means copyright-like laws that apply to other kinds of
 | 
				
			||||||
 | 
					works, such as semiconductor masks.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  "The Program" refers to any copyrightable work licensed under this
 | 
				
			||||||
 | 
					License.  Each licensee is addressed as "you".  "Licensees" and
 | 
				
			||||||
 | 
					"recipients" may be individuals or organizations.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  To "modify" a work means to copy from or adapt all or part of the work
 | 
				
			||||||
 | 
					in a fashion requiring copyright permission, other than the making of an
 | 
				
			||||||
 | 
					exact copy.  The resulting work is called a "modified version" of the
 | 
				
			||||||
 | 
					earlier work or a work "based on" the earlier work.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  A "covered work" means either the unmodified Program or a work based
 | 
				
			||||||
 | 
					on the Program.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  To "propagate" a work means to do anything with it that, without
 | 
				
			||||||
 | 
					permission, would make you directly or secondarily liable for
 | 
				
			||||||
 | 
					infringement under applicable copyright law, except executing it on a
 | 
				
			||||||
 | 
					computer or modifying a private copy.  Propagation includes copying,
 | 
				
			||||||
 | 
					distribution (with or without modification), making available to the
 | 
				
			||||||
 | 
					public, and in some countries other activities as well.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  To "convey" a work means any kind of propagation that enables other
 | 
				
			||||||
 | 
					parties to make or receive copies.  Mere interaction with a user through
 | 
				
			||||||
 | 
					a computer network, with no transfer of a copy, is not conveying.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  An interactive user interface displays "Appropriate Legal Notices"
 | 
				
			||||||
 | 
					to the extent that it includes a convenient and prominently visible
 | 
				
			||||||
 | 
					feature that (1) displays an appropriate copyright notice, and (2)
 | 
				
			||||||
 | 
					tells the user that there is no warranty for the work (except to the
 | 
				
			||||||
 | 
					extent that warranties are provided), that licensees may convey the
 | 
				
			||||||
 | 
					work under this License, and how to view a copy of this License.  If
 | 
				
			||||||
 | 
					the interface presents a list of user commands or options, such as a
 | 
				
			||||||
 | 
					menu, a prominent item in the list meets this criterion.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  1. Source Code.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The "source code" for a work means the preferred form of the work
 | 
				
			||||||
 | 
					for making modifications to it.  "Object code" means any non-source
 | 
				
			||||||
 | 
					form of a work.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  A "Standard Interface" means an interface that either is an official
 | 
				
			||||||
 | 
					standard defined by a recognized standards body, or, in the case of
 | 
				
			||||||
 | 
					interfaces specified for a particular programming language, one that
 | 
				
			||||||
 | 
					is widely used among developers working in that language.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The "System Libraries" of an executable work include anything, other
 | 
				
			||||||
 | 
					than the work as a whole, that (a) is included in the normal form of
 | 
				
			||||||
 | 
					packaging a Major Component, but which is not part of that Major
 | 
				
			||||||
 | 
					Component, and (b) serves only to enable use of the work with that
 | 
				
			||||||
 | 
					Major Component, or to implement a Standard Interface for which an
 | 
				
			||||||
 | 
					implementation is available to the public in source code form.  A
 | 
				
			||||||
 | 
					"Major Component", in this context, means a major essential component
 | 
				
			||||||
 | 
					(kernel, window system, and so on) of the specific operating system
 | 
				
			||||||
 | 
					(if any) on which the executable work runs, or a compiler used to
 | 
				
			||||||
 | 
					produce the work, or an object code interpreter used to run it.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The "Corresponding Source" for a work in object code form means all
 | 
				
			||||||
 | 
					the source code needed to generate, install, and (for an executable
 | 
				
			||||||
 | 
					work) run the object code and to modify the work, including scripts to
 | 
				
			||||||
 | 
					control those activities.  However, it does not include the work's
 | 
				
			||||||
 | 
					System Libraries, or general-purpose tools or generally available free
 | 
				
			||||||
 | 
					programs which are used unmodified in performing those activities but
 | 
				
			||||||
 | 
					which are not part of the work.  For example, Corresponding Source
 | 
				
			||||||
 | 
					includes interface definition files associated with source files for
 | 
				
			||||||
 | 
					the work, and the source code for shared libraries and dynamically
 | 
				
			||||||
 | 
					linked subprograms that the work is specifically designed to require,
 | 
				
			||||||
 | 
					such as by intimate data communication or control flow between those
 | 
				
			||||||
 | 
					subprograms and other parts of the work.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The Corresponding Source need not include anything that users
 | 
				
			||||||
 | 
					can regenerate automatically from other parts of the Corresponding
 | 
				
			||||||
 | 
					Source.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The Corresponding Source for a work in source code form is that
 | 
				
			||||||
 | 
					same work.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  2. Basic Permissions.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  All rights granted under this License are granted for the term of
 | 
				
			||||||
 | 
					copyright on the Program, and are irrevocable provided the stated
 | 
				
			||||||
 | 
					conditions are met.  This License explicitly affirms your unlimited
 | 
				
			||||||
 | 
					permission to run the unmodified Program.  The output from running a
 | 
				
			||||||
 | 
					covered work is covered by this License only if the output, given its
 | 
				
			||||||
 | 
					content, constitutes a covered work.  This License acknowledges your
 | 
				
			||||||
 | 
					rights of fair use or other equivalent, as provided by copyright law.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  You may make, run and propagate covered works that you do not
 | 
				
			||||||
 | 
					convey, without conditions so long as your license otherwise remains
 | 
				
			||||||
 | 
					in force.  You may convey covered works to others for the sole purpose
 | 
				
			||||||
 | 
					of having them make modifications exclusively for you, or provide you
 | 
				
			||||||
 | 
					with facilities for running those works, provided that you comply with
 | 
				
			||||||
 | 
					the terms of this License in conveying all material for which you do
 | 
				
			||||||
 | 
					not control copyright.  Those thus making or running the covered works
 | 
				
			||||||
 | 
					for you must do so exclusively on your behalf, under your direction
 | 
				
			||||||
 | 
					and control, on terms that prohibit them from making any copies of
 | 
				
			||||||
 | 
					your copyrighted material outside their relationship with you.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Conveying under any other circumstances is permitted solely under
 | 
				
			||||||
 | 
					the conditions stated below.  Sublicensing is not allowed; section 10
 | 
				
			||||||
 | 
					makes it unnecessary.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  No covered work shall be deemed part of an effective technological
 | 
				
			||||||
 | 
					measure under any applicable law fulfilling obligations under article
 | 
				
			||||||
 | 
					11 of the WIPO copyright treaty adopted on 20 December 1996, or
 | 
				
			||||||
 | 
					similar laws prohibiting or restricting circumvention of such
 | 
				
			||||||
 | 
					measures.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  When you convey a covered work, you waive any legal power to forbid
 | 
				
			||||||
 | 
					circumvention of technological measures to the extent such circumvention
 | 
				
			||||||
 | 
					is effected by exercising rights under this License with respect to
 | 
				
			||||||
 | 
					the covered work, and you disclaim any intention to limit operation or
 | 
				
			||||||
 | 
					modification of the work as a means of enforcing, against the work's
 | 
				
			||||||
 | 
					users, your or third parties' legal rights to forbid circumvention of
 | 
				
			||||||
 | 
					technological measures.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  4. Conveying Verbatim Copies.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  You may convey verbatim copies of the Program's source code as you
 | 
				
			||||||
 | 
					receive it, in any medium, provided that you conspicuously and
 | 
				
			||||||
 | 
					appropriately publish on each copy an appropriate copyright notice;
 | 
				
			||||||
 | 
					keep intact all notices stating that this License and any
 | 
				
			||||||
 | 
					non-permissive terms added in accord with section 7 apply to the code;
 | 
				
			||||||
 | 
					keep intact all notices of the absence of any warranty; and give all
 | 
				
			||||||
 | 
					recipients a copy of this License along with the Program.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  You may charge any price or no price for each copy that you convey,
 | 
				
			||||||
 | 
					and you may offer support or warranty protection for a fee.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  5. Conveying Modified Source Versions.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  You may convey a work based on the Program, or the modifications to
 | 
				
			||||||
 | 
					produce it from the Program, in the form of source code under the
 | 
				
			||||||
 | 
					terms of section 4, provided that you also meet all of these conditions:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    a) The work must carry prominent notices stating that you modified
 | 
				
			||||||
 | 
					    it, and giving a relevant date.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    b) The work must carry prominent notices stating that it is
 | 
				
			||||||
 | 
					    released under this License and any conditions added under section
 | 
				
			||||||
 | 
					    7.  This requirement modifies the requirement in section 4 to
 | 
				
			||||||
 | 
					    "keep intact all notices".
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    c) You must license the entire work, as a whole, under this
 | 
				
			||||||
 | 
					    License to anyone who comes into possession of a copy.  This
 | 
				
			||||||
 | 
					    License will therefore apply, along with any applicable section 7
 | 
				
			||||||
 | 
					    additional terms, to the whole of the work, and all its parts,
 | 
				
			||||||
 | 
					    regardless of how they are packaged.  This License gives no
 | 
				
			||||||
 | 
					    permission to license the work in any other way, but it does not
 | 
				
			||||||
 | 
					    invalidate such permission if you have separately received it.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    d) If the work has interactive user interfaces, each must display
 | 
				
			||||||
 | 
					    Appropriate Legal Notices; however, if the Program has interactive
 | 
				
			||||||
 | 
					    interfaces that do not display Appropriate Legal Notices, your
 | 
				
			||||||
 | 
					    work need not make them do so.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  A compilation of a covered work with other separate and independent
 | 
				
			||||||
 | 
					works, which are not by their nature extensions of the covered work,
 | 
				
			||||||
 | 
					and which are not combined with it such as to form a larger program,
 | 
				
			||||||
 | 
					in or on a volume of a storage or distribution medium, is called an
 | 
				
			||||||
 | 
					"aggregate" if the compilation and its resulting copyright are not
 | 
				
			||||||
 | 
					used to limit the access or legal rights of the compilation's users
 | 
				
			||||||
 | 
					beyond what the individual works permit.  Inclusion of a covered work
 | 
				
			||||||
 | 
					in an aggregate does not cause this License to apply to the other
 | 
				
			||||||
 | 
					parts of the aggregate.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  6. Conveying Non-Source Forms.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  You may convey a covered work in object code form under the terms
 | 
				
			||||||
 | 
					of sections 4 and 5, provided that you also convey the
 | 
				
			||||||
 | 
					machine-readable Corresponding Source under the terms of this License,
 | 
				
			||||||
 | 
					in one of these ways:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    a) Convey the object code in, or embodied in, a physical product
 | 
				
			||||||
 | 
					    (including a physical distribution medium), accompanied by the
 | 
				
			||||||
 | 
					    Corresponding Source fixed on a durable physical medium
 | 
				
			||||||
 | 
					    customarily used for software interchange.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    b) Convey the object code in, or embodied in, a physical product
 | 
				
			||||||
 | 
					    (including a physical distribution medium), accompanied by a
 | 
				
			||||||
 | 
					    written offer, valid for at least three years and valid for as
 | 
				
			||||||
 | 
					    long as you offer spare parts or customer support for that product
 | 
				
			||||||
 | 
					    model, to give anyone who possesses the object code either (1) a
 | 
				
			||||||
 | 
					    copy of the Corresponding Source for all the software in the
 | 
				
			||||||
 | 
					    product that is covered by this License, on a durable physical
 | 
				
			||||||
 | 
					    medium customarily used for software interchange, for a price no
 | 
				
			||||||
 | 
					    more than your reasonable cost of physically performing this
 | 
				
			||||||
 | 
					    conveying of source, or (2) access to copy the
 | 
				
			||||||
 | 
					    Corresponding Source from a network server at no charge.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    c) Convey individual copies of the object code with a copy of the
 | 
				
			||||||
 | 
					    written offer to provide the Corresponding Source.  This
 | 
				
			||||||
 | 
					    alternative is allowed only occasionally and noncommercially, and
 | 
				
			||||||
 | 
					    only if you received the object code with such an offer, in accord
 | 
				
			||||||
 | 
					    with subsection 6b.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    d) Convey the object code by offering access from a designated
 | 
				
			||||||
 | 
					    place (gratis or for a charge), and offer equivalent access to the
 | 
				
			||||||
 | 
					    Corresponding Source in the same way through the same place at no
 | 
				
			||||||
 | 
					    further charge.  You need not require recipients to copy the
 | 
				
			||||||
 | 
					    Corresponding Source along with the object code.  If the place to
 | 
				
			||||||
 | 
					    copy the object code is a network server, the Corresponding Source
 | 
				
			||||||
 | 
					    may be on a different server (operated by you or a third party)
 | 
				
			||||||
 | 
					    that supports equivalent copying facilities, provided you maintain
 | 
				
			||||||
 | 
					    clear directions next to the object code saying where to find the
 | 
				
			||||||
 | 
					    Corresponding Source.  Regardless of what server hosts the
 | 
				
			||||||
 | 
					    Corresponding Source, you remain obligated to ensure that it is
 | 
				
			||||||
 | 
					    available for as long as needed to satisfy these requirements.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    e) Convey the object code using peer-to-peer transmission, provided
 | 
				
			||||||
 | 
					    you inform other peers where the object code and Corresponding
 | 
				
			||||||
 | 
					    Source of the work are being offered to the general public at no
 | 
				
			||||||
 | 
					    charge under subsection 6d.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  A separable portion of the object code, whose source code is excluded
 | 
				
			||||||
 | 
					from the Corresponding Source as a System Library, need not be
 | 
				
			||||||
 | 
					included in conveying the object code work.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  A "User Product" is either (1) a "consumer product", which means any
 | 
				
			||||||
 | 
					tangible personal property which is normally used for personal, family,
 | 
				
			||||||
 | 
					or household purposes, or (2) anything designed or sold for incorporation
 | 
				
			||||||
 | 
					into a dwelling.  In determining whether a product is a consumer product,
 | 
				
			||||||
 | 
					doubtful cases shall be resolved in favor of coverage.  For a particular
 | 
				
			||||||
 | 
					product received by a particular user, "normally used" refers to a
 | 
				
			||||||
 | 
					typical or common use of that class of product, regardless of the status
 | 
				
			||||||
 | 
					of the particular user or of the way in which the particular user
 | 
				
			||||||
 | 
					actually uses, or expects or is expected to use, the product.  A product
 | 
				
			||||||
 | 
					is a consumer product regardless of whether the product has substantial
 | 
				
			||||||
 | 
					commercial, industrial or non-consumer uses, unless such uses represent
 | 
				
			||||||
 | 
					the only significant mode of use of the product.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  "Installation Information" for a User Product means any methods,
 | 
				
			||||||
 | 
					procedures, authorization keys, or other information required to install
 | 
				
			||||||
 | 
					and execute modified versions of a covered work in that User Product from
 | 
				
			||||||
 | 
					a modified version of its Corresponding Source.  The information must
 | 
				
			||||||
 | 
					suffice to ensure that the continued functioning of the modified object
 | 
				
			||||||
 | 
					code is in no case prevented or interfered with solely because
 | 
				
			||||||
 | 
					modification has been made.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  If you convey an object code work under this section in, or with, or
 | 
				
			||||||
 | 
					specifically for use in, a User Product, and the conveying occurs as
 | 
				
			||||||
 | 
					part of a transaction in which the right of possession and use of the
 | 
				
			||||||
 | 
					User Product is transferred to the recipient in perpetuity or for a
 | 
				
			||||||
 | 
					fixed term (regardless of how the transaction is characterized), the
 | 
				
			||||||
 | 
					Corresponding Source conveyed under this section must be accompanied
 | 
				
			||||||
 | 
					by the Installation Information.  But this requirement does not apply
 | 
				
			||||||
 | 
					if neither you nor any third party retains the ability to install
 | 
				
			||||||
 | 
					modified object code on the User Product (for example, the work has
 | 
				
			||||||
 | 
					been installed in ROM).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The requirement to provide Installation Information does not include a
 | 
				
			||||||
 | 
					requirement to continue to provide support service, warranty, or updates
 | 
				
			||||||
 | 
					for a work that has been modified or installed by the recipient, or for
 | 
				
			||||||
 | 
					the User Product in which it has been modified or installed.  Access to a
 | 
				
			||||||
 | 
					network may be denied when the modification itself materially and
 | 
				
			||||||
 | 
					adversely affects the operation of the network or violates the rules and
 | 
				
			||||||
 | 
					protocols for communication across the network.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Corresponding Source conveyed, and Installation Information provided,
 | 
				
			||||||
 | 
					in accord with this section must be in a format that is publicly
 | 
				
			||||||
 | 
					documented (and with an implementation available to the public in
 | 
				
			||||||
 | 
					source code form), and must require no special password or key for
 | 
				
			||||||
 | 
					unpacking, reading or copying.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  7. Additional Terms.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  "Additional permissions" are terms that supplement the terms of this
 | 
				
			||||||
 | 
					License by making exceptions from one or more of its conditions.
 | 
				
			||||||
 | 
					Additional permissions that are applicable to the entire Program shall
 | 
				
			||||||
 | 
					be treated as though they were included in this License, to the extent
 | 
				
			||||||
 | 
					that they are valid under applicable law.  If additional permissions
 | 
				
			||||||
 | 
					apply only to part of the Program, that part may be used separately
 | 
				
			||||||
 | 
					under those permissions, but the entire Program remains governed by
 | 
				
			||||||
 | 
					this License without regard to the additional permissions.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  When you convey a copy of a covered work, you may at your option
 | 
				
			||||||
 | 
					remove any additional permissions from that copy, or from any part of
 | 
				
			||||||
 | 
					it.  (Additional permissions may be written to require their own
 | 
				
			||||||
 | 
					removal in certain cases when you modify the work.)  You may place
 | 
				
			||||||
 | 
					additional permissions on material, added by you to a covered work,
 | 
				
			||||||
 | 
					for which you have or can give appropriate copyright permission.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Notwithstanding any other provision of this License, for material you
 | 
				
			||||||
 | 
					add to a covered work, you may (if authorized by the copyright holders of
 | 
				
			||||||
 | 
					that material) supplement the terms of this License with terms:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    a) Disclaiming warranty or limiting liability differently from the
 | 
				
			||||||
 | 
					    terms of sections 15 and 16 of this License; or
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    b) Requiring preservation of specified reasonable legal notices or
 | 
				
			||||||
 | 
					    author attributions in that material or in the Appropriate Legal
 | 
				
			||||||
 | 
					    Notices displayed by works containing it; or
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    c) Prohibiting misrepresentation of the origin of that material, or
 | 
				
			||||||
 | 
					    requiring that modified versions of such material be marked in
 | 
				
			||||||
 | 
					    reasonable ways as different from the original version; or
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    d) Limiting the use for publicity purposes of names of licensors or
 | 
				
			||||||
 | 
					    authors of the material; or
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    e) Declining to grant rights under trademark law for use of some
 | 
				
			||||||
 | 
					    trade names, trademarks, or service marks; or
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    f) Requiring indemnification of licensors and authors of that
 | 
				
			||||||
 | 
					    material by anyone who conveys the material (or modified versions of
 | 
				
			||||||
 | 
					    it) with contractual assumptions of liability to the recipient, for
 | 
				
			||||||
 | 
					    any liability that these contractual assumptions directly impose on
 | 
				
			||||||
 | 
					    those licensors and authors.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  All other non-permissive additional terms are considered "further
 | 
				
			||||||
 | 
					restrictions" within the meaning of section 10.  If the Program as you
 | 
				
			||||||
 | 
					received it, or any part of it, contains a notice stating that it is
 | 
				
			||||||
 | 
					governed by this License along with a term that is a further
 | 
				
			||||||
 | 
					restriction, you may remove that term.  If a license document contains
 | 
				
			||||||
 | 
					a further restriction but permits relicensing or conveying under this
 | 
				
			||||||
 | 
					License, you may add to a covered work material governed by the terms
 | 
				
			||||||
 | 
					of that license document, provided that the further restriction does
 | 
				
			||||||
 | 
					not survive such relicensing or conveying.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  If you add terms to a covered work in accord with this section, you
 | 
				
			||||||
 | 
					must place, in the relevant source files, a statement of the
 | 
				
			||||||
 | 
					additional terms that apply to those files, or a notice indicating
 | 
				
			||||||
 | 
					where to find the applicable terms.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Additional terms, permissive or non-permissive, may be stated in the
 | 
				
			||||||
 | 
					form of a separately written license, or stated as exceptions;
 | 
				
			||||||
 | 
					the above requirements apply either way.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  8. Termination.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  You may not propagate or modify a covered work except as expressly
 | 
				
			||||||
 | 
					provided under this License.  Any attempt otherwise to propagate or
 | 
				
			||||||
 | 
					modify it is void, and will automatically terminate your rights under
 | 
				
			||||||
 | 
					this License (including any patent licenses granted under the third
 | 
				
			||||||
 | 
					paragraph of section 11).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  However, if you cease all violation of this License, then your
 | 
				
			||||||
 | 
					license from a particular copyright holder is reinstated (a)
 | 
				
			||||||
 | 
					provisionally, unless and until the copyright holder explicitly and
 | 
				
			||||||
 | 
					finally terminates your license, and (b) permanently, if the copyright
 | 
				
			||||||
 | 
					holder fails to notify you of the violation by some reasonable means
 | 
				
			||||||
 | 
					prior to 60 days after the cessation.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Moreover, your license from a particular copyright holder is
 | 
				
			||||||
 | 
					reinstated permanently if the copyright holder notifies you of the
 | 
				
			||||||
 | 
					violation by some reasonable means, this is the first time you have
 | 
				
			||||||
 | 
					received notice of violation of this License (for any work) from that
 | 
				
			||||||
 | 
					copyright holder, and you cure the violation prior to 30 days after
 | 
				
			||||||
 | 
					your receipt of the notice.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Termination of your rights under this section does not terminate the
 | 
				
			||||||
 | 
					licenses of parties who have received copies or rights from you under
 | 
				
			||||||
 | 
					this License.  If your rights have been terminated and not permanently
 | 
				
			||||||
 | 
					reinstated, you do not qualify to receive new licenses for the same
 | 
				
			||||||
 | 
					material under section 10.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  9. Acceptance Not Required for Having Copies.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  You are not required to accept this License in order to receive or
 | 
				
			||||||
 | 
					run a copy of the Program.  Ancillary propagation of a covered work
 | 
				
			||||||
 | 
					occurring solely as a consequence of using peer-to-peer transmission
 | 
				
			||||||
 | 
					to receive a copy likewise does not require acceptance.  However,
 | 
				
			||||||
 | 
					nothing other than this License grants you permission to propagate or
 | 
				
			||||||
 | 
					modify any covered work.  These actions infringe copyright if you do
 | 
				
			||||||
 | 
					not accept this License.  Therefore, by modifying or propagating a
 | 
				
			||||||
 | 
					covered work, you indicate your acceptance of this License to do so.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  10. Automatic Licensing of Downstream Recipients.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Each time you convey a covered work, the recipient automatically
 | 
				
			||||||
 | 
					receives a license from the original licensors, to run, modify and
 | 
				
			||||||
 | 
					propagate that work, subject to this License.  You are not responsible
 | 
				
			||||||
 | 
					for enforcing compliance by third parties with this License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  An "entity transaction" is a transaction transferring control of an
 | 
				
			||||||
 | 
					organization, or substantially all assets of one, or subdividing an
 | 
				
			||||||
 | 
					organization, or merging organizations.  If propagation of a covered
 | 
				
			||||||
 | 
					work results from an entity transaction, each party to that
 | 
				
			||||||
 | 
					transaction who receives a copy of the work also receives whatever
 | 
				
			||||||
 | 
					licenses to the work the party's predecessor in interest had or could
 | 
				
			||||||
 | 
					give under the previous paragraph, plus a right to possession of the
 | 
				
			||||||
 | 
					Corresponding Source of the work from the predecessor in interest, if
 | 
				
			||||||
 | 
					the predecessor has it or can get it with reasonable efforts.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  You may not impose any further restrictions on the exercise of the
 | 
				
			||||||
 | 
					rights granted or affirmed under this License.  For example, you may
 | 
				
			||||||
 | 
					not impose a license fee, royalty, or other charge for exercise of
 | 
				
			||||||
 | 
					rights granted under this License, and you may not initiate litigation
 | 
				
			||||||
 | 
					(including a cross-claim or counterclaim in a lawsuit) alleging that
 | 
				
			||||||
 | 
					any patent claim is infringed by making, using, selling, offering for
 | 
				
			||||||
 | 
					sale, or importing the Program or any portion of it.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  11. Patents.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  A "contributor" is a copyright holder who authorizes use under this
 | 
				
			||||||
 | 
					License of the Program or a work on which the Program is based.  The
 | 
				
			||||||
 | 
					work thus licensed is called the contributor's "contributor version".
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  A contributor's "essential patent claims" are all patent claims
 | 
				
			||||||
 | 
					owned or controlled by the contributor, whether already acquired or
 | 
				
			||||||
 | 
					hereafter acquired, that would be infringed by some manner, permitted
 | 
				
			||||||
 | 
					by this License, of making, using, or selling its contributor version,
 | 
				
			||||||
 | 
					but do not include claims that would be infringed only as a
 | 
				
			||||||
 | 
					consequence of further modification of the contributor version.  For
 | 
				
			||||||
 | 
					purposes of this definition, "control" includes the right to grant
 | 
				
			||||||
 | 
					patent sublicenses in a manner consistent with the requirements of
 | 
				
			||||||
 | 
					this License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Each contributor grants you a non-exclusive, worldwide, royalty-free
 | 
				
			||||||
 | 
					patent license under the contributor's essential patent claims, to
 | 
				
			||||||
 | 
					make, use, sell, offer for sale, import and otherwise run, modify and
 | 
				
			||||||
 | 
					propagate the contents of its contributor version.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  In the following three paragraphs, a "patent license" is any express
 | 
				
			||||||
 | 
					agreement or commitment, however denominated, not to enforce a patent
 | 
				
			||||||
 | 
					(such as an express permission to practice a patent or covenant not to
 | 
				
			||||||
 | 
					sue for patent infringement).  To "grant" such a patent license to a
 | 
				
			||||||
 | 
					party means to make such an agreement or commitment not to enforce a
 | 
				
			||||||
 | 
					patent against the party.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  If you convey a covered work, knowingly relying on a patent license,
 | 
				
			||||||
 | 
					and the Corresponding Source of the work is not available for anyone
 | 
				
			||||||
 | 
					to copy, free of charge and under the terms of this License, through a
 | 
				
			||||||
 | 
					publicly available network server or other readily accessible means,
 | 
				
			||||||
 | 
					then you must either (1) cause the Corresponding Source to be so
 | 
				
			||||||
 | 
					available, or (2) arrange to deprive yourself of the benefit of the
 | 
				
			||||||
 | 
					patent license for this particular work, or (3) arrange, in a manner
 | 
				
			||||||
 | 
					consistent with the requirements of this License, to extend the patent
 | 
				
			||||||
 | 
					license to downstream recipients.  "Knowingly relying" means you have
 | 
				
			||||||
 | 
					actual knowledge that, but for the patent license, your conveying the
 | 
				
			||||||
 | 
					covered work in a country, or your recipient's use of the covered work
 | 
				
			||||||
 | 
					in a country, would infringe one or more identifiable patents in that
 | 
				
			||||||
 | 
					country that you have reason to believe are valid.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  If, pursuant to or in connection with a single transaction or
 | 
				
			||||||
 | 
					arrangement, you convey, or propagate by procuring conveyance of, a
 | 
				
			||||||
 | 
					covered work, and grant a patent license to some of the parties
 | 
				
			||||||
 | 
					receiving the covered work authorizing them to use, propagate, modify
 | 
				
			||||||
 | 
					or convey a specific copy of the covered work, then the patent license
 | 
				
			||||||
 | 
					you grant is automatically extended to all recipients of the covered
 | 
				
			||||||
 | 
					work and works based on it.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  A patent license is "discriminatory" if it does not include within
 | 
				
			||||||
 | 
					the scope of its coverage, prohibits the exercise of, or is
 | 
				
			||||||
 | 
					conditioned on the non-exercise of one or more of the rights that are
 | 
				
			||||||
 | 
					specifically granted under this License.  You may not convey a covered
 | 
				
			||||||
 | 
					work if you are a party to an arrangement with a third party that is
 | 
				
			||||||
 | 
					in the business of distributing software, under which you make payment
 | 
				
			||||||
 | 
					to the third party based on the extent of your activity of conveying
 | 
				
			||||||
 | 
					the work, and under which the third party grants, to any of the
 | 
				
			||||||
 | 
					parties who would receive the covered work from you, a discriminatory
 | 
				
			||||||
 | 
					patent license (a) in connection with copies of the covered work
 | 
				
			||||||
 | 
					conveyed by you (or copies made from those copies), or (b) primarily
 | 
				
			||||||
 | 
					for and in connection with specific products or compilations that
 | 
				
			||||||
 | 
					contain the covered work, unless you entered into that arrangement,
 | 
				
			||||||
 | 
					or that patent license was granted, prior to 28 March 2007.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Nothing in this License shall be construed as excluding or limiting
 | 
				
			||||||
 | 
					any implied license or other defenses to infringement that may
 | 
				
			||||||
 | 
					otherwise be available to you under applicable patent law.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  12. No Surrender of Others' Freedom.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  If conditions are imposed on you (whether by court order, agreement or
 | 
				
			||||||
 | 
					otherwise) that contradict the conditions of this License, they do not
 | 
				
			||||||
 | 
					excuse you from the conditions of this License.  If you cannot convey a
 | 
				
			||||||
 | 
					covered work so as to satisfy simultaneously your obligations under this
 | 
				
			||||||
 | 
					License and any other pertinent obligations, then as a consequence you may
 | 
				
			||||||
 | 
					not convey it at all.  For example, if you agree to terms that obligate you
 | 
				
			||||||
 | 
					to collect a royalty for further conveying from those to whom you convey
 | 
				
			||||||
 | 
					the Program, the only way you could satisfy both those terms and this
 | 
				
			||||||
 | 
					License would be to refrain entirely from conveying the Program.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  13. Use with the GNU Affero General Public License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Notwithstanding any other provision of this License, you have
 | 
				
			||||||
 | 
					permission to link or combine any covered work with a work licensed
 | 
				
			||||||
 | 
					under version 3 of the GNU Affero General Public License into a single
 | 
				
			||||||
 | 
					combined work, and to convey the resulting work.  The terms of this
 | 
				
			||||||
 | 
					License will continue to apply to the part which is the covered work,
 | 
				
			||||||
 | 
					but the special requirements of the GNU Affero General Public License,
 | 
				
			||||||
 | 
					section 13, concerning interaction through a network will apply to the
 | 
				
			||||||
 | 
					combination as such.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  14. Revised Versions of this License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The Free Software Foundation may publish revised and/or new versions of
 | 
				
			||||||
 | 
					the GNU General Public License from time to time.  Such new versions will
 | 
				
			||||||
 | 
					be similar in spirit to the present version, but may differ in detail to
 | 
				
			||||||
 | 
					address new problems or concerns.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Each version is given a distinguishing version number.  If the
 | 
				
			||||||
 | 
					Program specifies that a certain numbered version of the GNU General
 | 
				
			||||||
 | 
					Public License "or any later version" applies to it, you have the
 | 
				
			||||||
 | 
					option of following the terms and conditions either of that numbered
 | 
				
			||||||
 | 
					version or of any later version published by the Free Software
 | 
				
			||||||
 | 
					Foundation.  If the Program does not specify a version number of the
 | 
				
			||||||
 | 
					GNU General Public License, you may choose any version ever published
 | 
				
			||||||
 | 
					by the Free Software Foundation.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  If the Program specifies that a proxy can decide which future
 | 
				
			||||||
 | 
					versions of the GNU General Public License can be used, that proxy's
 | 
				
			||||||
 | 
					public statement of acceptance of a version permanently authorizes you
 | 
				
			||||||
 | 
					to choose that version for the Program.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Later license versions may give you additional or different
 | 
				
			||||||
 | 
					permissions.  However, no additional obligations are imposed on any
 | 
				
			||||||
 | 
					author or copyright holder as a result of your choosing to follow a
 | 
				
			||||||
 | 
					later version.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  15. Disclaimer of Warranty.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
 | 
				
			||||||
 | 
					APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
 | 
				
			||||||
 | 
					HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
 | 
				
			||||||
 | 
					OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
 | 
				
			||||||
 | 
					THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
				
			||||||
 | 
					PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
 | 
				
			||||||
 | 
					IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
 | 
				
			||||||
 | 
					ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  16. Limitation of Liability.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
 | 
				
			||||||
 | 
					WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
 | 
				
			||||||
 | 
					THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
 | 
				
			||||||
 | 
					GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
 | 
				
			||||||
 | 
					USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
 | 
				
			||||||
 | 
					DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
 | 
				
			||||||
 | 
					PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
 | 
				
			||||||
 | 
					EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
 | 
				
			||||||
 | 
					SUCH DAMAGES.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  17. Interpretation of Sections 15 and 16.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  If the disclaimer of warranty and limitation of liability provided
 | 
				
			||||||
 | 
					above cannot be given local legal effect according to their terms,
 | 
				
			||||||
 | 
					reviewing courts shall apply local law that most closely approximates
 | 
				
			||||||
 | 
					an absolute waiver of all civil liability in connection with the
 | 
				
			||||||
 | 
					Program, unless a warranty or assumption of liability accompanies a
 | 
				
			||||||
 | 
					copy of the Program in return for a fee.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                     END OF TERMS AND CONDITIONS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            How to Apply These Terms to Your New Programs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  If you develop a new program, and you want it to be of the greatest
 | 
				
			||||||
 | 
					possible use to the public, the best way to achieve this is to make it
 | 
				
			||||||
 | 
					free software which everyone can redistribute and change under these terms.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  To do so, attach the following notices to the program.  It is safest
 | 
				
			||||||
 | 
					to attach them to the start of each source file to most effectively
 | 
				
			||||||
 | 
					state the exclusion of warranty; and each file should have at least
 | 
				
			||||||
 | 
					the "copyright" line and a pointer to where the full notice is found.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <one line to give the program's name and a brief idea of what it does.>
 | 
				
			||||||
 | 
					    Copyright (C) <year>  <name of author>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    This program is free software: you can redistribute it and/or modify
 | 
				
			||||||
 | 
					    it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 | 
					    the Free Software Foundation, either version 3 of the License, or
 | 
				
			||||||
 | 
					    (at your option) any later version.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    This program is distributed in the hope that it will be useful,
 | 
				
			||||||
 | 
					    but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
				
			||||||
 | 
					    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
				
			||||||
 | 
					    GNU General Public License for more details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    You should have received a copy of the GNU General Public License
 | 
				
			||||||
 | 
					    along with this program.  If not, see <https://www.gnu.org/licenses/>.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Also add information on how to contact you by electronic and paper mail.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  If the program does terminal interaction, make it output a short
 | 
				
			||||||
 | 
					notice like this when it starts in an interactive mode:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <program>  Copyright (C) <year>  <name of author>
 | 
				
			||||||
 | 
					    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
 | 
				
			||||||
 | 
					    This is free software, and you are welcome to redistribute it
 | 
				
			||||||
 | 
					    under certain conditions; type `show c' for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					The hypothetical commands `show w' and `show c' should show the appropriate
 | 
				
			||||||
 | 
					parts of the General Public License.  Of course, your program's commands
 | 
				
			||||||
 | 
					might be different; for a GUI interface, you would use an "about box".
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  You should also get your employer (if you work as a programmer) or school,
 | 
				
			||||||
 | 
					if any, to sign a "copyright disclaimer" for the program, if necessary.
 | 
				
			||||||
 | 
					For more information on this, and how to apply and follow the GNU GPL, see
 | 
				
			||||||
 | 
					<https://www.gnu.org/licenses/>.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The GNU General Public License does not permit incorporating your program
 | 
				
			||||||
 | 
					into proprietary programs.  If your program is a subroutine library, you
 | 
				
			||||||
 | 
					may consider it more useful to permit linking proprietary applications with
 | 
				
			||||||
 | 
					the library.  If this is what you want to do, use the GNU Lesser General
 | 
				
			||||||
 | 
					Public License instead of this License.  But first, please read
 | 
				
			||||||
 | 
					<https://www.gnu.org/licenses/why-not-lgpl.html>.
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										35
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								Makefile
									
									
									
									
									
								
							@ -1,26 +1,43 @@
 | 
				
			|||||||
all: lint-fix lint coverage gen
 | 
					all: lint-fix lint coverage gen
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test-full:
 | 
				
			||||||
 | 
						coverage run manage.py test --failfast -v 3 .
 | 
				
			||||||
 | 
						coverage html
 | 
				
			||||||
 | 
						coverage report
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test-integration:
 | 
				
			||||||
 | 
						k3d cluster create || exit 0
 | 
				
			||||||
 | 
						k3d kubeconfig write -o ~/.kube/config --overwrite
 | 
				
			||||||
 | 
						coverage run manage.py test --failfast -v 3 tests/integration
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test-e2e:
 | 
				
			||||||
 | 
						coverage run manage.py test --failfast -v 3 tests/e2e
 | 
				
			||||||
 | 
					
 | 
				
			||||||
coverage:
 | 
					coverage:
 | 
				
			||||||
	coverage run --concurrency=multiprocessing manage.py test --failfast -v 3
 | 
						coverage run manage.py test --failfast -v 3 authentik
 | 
				
			||||||
	coverage combine
 | 
					 | 
				
			||||||
	coverage html
 | 
						coverage html
 | 
				
			||||||
	coverage report
 | 
						coverage report
 | 
				
			||||||
 | 
					
 | 
				
			||||||
lint-fix:
 | 
					lint-fix:
 | 
				
			||||||
	isort -rc .
 | 
						isort -rc authentik tests lifecycle
 | 
				
			||||||
	black passbook e2e lifecycle
 | 
						black authentik tests lifecycle
 | 
				
			||||||
 | 
					
 | 
				
			||||||
lint:
 | 
					lint:
 | 
				
			||||||
	pyright passbook e2e lifecycle
 | 
						pyright authentik tests lifecycle
 | 
				
			||||||
	bandit -r passbook e2e lifecycle
 | 
						bandit -r authentik tests lifecycle -x node_modules
 | 
				
			||||||
	pylint passbook e2e lifecycle
 | 
						pylint authentik tests lifecycle
 | 
				
			||||||
	prospector
 | 
						prospector
 | 
				
			||||||
 | 
					
 | 
				
			||||||
gen: coverage
 | 
					gen: coverage
 | 
				
			||||||
	./manage.py generate_swagger -o swagger.yaml -f yaml
 | 
						./manage.py generate_swagger -o swagger.yaml -f yaml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local-stack:
 | 
					local-stack:
 | 
				
			||||||
	export PASSBOOK_TAG=testing
 | 
						export AUTHENTIK_TAG=testing
 | 
				
			||||||
	docker build -t beryju/passbook:testng .
 | 
						docker build -t beryju/authentik:testng .
 | 
				
			||||||
	docker-compose up -d
 | 
						docker-compose up -d
 | 
				
			||||||
	docker-compose run --rm server migrate
 | 
						docker-compose run --rm server migrate
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					build-static:
 | 
				
			||||||
 | 
						docker-compose -f scripts/ci.docker-compose.yml up -d
 | 
				
			||||||
 | 
						docker build -t beryju/authentik-static -f static.Dockerfile --network=scripts_default .
 | 
				
			||||||
 | 
						docker-compose -f scripts/ci.docker-compose.yml down -v
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										4
									
								
								Pipfile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								Pipfile
									
									
									
									
									
								
							@ -35,7 +35,6 @@ qrcode = "*"
 | 
				
			|||||||
requests-oauthlib = "*"
 | 
					requests-oauthlib = "*"
 | 
				
			||||||
sentry-sdk = "*"
 | 
					sentry-sdk = "*"
 | 
				
			||||||
service_identity = "*"
 | 
					service_identity = "*"
 | 
				
			||||||
signxml = "*"
 | 
					 | 
				
			||||||
structlog = "*"
 | 
					structlog = "*"
 | 
				
			||||||
swagger-spec-validator = "*"
 | 
					swagger-spec-validator = "*"
 | 
				
			||||||
urllib3 = {extras = ["secure"],version = "*"}
 | 
					urllib3 = {extras = ["secure"],version = "*"}
 | 
				
			||||||
@ -44,9 +43,10 @@ channels = "*"
 | 
				
			|||||||
channels-redis = "*"
 | 
					channels-redis = "*"
 | 
				
			||||||
kubernetes = "*"
 | 
					kubernetes = "*"
 | 
				
			||||||
docker = "*"
 | 
					docker = "*"
 | 
				
			||||||
 | 
					xmlsec = "*"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[requires]
 | 
					[requires]
 | 
				
			||||||
python_version = "3.8"
 | 
					python_version = "3.9"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[dev-packages]
 | 
					[dev-packages]
 | 
				
			||||||
autopep8 = "*"
 | 
					autopep8 = "*"
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										1107
									
								
								Pipfile.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1107
									
								
								Pipfile.lock
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										53
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										53
									
								
								README.md
									
									
									
									
									
								
							@ -1,53 +1,32 @@
 | 
				
			|||||||
<img src="docs/images/logo.svg" height="50" alt="passbook logo"><img src="docs/images/brand_inverted.svg" height="50" alt="passbook">
 | 
					<img src="https://goauthentik.io/img/icon_top_brand_colour.svg" height="250" alt="authentik logo">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[](https://dev.azure.com/beryjuorg/passbook/_build?definitionId=1)
 | 
					---
 | 
				
			||||||

 | 
					 | 
				
			||||||
[](https://codecov.io/gh/BeryJu/passbook)
 | 
					 | 
				
			||||||

 | 
					 | 
				
			||||||

 | 
					 | 
				
			||||||

 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## What is passbook?
 | 
					[](https://dev.azure.com/beryjuorg/authentik/_build?definitionId=1)
 | 
				
			||||||
 | 
					[](https://dev.azure.com/beryjuorg/authentik/_build?definitionId=1)
 | 
				
			||||||
 | 
					[](https://codecov.io/gh/BeryJu/authentik)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
passbook is an open-source Identity Provider focused on flexibility and versatility. You can use passbook in an existing environment to add support for new protocols. passbook is also a great solution for implementing signup/recovery/etc in your application, so you don't have to deal with it.
 | 
					## What is authentik?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					authentik is an open-source Identity Provider focused on flexibility and versatility. You can use authentik in an existing environment to add support for new protocols. authentik is also a great solution for implementing signup/recovery/etc in your application, so you don't have to deal with it.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Installation
 | 
					## Installation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
For small/test setups it is recommended to use docker-compose, see the [documentation](https://passbook.beryju.org/installation/docker-compose/)
 | 
					For small/test setups it is recommended to use docker-compose, see the [documentation](https://goauthentik.io/docs/installation/docker-compose/)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
For bigger setups, there is a Helm Chart in the `helm/` directory. This is documented [here](https://passbook.beryju.org//installation/kubernetes/)
 | 
					For bigger setups, there is a Helm Chart in the `helm/` directory. This is documented [here](https://goauthentik.io/docs/installation/kubernetes/)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Screenshots
 | 
					## Screenshots
 | 
				
			||||||
 | 
					
 | 
				
			||||||

 | 
					
 | 
				
			||||||

 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Development
 | 
					## Development
 | 
				
			||||||
 | 
					
 | 
				
			||||||
To develop on passbook, you need a system with Python 3.7+ (3.8 is recommended). passbook uses [pipenv](https://pipenv.pypa.io/en/latest/) for managing dependencies.
 | 
					See [Development Documentation](https://goauthentik.io/docs/development/local-dev-environment)
 | 
				
			||||||
 | 
					 | 
				
			||||||
To get started, run
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
python3 -m pip install pipenv
 | 
					 | 
				
			||||||
git clone https://github.com/BeryJu/passbook.git
 | 
					 | 
				
			||||||
cd passbook
 | 
					 | 
				
			||||||
pipenv shell
 | 
					 | 
				
			||||||
pipenv sync -d
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Since passbook uses PostgreSQL-specific fields, you also need a local PostgreSQL instance to develop. passbook also uses redis for caching and message queueing.
 | 
					 | 
				
			||||||
For these databases you can use [Postgres.app](https://postgresapp.com/) and [Redis.app](https://jpadilla.github.io/redisapp/) on macOS or use it the docker-compose file in `scripts/docker-compose.yml`.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
To tell passbook about these databases, create a file in the project root called `local.env.yml` with the following contents:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
```yaml
 | 
					 | 
				
			||||||
debug: true
 | 
					 | 
				
			||||||
postgresql:
 | 
					 | 
				
			||||||
  user: postgres
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
log_level: debug
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Security
 | 
					## Security
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										10
									
								
								SECURITY.md
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								SECURITY.md
									
									
									
									
									
								
							@ -2,13 +2,11 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
## Supported Versions
 | 
					## Supported Versions
 | 
				
			||||||
 | 
					
 | 
				
			||||||
As passbook is currently in a pre-stable, only the latest "stable" version is supported. After passbook 1.0, this will change.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| Version    | Supported          |
 | 
					| Version    | Supported          |
 | 
				
			||||||
| -------- | ------------------ |
 | 
					| ---------- | ------------------ |
 | 
				
			||||||
| 0.10.x   | :white_check_mark: |
 | 
					| 0.13.x     | :white_check_mark: |
 | 
				
			||||||
| 0.11.x   | :white_check_mark: |
 | 
					| 0.14.x     | :white_check_mark: |
 | 
				
			||||||
| 0.12.x   | :white_check_mark: |
 | 
					| 2021.1.x   | :white_check_mark: |
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Reporting a Vulnerability
 | 
					## Reporting a Vulnerability
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								authentik/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								authentik/__init__.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,2 @@
 | 
				
			|||||||
 | 
					"""authentik"""
 | 
				
			||||||
 | 
					__version__ = "2021.1.1-stable"
 | 
				
			||||||
							
								
								
									
										78
									
								
								authentik/admin/api/metrics.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								authentik/admin/api/metrics.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,78 @@
 | 
				
			|||||||
 | 
					"""authentik administration metrics"""
 | 
				
			||||||
 | 
					import time
 | 
				
			||||||
 | 
					from collections import Counter
 | 
				
			||||||
 | 
					from datetime import timedelta
 | 
				
			||||||
 | 
					from typing import Dict, List
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from django.db.models import Count, ExpressionWrapper, F, Model
 | 
				
			||||||
 | 
					from django.db.models.fields import DurationField
 | 
				
			||||||
 | 
					from django.db.models.functions import ExtractHour
 | 
				
			||||||
 | 
					from django.utils.timezone import now
 | 
				
			||||||
 | 
					from drf_yasg2.utils import swagger_auto_schema
 | 
				
			||||||
 | 
					from rest_framework.fields import SerializerMethodField
 | 
				
			||||||
 | 
					from rest_framework.permissions import IsAdminUser
 | 
				
			||||||
 | 
					from rest_framework.request import Request
 | 
				
			||||||
 | 
					from rest_framework.response import Response
 | 
				
			||||||
 | 
					from rest_framework.serializers import Serializer
 | 
				
			||||||
 | 
					from rest_framework.viewsets import ViewSet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from authentik.events.models import Event, EventAction
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def get_events_per_1h(**filter_kwargs) -> List[Dict[str, int]]:
 | 
				
			||||||
 | 
					    """Get event count by hour in the last day, fill with zeros"""
 | 
				
			||||||
 | 
					    date_from = now() - timedelta(days=1)
 | 
				
			||||||
 | 
					    result = (
 | 
				
			||||||
 | 
					        Event.objects.filter(created__gte=date_from, **filter_kwargs)
 | 
				
			||||||
 | 
					        .annotate(
 | 
				
			||||||
 | 
					            age=ExpressionWrapper(now() - F("created"), output_field=DurationField())
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					        .annotate(age_hours=ExtractHour("age"))
 | 
				
			||||||
 | 
					        .values("age_hours")
 | 
				
			||||||
 | 
					        .annotate(count=Count("pk"))
 | 
				
			||||||
 | 
					        .order_by("age_hours")
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					    data = Counter({d["age_hours"]: d["count"] for d in result})
 | 
				
			||||||
 | 
					    results = []
 | 
				
			||||||
 | 
					    _now = now()
 | 
				
			||||||
 | 
					    for hour in range(0, -24, -1):
 | 
				
			||||||
 | 
					        results.append(
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                "x": time.mktime((_now + timedelta(hours=hour)).timetuple()) * 1000,
 | 
				
			||||||
 | 
					                "y": data[hour * -1],
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					    return results
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class AdministrationMetricsSerializer(Serializer):
 | 
				
			||||||
 | 
					    """Login Metrics per 1h"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    logins_per_1h = SerializerMethodField()
 | 
				
			||||||
 | 
					    logins_failed_per_1h = SerializerMethodField()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get_logins_per_1h(self, _):
 | 
				
			||||||
 | 
					        """Get successful logins per hour for the last 24 hours"""
 | 
				
			||||||
 | 
					        return get_events_per_1h(action=EventAction.LOGIN)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get_logins_failed_per_1h(self, _):
 | 
				
			||||||
 | 
					        """Get failed logins per hour for the last 24 hours"""
 | 
				
			||||||
 | 
					        return get_events_per_1h(action=EventAction.LOGIN_FAILED)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def create(self, validated_data: dict) -> Model:
 | 
				
			||||||
 | 
					        raise NotImplementedError
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def update(self, instance: Model, validated_data: dict) -> Model:
 | 
				
			||||||
 | 
					        raise NotImplementedError
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class AdministrationMetricsViewSet(ViewSet):
 | 
				
			||||||
 | 
					    """Login Metrics per 1h"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    permission_classes = [IsAdminUser]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @swagger_auto_schema(responses={200: AdministrationMetricsSerializer(many=True)})
 | 
				
			||||||
 | 
					    def list(self, request: Request) -> Response:
 | 
				
			||||||
 | 
					        """Login Metrics per 1h"""
 | 
				
			||||||
 | 
					        serializer = AdministrationMetricsSerializer(True)
 | 
				
			||||||
 | 
					        return Response(serializer.data)
 | 
				
			||||||
@ -2,6 +2,7 @@
 | 
				
			|||||||
from importlib import import_module
 | 
					from importlib import import_module
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from django.contrib import messages
 | 
					from django.contrib import messages
 | 
				
			||||||
 | 
					from django.db.models import Model
 | 
				
			||||||
from django.http.response import Http404
 | 
					from django.http.response import Http404
 | 
				
			||||||
from django.utils.translation import gettext_lazy as _
 | 
					from django.utils.translation import gettext_lazy as _
 | 
				
			||||||
from drf_yasg2.utils import swagger_auto_schema
 | 
					from drf_yasg2.utils import swagger_auto_schema
 | 
				
			||||||
@ -13,7 +14,7 @@ from rest_framework.response import Response
 | 
				
			|||||||
from rest_framework.serializers import Serializer
 | 
					from rest_framework.serializers import Serializer
 | 
				
			||||||
from rest_framework.viewsets import ViewSet
 | 
					from rest_framework.viewsets import ViewSet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.lib.tasks import TaskInfo
 | 
					from authentik.lib.tasks import TaskInfo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TaskSerializer(Serializer):
 | 
					class TaskSerializer(Serializer):
 | 
				
			||||||
@ -26,10 +27,10 @@ class TaskSerializer(Serializer):
 | 
				
			|||||||
    status = IntegerField(source="result.status.value")
 | 
					    status = IntegerField(source="result.status.value")
 | 
				
			||||||
    messages = ListField(source="result.messages")
 | 
					    messages = ListField(source="result.messages")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def create(self, request: Request) -> Response:
 | 
					    def create(self, validated_data: dict) -> Model:
 | 
				
			||||||
        raise NotImplementedError
 | 
					        raise NotImplementedError
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def update(self, request: Request) -> Response:
 | 
					    def update(self, instance: Model, validated_data: dict) -> Model:
 | 
				
			||||||
        raise NotImplementedError
 | 
					        raise NotImplementedError
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -50,15 +51,23 @@ class TaskViewSet(ViewSet):
 | 
				
			|||||||
        task = TaskInfo.by_name(pk)
 | 
					        task = TaskInfo.by_name(pk)
 | 
				
			||||||
        if not task:
 | 
					        if not task:
 | 
				
			||||||
            raise Http404
 | 
					            raise Http404
 | 
				
			||||||
 | 
					        try:
 | 
				
			||||||
            task_module = import_module(task.task_call_module)
 | 
					            task_module = import_module(task.task_call_module)
 | 
				
			||||||
            task_func = getattr(task_module, task.task_call_func)
 | 
					            task_func = getattr(task_module, task.task_call_func)
 | 
				
			||||||
            task_func.delay(*task.task_call_args, **task.task_call_kwargs)
 | 
					            task_func.delay(*task.task_call_args, **task.task_call_kwargs)
 | 
				
			||||||
            messages.success(
 | 
					            messages.success(
 | 
				
			||||||
                self.request,
 | 
					                self.request,
 | 
				
			||||||
            _("Successfully re-scheduled Task %(name)s!" % {"name": task.task_name}),
 | 
					                _(
 | 
				
			||||||
 | 
					                    "Successfully re-scheduled Task %(name)s!"
 | 
				
			||||||
 | 
					                    % {"name": task.task_name}
 | 
				
			||||||
 | 
					                ),
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
            return Response(
 | 
					            return Response(
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    "successful": True,
 | 
					                    "successful": True,
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
 | 
					        except ImportError:  # pragma: no cover
 | 
				
			||||||
 | 
					            # if we get an import error, the module path has probably changed
 | 
				
			||||||
 | 
					            task.delete()
 | 
				
			||||||
 | 
					            return Response({"successful": False})
 | 
				
			||||||
							
								
								
									
										61
									
								
								authentik/admin/api/version.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								authentik/admin/api/version.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,61 @@
 | 
				
			|||||||
 | 
					"""authentik administration overview"""
 | 
				
			||||||
 | 
					from django.core.cache import cache
 | 
				
			||||||
 | 
					from django.db.models import Model
 | 
				
			||||||
 | 
					from drf_yasg2.utils import swagger_auto_schema
 | 
				
			||||||
 | 
					from packaging.version import parse
 | 
				
			||||||
 | 
					from rest_framework.fields import SerializerMethodField
 | 
				
			||||||
 | 
					from rest_framework.mixins import ListModelMixin
 | 
				
			||||||
 | 
					from rest_framework.permissions import IsAdminUser
 | 
				
			||||||
 | 
					from rest_framework.request import Request
 | 
				
			||||||
 | 
					from rest_framework.response import Response
 | 
				
			||||||
 | 
					from rest_framework.serializers import Serializer
 | 
				
			||||||
 | 
					from rest_framework.viewsets import GenericViewSet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from authentik import __version__
 | 
				
			||||||
 | 
					from authentik.admin.tasks import VERSION_CACHE_KEY, update_latest_version
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class VersionSerializer(Serializer):
 | 
				
			||||||
 | 
					    """Get running and latest version."""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    version_current = SerializerMethodField()
 | 
				
			||||||
 | 
					    version_latest = SerializerMethodField()
 | 
				
			||||||
 | 
					    outdated = SerializerMethodField()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get_version_current(self, _) -> str:
 | 
				
			||||||
 | 
					        """Get current version"""
 | 
				
			||||||
 | 
					        return __version__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get_version_latest(self, _) -> str:
 | 
				
			||||||
 | 
					        """Get latest version from cache"""
 | 
				
			||||||
 | 
					        version_in_cache = cache.get(VERSION_CACHE_KEY)
 | 
				
			||||||
 | 
					        if not version_in_cache:  # pragma: no cover
 | 
				
			||||||
 | 
					            update_latest_version.delay()
 | 
				
			||||||
 | 
					            return __version__
 | 
				
			||||||
 | 
					        return version_in_cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get_outdated(self, instance) -> bool:
 | 
				
			||||||
 | 
					        """Check if we're running the latest version"""
 | 
				
			||||||
 | 
					        return parse(self.get_version_current(instance)) < parse(
 | 
				
			||||||
 | 
					            self.get_version_latest(instance)
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def create(self, validated_data: dict) -> Model:
 | 
				
			||||||
 | 
					        raise NotImplementedError
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def update(self, instance: Model, validated_data: dict) -> Model:
 | 
				
			||||||
 | 
					        raise NotImplementedError
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class VersionViewSet(ListModelMixin, GenericViewSet):
 | 
				
			||||||
 | 
					    """Get running and latest version."""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    permission_classes = [IsAdminUser]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get_queryset(self):  # pragma: no cover
 | 
				
			||||||
 | 
					        return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @swagger_auto_schema(responses={200: VersionSerializer(many=True)})
 | 
				
			||||||
 | 
					    def list(self, request: Request) -> Response:
 | 
				
			||||||
 | 
					        """Get running and latest version."""
 | 
				
			||||||
 | 
					        return Response(VersionSerializer(True).data)
 | 
				
			||||||
							
								
								
									
										25
									
								
								authentik/admin/api/workers.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								authentik/admin/api/workers.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,25 @@
 | 
				
			|||||||
 | 
					"""authentik administration overview"""
 | 
				
			||||||
 | 
					from rest_framework.mixins import ListModelMixin
 | 
				
			||||||
 | 
					from rest_framework.permissions import IsAdminUser
 | 
				
			||||||
 | 
					from rest_framework.request import Request
 | 
				
			||||||
 | 
					from rest_framework.response import Response
 | 
				
			||||||
 | 
					from rest_framework.serializers import Serializer
 | 
				
			||||||
 | 
					from rest_framework.viewsets import GenericViewSet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from authentik.root.celery import CELERY_APP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class WorkerViewSet(ListModelMixin, GenericViewSet):
 | 
				
			||||||
 | 
					    """Get currently connected worker count."""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    serializer_class = Serializer
 | 
				
			||||||
 | 
					    permission_classes = [IsAdminUser]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get_queryset(self):  # pragma: no cover
 | 
				
			||||||
 | 
					        return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def list(self, request: Request) -> Response:
 | 
				
			||||||
 | 
					        """Get currently connected worker count."""
 | 
				
			||||||
 | 
					        return Response(
 | 
				
			||||||
 | 
					            {"pagination": {"count": len(CELERY_APP.control.ping(timeout=0.5))}}
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
							
								
								
									
										11
									
								
								authentik/admin/apps.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								authentik/admin/apps.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,11 @@
 | 
				
			|||||||
 | 
					"""authentik admin app config"""
 | 
				
			||||||
 | 
					from django.apps import AppConfig
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class AuthentikAdminConfig(AppConfig):
 | 
				
			||||||
 | 
					    """authentik admin app config"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    name = "authentik.admin"
 | 
				
			||||||
 | 
					    label = "authentik_admin"
 | 
				
			||||||
 | 
					    mountpoint = "administration/"
 | 
				
			||||||
 | 
					    verbose_name = "authentik Admin"
 | 
				
			||||||
@ -36,15 +36,15 @@ class CodeMirrorWidget(forms.Textarea):
 | 
				
			|||||||
    # CodeMirror mode to enable
 | 
					    # CodeMirror mode to enable
 | 
				
			||||||
    mode: str
 | 
					    mode: str
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    template_name = "fields/codemirror.html"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __init__(self, *args, mode="yaml", **kwargs):
 | 
					    def __init__(self, *args, mode="yaml", **kwargs):
 | 
				
			||||||
        super().__init__(*args, **kwargs)
 | 
					        super().__init__(*args, **kwargs)
 | 
				
			||||||
        self.mode = mode
 | 
					        self.mode = mode
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def render(self, *args, **kwargs):
 | 
					    def render(self, *args, **kwargs):
 | 
				
			||||||
        attrs = kwargs.setdefault("attrs", {})
 | 
					        attrs = kwargs.setdefault("attrs", {})
 | 
				
			||||||
        attrs.setdefault("class", "")
 | 
					        attrs["mode"] = self.mode
 | 
				
			||||||
        attrs["class"] += " codemirror"
 | 
					 | 
				
			||||||
        attrs["data-cm-mode"] = self.mode
 | 
					 | 
				
			||||||
        return super().render(*args, **kwargs)
 | 
					        return super().render(*args, **kwargs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										18
									
								
								authentik/admin/forms/overview.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								authentik/admin/forms/overview.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					"""Forms for modals on overview page"""
 | 
				
			||||||
 | 
					from django import forms
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class PolicyCacheClearForm(forms.Form):
 | 
				
			||||||
 | 
					    """Form to clear Policy cache"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    title = "Clear Policy cache"
 | 
				
			||||||
 | 
					    body = """Are you sure you want to clear the policy cache?
 | 
				
			||||||
 | 
					    This will cause all policies to be re-evaluated on their next usage."""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class FlowCacheClearForm(forms.Form):
 | 
				
			||||||
 | 
					    """Form to clear Flow cache"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    title = "Clear Flow cache"
 | 
				
			||||||
 | 
					    body = """Are you sure you want to clear the flow cache?
 | 
				
			||||||
 | 
					    This will cause all flows to be re-evaluated on their next usage."""
 | 
				
			||||||
@ -1,8 +1,8 @@
 | 
				
			|||||||
"""passbook administration forms"""
 | 
					"""authentik administration forms"""
 | 
				
			||||||
from django import forms
 | 
					from django import forms
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.fields import CodeMirrorWidget, YAMLField
 | 
					from authentik.admin.fields import CodeMirrorWidget, YAMLField
 | 
				
			||||||
from passbook.core.models import User
 | 
					from authentik.core.models import User
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class PolicyTestForm(forms.Form):
 | 
					class PolicyTestForm(forms.Form):
 | 
				
			||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
"""passbook core source form fields"""
 | 
					"""authentik core source form fields"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SOURCE_FORM_FIELDS = [
 | 
					SOURCE_FORM_FIELDS = [
 | 
				
			||||||
    "name",
 | 
					    "name",
 | 
				
			||||||
@ -14,4 +14,6 @@ SOURCE_SERIALIZER_FIELDS = [
 | 
				
			|||||||
    "enabled",
 | 
					    "enabled",
 | 
				
			||||||
    "authentication_flow",
 | 
					    "authentication_flow",
 | 
				
			||||||
    "enrollment_flow",
 | 
					    "enrollment_flow",
 | 
				
			||||||
 | 
					    "verbose_name",
 | 
				
			||||||
 | 
					    "verbose_name_plural",
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
@ -1,9 +1,9 @@
 | 
				
			|||||||
"""passbook administrative user forms"""
 | 
					"""authentik administrative user forms"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from django import forms
 | 
					from django import forms
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.fields import CodeMirrorWidget, YAMLField
 | 
					from authentik.admin.fields import CodeMirrorWidget, YAMLField
 | 
				
			||||||
from passbook.core.models import User
 | 
					from authentik.core.models import User
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class UserForm(forms.ModelForm):
 | 
					class UserForm(forms.ModelForm):
 | 
				
			||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
"""passbook admin mixins"""
 | 
					"""authentik admin mixins"""
 | 
				
			||||||
from django.contrib.auth.mixins import UserPassesTestMixin
 | 
					from django.contrib.auth.mixins import UserPassesTestMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1,10 +1,10 @@
 | 
				
			|||||||
"""passbook admin settings"""
 | 
					"""authentik admin settings"""
 | 
				
			||||||
from celery.schedules import crontab
 | 
					from celery.schedules import crontab
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CELERY_BEAT_SCHEDULE = {
 | 
					CELERY_BEAT_SCHEDULE = {
 | 
				
			||||||
    "admin_latest_version": {
 | 
					    "admin_latest_version": {
 | 
				
			||||||
        "task": "passbook.admin.tasks.update_latest_version",
 | 
					        "task": "authentik.admin.tasks.update_latest_version",
 | 
				
			||||||
        "schedule": crontab(minute=0),  # Run every hour
 | 
					        "schedule": crontab(minute=0),  # Run every hour
 | 
				
			||||||
        "options": {"queue": "passbook_scheduled"},
 | 
					        "options": {"queue": "authentik_scheduled"},
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
							
								
								
									
										45
									
								
								authentik/admin/tasks.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								authentik/admin/tasks.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,45 @@
 | 
				
			|||||||
 | 
					"""authentik admin tasks"""
 | 
				
			||||||
 | 
					from django.core.cache import cache
 | 
				
			||||||
 | 
					from packaging.version import parse
 | 
				
			||||||
 | 
					from requests import RequestException, get
 | 
				
			||||||
 | 
					from structlog.stdlib import get_logger
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from authentik import __version__
 | 
				
			||||||
 | 
					from authentik.events.models import Event, EventAction
 | 
				
			||||||
 | 
					from authentik.lib.tasks import MonitoredTask, TaskResult, TaskResultStatus
 | 
				
			||||||
 | 
					from authentik.root.celery import CELERY_APP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					LOGGER = get_logger()
 | 
				
			||||||
 | 
					VERSION_CACHE_KEY = "authentik_latest_version"
 | 
				
			||||||
 | 
					VERSION_CACHE_TIMEOUT = 2 * 60 * 60  # 2 hours
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@CELERY_APP.task(bind=True, base=MonitoredTask)
 | 
				
			||||||
 | 
					def update_latest_version(self: MonitoredTask):
 | 
				
			||||||
 | 
					    """Update latest version info"""
 | 
				
			||||||
 | 
					    try:
 | 
				
			||||||
 | 
					        response = get("https://api.github.com/repos/beryju/authentik/releases/latest")
 | 
				
			||||||
 | 
					        response.raise_for_status()
 | 
				
			||||||
 | 
					        data = response.json()
 | 
				
			||||||
 | 
					        tag_name = data.get("tag_name")
 | 
				
			||||||
 | 
					        upstream_version = tag_name.split("/")[1]
 | 
				
			||||||
 | 
					        cache.set(VERSION_CACHE_KEY, upstream_version, VERSION_CACHE_TIMEOUT)
 | 
				
			||||||
 | 
					        self.set_status(
 | 
				
			||||||
 | 
					            TaskResult(
 | 
				
			||||||
 | 
					                TaskResultStatus.SUCCESSFUL, ["Successfully updated latest Version"]
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					        # Check if upstream version is newer than what we're running,
 | 
				
			||||||
 | 
					        # and if no event exists yet, create one.
 | 
				
			||||||
 | 
					        local_version = parse(__version__)
 | 
				
			||||||
 | 
					        if local_version < parse(upstream_version):
 | 
				
			||||||
 | 
					            # Event has already been created, don't create duplicate
 | 
				
			||||||
 | 
					            if Event.objects.filter(
 | 
				
			||||||
 | 
					                action=EventAction.UPDATE_AVAILABLE,
 | 
				
			||||||
 | 
					                context__new_version=upstream_version,
 | 
				
			||||||
 | 
					            ).exists():
 | 
				
			||||||
 | 
					                return
 | 
				
			||||||
 | 
					            Event.new(EventAction.UPDATE_AVAILABLE, new_version=upstream_version).save()
 | 
				
			||||||
 | 
					    except (RequestException, IndexError) as exc:
 | 
				
			||||||
 | 
					        cache.set(VERSION_CACHE_KEY, "0.0.0", VERSION_CACHE_TIMEOUT)
 | 
				
			||||||
 | 
					        self.set_status(TaskResult(TaskResultStatus.ERROR).with_error(exc))
 | 
				
			||||||
							
								
								
									
										5
									
								
								authentik/admin/templates/administration/base.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								authentik/admin/templates/administration/base.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,5 @@
 | 
				
			|||||||
 | 
					{% load static %}
 | 
				
			||||||
 | 
					{% load i18n %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{% block content %}
 | 
				
			||||||
 | 
					{% endblock %}
 | 
				
			||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
{% extends "administration/base.html" %}
 | 
					{% extends "administration/base.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
<section class="pf-c-page__main-section pf-m-light">
 | 
					<section class="pf-c-page__main-section pf-m-light">
 | 
				
			||||||
@ -20,7 +20,15 @@
 | 
				
			|||||||
            <div class="pf-c-toolbar__content">
 | 
					            <div class="pf-c-toolbar__content">
 | 
				
			||||||
                {% include 'partials/toolbar_search.html' %}
 | 
					                {% include 'partials/toolbar_search.html' %}
 | 
				
			||||||
                <div class="pf-c-toolbar__bulk-select">
 | 
					                <div class="pf-c-toolbar__bulk-select">
 | 
				
			||||||
                    <a href="{% url 'passbook_admin:certificatekeypair-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                    <ak-modal-button href="{% url 'authentik_admin:certificatekeypair-create' %}">
 | 
				
			||||||
 | 
					                        <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                            {% trans 'Create' %}
 | 
				
			||||||
 | 
					                        </ak-spinner-button>
 | 
				
			||||||
 | 
					                        <div slot="modal"></div>
 | 
				
			||||||
 | 
					                    </ak-modal-button>
 | 
				
			||||||
 | 
					                    <button role="ak-refresh" class="pf-c-button pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Refresh' %}
 | 
				
			||||||
 | 
					                    </button>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                {% include 'partials/pagination.html' %}
 | 
					                {% include 'partials/pagination.html' %}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
@ -31,7 +39,6 @@
 | 
				
			|||||||
                    <th role="columnheader" scope="col">{% trans 'Name' %}</th>
 | 
					                    <th role="columnheader" scope="col">{% trans 'Name' %}</th>
 | 
				
			||||||
                    <th role="columnheader" scope="col">{% trans 'Private Key available' %}</th>
 | 
					                    <th role="columnheader" scope="col">{% trans 'Private Key available' %}</th>
 | 
				
			||||||
                    <th role="columnheader" scope="col">{% trans 'Fingerprint' %}</th>
 | 
					                    <th role="columnheader" scope="col">{% trans 'Fingerprint' %}</th>
 | 
				
			||||||
                    <th role="columnheader" scope="col">{% trans 'Provider Type' %}</th>
 | 
					 | 
				
			||||||
                    <th role="cell"></th>
 | 
					                    <th role="cell"></th>
 | 
				
			||||||
                </tr>
 | 
					                </tr>
 | 
				
			||||||
            </thead>
 | 
					            </thead>
 | 
				
			||||||
@ -53,13 +60,21 @@
 | 
				
			|||||||
                        </span>
 | 
					                        </span>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td role="cell">
 | 
					                    <td role="cell">
 | 
				
			||||||
                        <span>
 | 
					                        <code>{{ kp.fingerprint }}</code>
 | 
				
			||||||
                            {{ kp.fingerprint }}
 | 
					 | 
				
			||||||
                        </span>
 | 
					 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                        <a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:certificatekeypair-update' pk=kp.pk %}?back={{ request.get_full_path }}">{% trans 'Edit' %}</a>
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:certificatekeypair-update' pk=kp.pk %}">
 | 
				
			||||||
                        <a class="pf-c-button pf-m-danger" href="{% url 'passbook_admin:certificatekeypair-delete' pk=kp.pk %}?back={{ request.get_full_path }}">{% trans 'Delete' %}</a>
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-secondary">
 | 
				
			||||||
 | 
					                                {% trans 'Edit' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:certificatekeypair-delete' pk=kp.pk %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-danger">
 | 
				
			||||||
 | 
					                                {% trans 'Delete' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                </tr>
 | 
					                </tr>
 | 
				
			||||||
                {% endfor %}
 | 
					                {% endfor %}
 | 
				
			||||||
@ -87,7 +102,12 @@
 | 
				
			|||||||
                    {% trans 'Currently no certificates exist. Click the button below to create one.' %}
 | 
					                    {% trans 'Currently no certificates exist. Click the button below to create one.' %}
 | 
				
			||||||
                {% endif %}
 | 
					                {% endif %}
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <a href="{% url 'passbook_admin:certificatekeypair-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                <ak-modal-button href="{% url 'authentik_admin:certificatekeypair-create' %}">
 | 
				
			||||||
 | 
					                    <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Create' %}
 | 
				
			||||||
 | 
					                    </ak-spinner-button>
 | 
				
			||||||
 | 
					                    <div slot="modal"></div>
 | 
				
			||||||
 | 
					                </ak-modal-button>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        {% endif %}
 | 
					        {% endif %}
 | 
				
			||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
{% extends "administration/base.html" %}
 | 
					{% extends "administration/base.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
<section class="pf-c-page__main-section pf-m-light">
 | 
					<section class="pf-c-page__main-section pf-m-light">
 | 
				
			||||||
@ -20,8 +20,21 @@
 | 
				
			|||||||
            <div class="pf-c-toolbar__content">
 | 
					            <div class="pf-c-toolbar__content">
 | 
				
			||||||
                {% include 'partials/toolbar_search.html' %}
 | 
					                {% include 'partials/toolbar_search.html' %}
 | 
				
			||||||
                <div class="pf-c-toolbar__bulk-select">
 | 
					                <div class="pf-c-toolbar__bulk-select">
 | 
				
			||||||
                    <a href="{% url 'passbook_admin:flow-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                    <ak-modal-button href="{% url 'authentik_admin:flow-create' %}">
 | 
				
			||||||
                    <a href="{% url 'passbook_admin:flow-import' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-secondary" type="button">{% trans 'Import' %}</a>
 | 
					                        <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                            {% trans 'Create' %}
 | 
				
			||||||
 | 
					                        </ak-spinner-button>
 | 
				
			||||||
 | 
					                        <div slot="modal"></div>
 | 
				
			||||||
 | 
					                    </ak-modal-button>
 | 
				
			||||||
 | 
					                    <ak-modal-button href="{% url 'authentik_admin:flow-import' %}">
 | 
				
			||||||
 | 
					                        <ak-spinner-button slot="trigger" class="pf-m-secondary">
 | 
				
			||||||
 | 
					                            {% trans 'Import' %}
 | 
				
			||||||
 | 
					                        </ak-spinner-button>
 | 
				
			||||||
 | 
					                        <div slot="modal"></div>
 | 
				
			||||||
 | 
					                    </ak-modal-button>
 | 
				
			||||||
 | 
					                    <button role="ak-refresh" class="pf-c-button pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Refresh' %}
 | 
				
			||||||
 | 
					                    </button>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                {% include 'partials/pagination.html' %}
 | 
					                {% include 'partials/pagination.html' %}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
@ -40,10 +53,10 @@
 | 
				
			|||||||
                {% for flow in object_list %}
 | 
					                {% for flow in object_list %}
 | 
				
			||||||
                <tr role="row">
 | 
					                <tr role="row">
 | 
				
			||||||
                    <th role="columnheader">
 | 
					                    <th role="columnheader">
 | 
				
			||||||
                        <div>
 | 
					                        <a href="/flows/{{ flow.slug }}">
 | 
				
			||||||
                            <div>{{ flow.slug }}</div>
 | 
					                            <div><code>{{ flow.slug }}</code></div>
 | 
				
			||||||
                            <small>{{ flow.name }}</small>
 | 
					                            <small>{{ flow.name }}</small>
 | 
				
			||||||
                        </div>
 | 
					                        </a>
 | 
				
			||||||
                    </th>
 | 
					                    </th>
 | 
				
			||||||
                    <td role="cell">
 | 
					                    <td role="cell">
 | 
				
			||||||
                        <span>
 | 
					                        <span>
 | 
				
			||||||
@ -61,10 +74,20 @@
 | 
				
			|||||||
                        </span>
 | 
					                        </span>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                        <a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:flow-update' pk=flow.pk %}?back={{ request.get_full_path }}">{% trans 'Edit' %}</a>
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:flow-update' pk=flow.pk %}">
 | 
				
			||||||
                        <a class="pf-c-button pf-m-danger" href="{% url 'passbook_admin:flow-delete' pk=flow.pk %}?back={{ request.get_full_path }}">{% trans 'Delete' %}</a>
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-secondary">
 | 
				
			||||||
                        <a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:flow-execute' pk=flow.pk %}?next={{ request.get_full_path }}">{% trans 'Execute' %}</a>
 | 
					                                {% trans 'Edit' %}
 | 
				
			||||||
                        <a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:flow-export' pk=flow.pk %}?next={{ request.get_full_path }}">{% trans 'Export' %}</a>
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:flow-delete' pk=flow.pk %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-danger">
 | 
				
			||||||
 | 
					                                {% trans 'Delete' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
 | 
					                        <a class="pf-c-button pf-m-secondary ak-root-link" href="{% url 'authentik_admin:flow-execute' pk=flow.pk %}?next={{ request.get_full_path }}">{% trans 'Execute' %}</a>
 | 
				
			||||||
 | 
					                        <a class="pf-c-button pf-m-secondary ak-root-link" href="{% url 'authentik_admin:flow-export' pk=flow.pk %}?next={{ request.get_full_path }}">{% trans 'Export' %}</a>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                </tr>
 | 
					                </tr>
 | 
				
			||||||
                {% endfor %}
 | 
					                {% endfor %}
 | 
				
			||||||
@ -92,8 +115,18 @@
 | 
				
			|||||||
                    {% trans 'Currently no flows exist. Click the button below to create one.' %}
 | 
					                    {% trans 'Currently no flows exist. Click the button below to create one.' %}
 | 
				
			||||||
                {% endif %}
 | 
					                {% endif %}
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <a href="{% url 'passbook_admin:flow-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                <ak-modal-button href="{% url 'authentik_admin:flow-create' %}">
 | 
				
			||||||
                <a href="{% url 'passbook_admin:flow-import' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Import' %}</a>
 | 
					                    <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Create' %}
 | 
				
			||||||
 | 
					                    </ak-spinner-button>
 | 
				
			||||||
 | 
					                    <div slot="modal"></div>
 | 
				
			||||||
 | 
					                </ak-modal-button>
 | 
				
			||||||
 | 
					                <ak-modal-button href="{% url 'authentik_admin:flow-import' %}">
 | 
				
			||||||
 | 
					                    <ak-spinner-button slot="trigger" class="pf-m-secondary">
 | 
				
			||||||
 | 
					                        {% trans 'Import' %}
 | 
				
			||||||
 | 
					                    </ak-spinner-button>
 | 
				
			||||||
 | 
					                    <div slot="modal"></div>
 | 
				
			||||||
 | 
					                </ak-modal-button>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        {% endif %}
 | 
					        {% endif %}
 | 
				
			||||||
@ -1,7 +1,6 @@
 | 
				
			|||||||
{% extends "administration/base.html" %}
 | 
					{% extends "administration/base.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load passbook_utils %}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
<section class="pf-c-page__main-section pf-m-light">
 | 
					<section class="pf-c-page__main-section pf-m-light">
 | 
				
			||||||
@ -21,8 +20,15 @@
 | 
				
			|||||||
            <div class="pf-c-toolbar__content">
 | 
					            <div class="pf-c-toolbar__content">
 | 
				
			||||||
                {% include 'partials/toolbar_search.html' %}
 | 
					                {% include 'partials/toolbar_search.html' %}
 | 
				
			||||||
                <div class="pf-c-toolbar__bulk-select">
 | 
					                <div class="pf-c-toolbar__bulk-select">
 | 
				
			||||||
                    <a href="{% url 'passbook_admin:group-create' %}?back={{ request.get_full_path }}"
 | 
					                    <ak-modal-button href="{% url 'authentik_admin:group-create' %}">
 | 
				
			||||||
                        class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                        <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                            {% trans 'Create' %}
 | 
				
			||||||
 | 
					                        </ak-spinner-button>
 | 
				
			||||||
 | 
					                        <div slot="modal"></div>
 | 
				
			||||||
 | 
					                    </ak-modal-button>
 | 
				
			||||||
 | 
					                    <button role="ak-refresh" class="pf-c-button pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Refresh' %}
 | 
				
			||||||
 | 
					                    </button>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                {% include 'partials/pagination.html' %}
 | 
					                {% include 'partials/pagination.html' %}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
@ -55,8 +61,18 @@
 | 
				
			|||||||
                        </span>
 | 
					                        </span>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                        <a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:group-update' pk=group.pk %}?back={{ request.get_full_path }}">{% trans 'Edit' %}</a>
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:group-update' pk=group.pk %}">
 | 
				
			||||||
                        <a class="pf-c-button pf-m-danger" href="{% url 'passbook_admin:group-delete' pk=group.pk %}?back={{ request.get_full_path }}">{% trans 'Delete' %}</a>
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-secondary">
 | 
				
			||||||
 | 
					                                {% trans 'Edit' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:group-delete' pk=group.pk %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-danger">
 | 
				
			||||||
 | 
					                                {% trans 'Delete' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                </tr>
 | 
					                </tr>
 | 
				
			||||||
                {% endfor %}
 | 
					                {% endfor %}
 | 
				
			||||||
@ -84,7 +100,12 @@
 | 
				
			|||||||
                    {% trans 'Currently no group exist. Click the button below to create one.' %}
 | 
					                    {% trans 'Currently no group exist. Click the button below to create one.' %}
 | 
				
			||||||
                {% endif %}
 | 
					                {% endif %}
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <a href="{% url 'passbook_admin:group-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                <ak-modal-button href="{% url 'authentik_admin:group-create' %}">
 | 
				
			||||||
 | 
					                    <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Create' %}
 | 
				
			||||||
 | 
					                    </ak-spinner-button>
 | 
				
			||||||
 | 
					                    <div slot="modal"></div>
 | 
				
			||||||
 | 
					                </ak-modal-button>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        {% endif %}
 | 
					        {% endif %}
 | 
				
			||||||
@ -2,17 +2,17 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load humanize %}
 | 
					{% load humanize %}
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
{% load admin_reflection %}
 | 
					{% load admin_reflection %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
<section class="pf-c-page__main-section pf-m-light">
 | 
					<section class="pf-c-page__main-section pf-m-light">
 | 
				
			||||||
    <div class="pf-c-content">
 | 
					    <div class="pf-c-content">
 | 
				
			||||||
        <h1>
 | 
					        <h1>
 | 
				
			||||||
            <i class="fas fa-map-marker"></i>
 | 
					            <i class="pf-icon pf-icon-zone"></i>
 | 
				
			||||||
            {% trans 'Outposts' %}
 | 
					            {% trans 'Outposts' %}
 | 
				
			||||||
        </h1>
 | 
					        </h1>
 | 
				
			||||||
        <p>{% trans "Outposts are deployments of passbook components to support different environments and protocols, like reverse proxies." %}</p>
 | 
					        <p>{% trans "Outposts are deployments of authentik components to support different environments and protocols, like reverse proxies." %}</p>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</section>
 | 
					</section>
 | 
				
			||||||
<section class="pf-c-page__main-section pf-m-no-padding-mobile">
 | 
					<section class="pf-c-page__main-section pf-m-no-padding-mobile">
 | 
				
			||||||
@ -22,7 +22,15 @@
 | 
				
			|||||||
            <div class="pf-c-toolbar__content">
 | 
					            <div class="pf-c-toolbar__content">
 | 
				
			||||||
                {% include 'partials/toolbar_search.html' %}
 | 
					                {% include 'partials/toolbar_search.html' %}
 | 
				
			||||||
                <div class="pf-c-toolbar__bulk-select">
 | 
					                <div class="pf-c-toolbar__bulk-select">
 | 
				
			||||||
                    <a href="{% url 'passbook_admin:outpost-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                    <ak-modal-button href="{% url 'authentik_admin:outpost-create' %}">
 | 
				
			||||||
 | 
					                        <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                            {% trans 'Create' %}
 | 
				
			||||||
 | 
					                        </ak-spinner-button>
 | 
				
			||||||
 | 
					                        <div slot="modal"></div>
 | 
				
			||||||
 | 
					                    </ak-modal-button>
 | 
				
			||||||
 | 
					                    <button role="ak-refresh" class="pf-c-button pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Refresh' %}
 | 
				
			||||||
 | 
					                    </button>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                {% include 'partials/pagination.html' %}
 | 
					                {% include 'partials/pagination.html' %}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
@ -84,8 +92,18 @@
 | 
				
			|||||||
                    {% endif %}
 | 
					                    {% endif %}
 | 
				
			||||||
                    {% endwith %}
 | 
					                    {% endwith %}
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                        <a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:outpost-update' pk=outpost.pk %}?back={{ request.get_full_path }}">{% trans 'Edit' %}</a>
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:outpost-update' pk=outpost.pk %}">
 | 
				
			||||||
                        <a class="pf-c-button pf-m-danger" href="{% url 'passbook_admin:outpost-delete' pk=outpost.pk %}?back={{ request.get_full_path }}">{% trans 'Delete' %}</a>
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-secondary">
 | 
				
			||||||
 | 
					                                {% trans 'Edit' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:outpost-delete' pk=outpost.pk %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-danger">
 | 
				
			||||||
 | 
					                                {% trans 'Delete' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
                        {% get_htmls outpost as htmls %}
 | 
					                        {% get_htmls outpost as htmls %}
 | 
				
			||||||
                        {% for html in htmls %}
 | 
					                        {% for html in htmls %}
 | 
				
			||||||
                        {{ html|safe }}
 | 
					                        {{ html|safe }}
 | 
				
			||||||
@ -117,7 +135,12 @@
 | 
				
			|||||||
                    {% trans 'Currently no outposts exist. Click the button below to create one.' %}
 | 
					                    {% trans 'Currently no outposts exist. Click the button below to create one.' %}
 | 
				
			||||||
                {% endif %}
 | 
					                {% endif %}
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <a href="{% url 'passbook_admin:outpost-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                <ak-modal-button href="{% url 'authentik_admin:outpost-create' %}">
 | 
				
			||||||
 | 
					                    <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Create' %}
 | 
				
			||||||
 | 
					                    </ak-spinner-button>
 | 
				
			||||||
 | 
					                    <div slot="modal"></div>
 | 
				
			||||||
 | 
					                </ak-modal-button>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        {% endif %}
 | 
					        {% endif %}
 | 
				
			||||||
@ -0,0 +1,154 @@
 | 
				
			|||||||
 | 
					{% extends "administration/base.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{% load i18n %}
 | 
				
			||||||
 | 
					{% load humanize %}
 | 
				
			||||||
 | 
					{% load authentik_utils %}
 | 
				
			||||||
 | 
					{% load admin_reflection %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{% block content %}
 | 
				
			||||||
 | 
					<section class="pf-c-page__main-section pf-m-light">
 | 
				
			||||||
 | 
					    <div class="pf-c-content">
 | 
				
			||||||
 | 
					        <h1>
 | 
				
			||||||
 | 
					            <i class="pf-icon-integration"></i>
 | 
				
			||||||
 | 
					            {% trans 'Outpost Service-Connections' %}
 | 
				
			||||||
 | 
					        </h1>
 | 
				
			||||||
 | 
					        <p>{% trans "Outpost Service-Connections define how authentik connects to external platforms to manage and deploy Outposts." %}</p>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					</section>
 | 
				
			||||||
 | 
					<section class="pf-c-page__main-section pf-m-no-padding-mobile">
 | 
				
			||||||
 | 
					    <div class="pf-c-card">
 | 
				
			||||||
 | 
					        {% if object_list %}
 | 
				
			||||||
 | 
					        <div class="pf-c-toolbar">
 | 
				
			||||||
 | 
					            <div class="pf-c-toolbar__content">
 | 
				
			||||||
 | 
					                {% include 'partials/toolbar_search.html' %}
 | 
				
			||||||
 | 
					                <div class="pf-c-toolbar__bulk-select">
 | 
				
			||||||
 | 
					                    <ak-dropdown class="pf-c-dropdown">
 | 
				
			||||||
 | 
					                        <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
				
			||||||
 | 
					                            <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
				
			||||||
 | 
					                            <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
				
			||||||
 | 
					                        </button>
 | 
				
			||||||
 | 
					                        <ul class="pf-c-dropdown__menu" hidden>
 | 
				
			||||||
 | 
					                            {% for type, name in types.items %}
 | 
				
			||||||
 | 
					                            <li>
 | 
				
			||||||
 | 
					                                <ak-modal-button href="{% url 'authentik_admin:outpost-service-connection-create' %}?type={{ type }}">
 | 
				
			||||||
 | 
					                                    <button slot="trigger" class="pf-c-dropdown__menu-item">
 | 
				
			||||||
 | 
					                                        {{ name|verbose_name }}<br>
 | 
				
			||||||
 | 
					                                        <small>
 | 
				
			||||||
 | 
					                                            {{ name|doc }}
 | 
				
			||||||
 | 
					                                        </small>
 | 
				
			||||||
 | 
					                                    </button>
 | 
				
			||||||
 | 
					                                    <div slot="modal"></div>
 | 
				
			||||||
 | 
					                                </ak-modal-button>
 | 
				
			||||||
 | 
					                            </li>
 | 
				
			||||||
 | 
					                            {% endfor %}
 | 
				
			||||||
 | 
					                        </ul>
 | 
				
			||||||
 | 
					                    </ak-dropdown>
 | 
				
			||||||
 | 
					                    <button role="ak-refresh" class="pf-c-button pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Refresh' %}
 | 
				
			||||||
 | 
					                    </button>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					                {% include 'partials/pagination.html' %}
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					        <table class="pf-c-table pf-m-compact pf-m-grid-xl" role="grid">
 | 
				
			||||||
 | 
					            <thead>
 | 
				
			||||||
 | 
					                <tr role="row">
 | 
				
			||||||
 | 
					                    <th role="columnheader" scope="col">{% trans 'Name' %}</th>
 | 
				
			||||||
 | 
					                    <th role="columnheader" scope="col">{% trans 'Type' %}</th>
 | 
				
			||||||
 | 
					                    <th role="columnheader" scope="col">{% trans 'Local?' %}</th>
 | 
				
			||||||
 | 
					                    <th role="columnheader" scope="col">{% trans 'Status' %}</th>
 | 
				
			||||||
 | 
					                    <th role="cell"></th>
 | 
				
			||||||
 | 
					                </tr>
 | 
				
			||||||
 | 
					            </thead>
 | 
				
			||||||
 | 
					            <tbody role="rowgroup">
 | 
				
			||||||
 | 
					                {% for sc in object_list %}
 | 
				
			||||||
 | 
					                <tr role="row">
 | 
				
			||||||
 | 
					                    <th role="columnheader">
 | 
				
			||||||
 | 
					                        <span>{{ sc.name }}</span>
 | 
				
			||||||
 | 
					                    </th>
 | 
				
			||||||
 | 
					                    <td role="cell">
 | 
				
			||||||
 | 
					                        <span>
 | 
				
			||||||
 | 
					                            {{ sc|verbose_name }}
 | 
				
			||||||
 | 
					                        </span>
 | 
				
			||||||
 | 
					                    </td>
 | 
				
			||||||
 | 
					                    <td role="cell">
 | 
				
			||||||
 | 
					                        <span>
 | 
				
			||||||
 | 
					                            {{ sc.local|yesno:"Yes,No" }}
 | 
				
			||||||
 | 
					                        </span>
 | 
				
			||||||
 | 
					                    </td>
 | 
				
			||||||
 | 
					                    <td role="cell">
 | 
				
			||||||
 | 
					                        <span>
 | 
				
			||||||
 | 
					                            {% if sc.state.healthy %}
 | 
				
			||||||
 | 
					                            <i class="fas fa-check pf-m-success"></i> {{ sc.state.version }}
 | 
				
			||||||
 | 
					                            {% else %}
 | 
				
			||||||
 | 
					                            <i class="fas fa-times pf-m-danger"></i> {% trans 'Unhealthy' %}
 | 
				
			||||||
 | 
					                            {% endif %}
 | 
				
			||||||
 | 
					                        </span>
 | 
				
			||||||
 | 
					                    </td>
 | 
				
			||||||
 | 
					                    <td>
 | 
				
			||||||
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:outpost-service-connection-update' pk=sc.pk %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-secondary">
 | 
				
			||||||
 | 
					                                {% trans 'Edit' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:outpost-service-connection-delete' pk=sc.pk %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-danger">
 | 
				
			||||||
 | 
					                                {% trans 'Delete' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
 | 
					                    </td>
 | 
				
			||||||
 | 
					                </tr>
 | 
				
			||||||
 | 
					                {% endfor %}
 | 
				
			||||||
 | 
					            </tbody>
 | 
				
			||||||
 | 
					        </table>
 | 
				
			||||||
 | 
					        <div class="pf-c-pagination pf-m-bottom">
 | 
				
			||||||
 | 
					            {% include 'partials/pagination.html' %}
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					        {% else %}
 | 
				
			||||||
 | 
					        <div class="pf-c-toolbar">
 | 
				
			||||||
 | 
					            <div class="pf-c-toolbar__content">
 | 
				
			||||||
 | 
					                {% include 'partials/toolbar_search.html' %}
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					        <div class="pf-c-empty-state">
 | 
				
			||||||
 | 
					            <div class="pf-c-empty-state__content">
 | 
				
			||||||
 | 
					                <i class="fas fa-map-marker pf-c-empty-state__icon" aria-hidden="true"></i>
 | 
				
			||||||
 | 
					                <h1 class="pf-c-title pf-m-lg">
 | 
				
			||||||
 | 
					                    {% trans 'No Outpost Service Connections.' %}
 | 
				
			||||||
 | 
					                </h1>
 | 
				
			||||||
 | 
					                <div class="pf-c-empty-state__body">
 | 
				
			||||||
 | 
					                {% if request.GET.search != "" %}
 | 
				
			||||||
 | 
					                    {% trans "Your search query doesn't match any outposts." %}
 | 
				
			||||||
 | 
					                {% else %}
 | 
				
			||||||
 | 
					                    {% trans 'Currently no service connections exist. Click the button below to create one.' %}
 | 
				
			||||||
 | 
					                {% endif %}
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					                <ak-dropdown class="pf-c-dropdown">
 | 
				
			||||||
 | 
					                    <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
				
			||||||
 | 
					                        <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
				
			||||||
 | 
					                        <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
				
			||||||
 | 
					                    </button>
 | 
				
			||||||
 | 
					                    <ul class="pf-c-dropdown__menu" hidden>
 | 
				
			||||||
 | 
					                        {% for type, name in types.items %}
 | 
				
			||||||
 | 
					                        <li>
 | 
				
			||||||
 | 
					                            <ak-modal-button href="{% url 'authentik_admin:outpost-service-connection-create' %}?type={{ type }}">
 | 
				
			||||||
 | 
					                                <button slot="trigger" class="pf-c-dropdown__menu-item">
 | 
				
			||||||
 | 
					                                    {{ name|verbose_name }}<br>
 | 
				
			||||||
 | 
					                                    <small>
 | 
				
			||||||
 | 
					                                        {{ name|doc }}
 | 
				
			||||||
 | 
					                                    </small>
 | 
				
			||||||
 | 
					                                </button>
 | 
				
			||||||
 | 
					                                <div slot="modal"></div>
 | 
				
			||||||
 | 
					                            </ak-modal-button>
 | 
				
			||||||
 | 
					                        </li>
 | 
				
			||||||
 | 
					                        {% endfor %}
 | 
				
			||||||
 | 
					                    </ul>
 | 
				
			||||||
 | 
					                </ak-dropdown>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					        {% endif %}
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					</section>
 | 
				
			||||||
 | 
					{% endblock %}
 | 
				
			||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
{% extends "administration/base.html" %}
 | 
					{% extends "administration/base.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
<section class="pf-c-page__main-section pf-m-light">
 | 
					<section class="pf-c-page__main-section pf-m-light">
 | 
				
			||||||
@ -20,7 +20,7 @@
 | 
				
			|||||||
            <div class="pf-c-toolbar__content">
 | 
					            <div class="pf-c-toolbar__content">
 | 
				
			||||||
                {% include 'partials/toolbar_search.html' %}
 | 
					                {% include 'partials/toolbar_search.html' %}
 | 
				
			||||||
                <div class="pf-c-toolbar__bulk-select">
 | 
					                <div class="pf-c-toolbar__bulk-select">
 | 
				
			||||||
                    <div class="pf-c-dropdown">
 | 
					                    <ak-dropdown class="pf-c-dropdown">
 | 
				
			||||||
                        <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
					                        <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
				
			||||||
                            <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
					                            <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
				
			||||||
                            <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
					                            <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
				
			||||||
@ -28,16 +28,19 @@
 | 
				
			|||||||
                        <ul class="pf-c-dropdown__menu" hidden>
 | 
					                        <ul class="pf-c-dropdown__menu" hidden>
 | 
				
			||||||
                            {% for type, name in types.items %}
 | 
					                            {% for type, name in types.items %}
 | 
				
			||||||
                            <li>
 | 
					                            <li>
 | 
				
			||||||
                                <a class="pf-c-dropdown__menu-item" href="{% url 'passbook_admin:policy-create' %}?type={{ type }}&back={{ request.get_full_path }}">
 | 
					                                <ak-modal-button href="{% url 'authentik_admin:policy-create' %}?type={{ type }}">
 | 
				
			||||||
 | 
					                                    <button slot="trigger" class="pf-c-dropdown__menu-item">
 | 
				
			||||||
                                        {{ name|verbose_name }}<br>
 | 
					                                        {{ name|verbose_name }}<br>
 | 
				
			||||||
                                        <small>
 | 
					                                        <small>
 | 
				
			||||||
                                            {{ name|doc }}
 | 
					                                            {{ name|doc }}
 | 
				
			||||||
                                        </small>
 | 
					                                        </small>
 | 
				
			||||||
                                </a>
 | 
					                                    </button>
 | 
				
			||||||
 | 
					                                    <div slot="modal"></div>
 | 
				
			||||||
 | 
					                                </ak-modal-button>
 | 
				
			||||||
                            </li>
 | 
					                            </li>
 | 
				
			||||||
                            {% endfor %}
 | 
					                            {% endfor %}
 | 
				
			||||||
                        </ul>
 | 
					                        </ul>
 | 
				
			||||||
                    </div>
 | 
					                    </ak-dropdown>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                {% include 'partials/pagination.html' %}
 | 
					                {% include 'partials/pagination.html' %}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
@ -71,9 +74,24 @@
 | 
				
			|||||||
                        </span>
 | 
					                        </span>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                        <a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:policy-update' pk=policy.pk %}?back={{ request.get_full_path }}">{% trans 'Edit' %}</a>
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:policy-update' pk=policy.pk %}">
 | 
				
			||||||
                        <a class="pf-c-button pf-m-tertiary" href="{% url 'passbook_admin:policy-test' pk=policy.pk %}?back={{ request.get_full_path }}">{% trans 'Test' %}</a>
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-secondary">
 | 
				
			||||||
                        <a class="pf-c-button pf-m-danger" href="{% url 'passbook_admin:policy-delete' pk=policy.pk %}?back={{ request.get_full_path }}">{% trans 'Delete' %}</a>
 | 
					                                {% trans 'Edit' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:policy-test' pk=policy.pk %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-secondary">
 | 
				
			||||||
 | 
					                                {% trans 'Test' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:policy-delete' pk=policy.pk %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-danger">
 | 
				
			||||||
 | 
					                                {% trans 'Delete' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                </tr>
 | 
					                </tr>
 | 
				
			||||||
                {% endfor %}
 | 
					                {% endfor %}
 | 
				
			||||||
@ -101,7 +119,7 @@
 | 
				
			|||||||
                    {% trans 'Currently no policies exist. Click the button below to create one.' %}
 | 
					                    {% trans 'Currently no policies exist. Click the button below to create one.' %}
 | 
				
			||||||
                {% endif %}
 | 
					                {% endif %}
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <div class="pf-c-dropdown">
 | 
					                <ak-dropdown class="pf-c-dropdown">
 | 
				
			||||||
                    <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
					                    <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
				
			||||||
                        <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
					                        <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
				
			||||||
                        <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
					                        <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
				
			||||||
@ -109,17 +127,19 @@
 | 
				
			|||||||
                    <ul class="pf-c-dropdown__menu" hidden>
 | 
					                    <ul class="pf-c-dropdown__menu" hidden>
 | 
				
			||||||
                        {% for type, name in types.items %}
 | 
					                        {% for type, name in types.items %}
 | 
				
			||||||
                        <li>
 | 
					                        <li>
 | 
				
			||||||
                            <a class="pf-c-dropdown__menu-item"
 | 
					                            <ak-modal-button href="{% url 'authentik_admin:policy-create' %}?type={{ type }}">
 | 
				
			||||||
                                href="{% url 'passbook_admin:policy-create' %}?type={{ type }}&back={{ request.get_full_path }}">
 | 
					                                <button slot="trigger" class="pf-c-dropdown__menu-item">
 | 
				
			||||||
                                    {{ name|verbose_name }}<br>
 | 
					                                    {{ name|verbose_name }}<br>
 | 
				
			||||||
                                    <small>
 | 
					                                    <small>
 | 
				
			||||||
                                        {{ name|doc }}
 | 
					                                        {{ name|doc }}
 | 
				
			||||||
                                    </small>
 | 
					                                    </small>
 | 
				
			||||||
                            </a>
 | 
					                                </button>
 | 
				
			||||||
 | 
					                                <div slot="modal"></div>
 | 
				
			||||||
 | 
					                            </ak-modal-button>
 | 
				
			||||||
                        </li>
 | 
					                        </li>
 | 
				
			||||||
                        {% endfor %}
 | 
					                        {% endfor %}
 | 
				
			||||||
                    </ul>
 | 
					                    </ul>
 | 
				
			||||||
                </div>
 | 
					                </ak-dropdown>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        {% endif %}
 | 
					        {% endif %}
 | 
				
			||||||
							
								
								
									
										11
									
								
								authentik/admin/templates/administration/policy/test.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								authentik/admin/templates/administration/policy/test.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,11 @@
 | 
				
			|||||||
 | 
					{% extends 'generic/form.html' %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{% load i18n %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{% block above_form %}
 | 
				
			||||||
 | 
					<h1>{% blocktrans with policy=policy %}Test policy {{ policy }}{% endblocktrans %}</h1>
 | 
				
			||||||
 | 
					{% endblock %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{% block action %}
 | 
				
			||||||
 | 
					{% trans 'Test' %}
 | 
				
			||||||
 | 
					{% endblock %}
 | 
				
			||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
{% extends "administration/base.html" %}
 | 
					{% extends "administration/base.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
<section class="pf-c-page__main-section pf-m-light">
 | 
					<section class="pf-c-page__main-section pf-m-light">
 | 
				
			||||||
@ -19,8 +19,15 @@
 | 
				
			|||||||
        <div class="pf-c-toolbar">
 | 
					        <div class="pf-c-toolbar">
 | 
				
			||||||
            <div class="pf-c-toolbar__content">
 | 
					            <div class="pf-c-toolbar__content">
 | 
				
			||||||
                <div class="pf-c-toolbar__bulk-select">
 | 
					                <div class="pf-c-toolbar__bulk-select">
 | 
				
			||||||
                    <a href="{% url 'passbook_admin:policy-binding-create' %}?back={{ request.get_full_path }}"
 | 
					                    <ak-modal-button href="{% url 'authentik_admin:policy-binding-create' %}">
 | 
				
			||||||
                        class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                        <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                            {% trans 'Create' %}
 | 
				
			||||||
 | 
					                        </ak-spinner-button>
 | 
				
			||||||
 | 
					                        <div slot="modal"></div>
 | 
				
			||||||
 | 
					                    </ak-modal-button>
 | 
				
			||||||
 | 
					                    <button role="ak-refresh" class="pf-c-button pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Refresh' %}
 | 
				
			||||||
 | 
					                    </button>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                {% include 'partials/pagination.html' %}
 | 
					                {% include 'partials/pagination.html' %}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
@ -66,9 +73,19 @@
 | 
				
			|||||||
                        <th role="cell">
 | 
					                        <th role="cell">
 | 
				
			||||||
                            <div>{{ binding.timeout }}</div>
 | 
					                            <div>{{ binding.timeout }}</div>
 | 
				
			||||||
                        </th>
 | 
					                        </th>
 | 
				
			||||||
                        <td class="pb-table-action" role="cell">
 | 
					                        <td>
 | 
				
			||||||
                            <a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:policy-binding-update' pk=binding.pk %}?back={{ request.get_full_path }}">{% trans 'Edit' %}</a>
 | 
					                            <ak-modal-button href="{% url 'authentik_admin:policy-binding-update' pk=binding.pk %}">
 | 
				
			||||||
                            <a class="pf-c-button pf-m-danger" href="{% url 'passbook_admin:policy-binding-delete' pk=binding.pk %}?back={{ request.get_full_path }}">{% trans 'Delete' %}</a>
 | 
					                                <ak-spinner-button slot="trigger" class="pf-m-secondary">
 | 
				
			||||||
 | 
					                                    {% trans 'Edit' %}
 | 
				
			||||||
 | 
					                                </ak-spinner-button>
 | 
				
			||||||
 | 
					                                <div slot="modal"></div>
 | 
				
			||||||
 | 
					                            </ak-modal-button>
 | 
				
			||||||
 | 
					                            <ak-modal-button href="{% url 'authentik_admin:policy-binding-delete' pk=binding.pk %}">
 | 
				
			||||||
 | 
					                                <ak-spinner-button slot="trigger" class="pf-m-danger">
 | 
				
			||||||
 | 
					                                    {% trans 'Delete' %}
 | 
				
			||||||
 | 
					                                </ak-spinner-button>
 | 
				
			||||||
 | 
					                                <div slot="modal"></div>
 | 
				
			||||||
 | 
					                            </ak-modal-button>
 | 
				
			||||||
                        </td>
 | 
					                        </td>
 | 
				
			||||||
                    </tr>
 | 
					                    </tr>
 | 
				
			||||||
                    {% endfor %}
 | 
					                    {% endfor %}
 | 
				
			||||||
@ -88,7 +105,12 @@
 | 
				
			|||||||
                <div class="pf-c-empty-state__body">
 | 
					                <div class="pf-c-empty-state__body">
 | 
				
			||||||
                    {% trans 'Currently no policy bindings exist. Click the button below to create one.' %}
 | 
					                    {% trans 'Currently no policy bindings exist. Click the button below to create one.' %}
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <a href="{% url 'passbook_admin:policy-binding-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                <ak-modal-button href="{% url 'authentik_admin:policy-binding-create' %}">
 | 
				
			||||||
 | 
					                    <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Create' %}
 | 
				
			||||||
 | 
					                    </ak-spinner-button>
 | 
				
			||||||
 | 
					                    <div slot="modal"></div>
 | 
				
			||||||
 | 
					                </ak-modal-button>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        {% endif %}
 | 
					        {% endif %}
 | 
				
			||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
{% extends "administration/base.html" %}
 | 
					{% extends "administration/base.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
<section class="pf-c-page__main-section pf-m-light">
 | 
					<section class="pf-c-page__main-section pf-m-light">
 | 
				
			||||||
@ -10,7 +10,7 @@
 | 
				
			|||||||
            <i class="pf-icon pf-icon-blueprint"></i>
 | 
					            <i class="pf-icon pf-icon-blueprint"></i>
 | 
				
			||||||
            {% trans 'Property Mappings' %}
 | 
					            {% trans 'Property Mappings' %}
 | 
				
			||||||
        </h1>
 | 
					        </h1>
 | 
				
			||||||
        <p>{% trans "Control how passbook exposes and interprets information." %}
 | 
					        <p>{% trans "Control how authentik exposes and interprets information." %}
 | 
				
			||||||
        </p>
 | 
					        </p>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</section>
 | 
					</section>
 | 
				
			||||||
@ -21,7 +21,7 @@
 | 
				
			|||||||
            <div class="pf-c-toolbar__content">
 | 
					            <div class="pf-c-toolbar__content">
 | 
				
			||||||
                {% include 'partials/toolbar_search.html' %}
 | 
					                {% include 'partials/toolbar_search.html' %}
 | 
				
			||||||
                <div class="pf-c-toolbar__bulk-select">
 | 
					                <div class="pf-c-toolbar__bulk-select">
 | 
				
			||||||
                    <div class="pf-c-dropdown">
 | 
					                    <ak-dropdown class="pf-c-dropdown">
 | 
				
			||||||
                        <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
					                        <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
				
			||||||
                            <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
					                            <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
				
			||||||
                            <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
					                            <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
				
			||||||
@ -29,17 +29,22 @@
 | 
				
			|||||||
                        <ul class="pf-c-dropdown__menu" hidden>
 | 
					                        <ul class="pf-c-dropdown__menu" hidden>
 | 
				
			||||||
                            {% for type, name in types.items %}
 | 
					                            {% for type, name in types.items %}
 | 
				
			||||||
                            <li>
 | 
					                            <li>
 | 
				
			||||||
                                <a class="pf-c-dropdown__menu-item"
 | 
					                                <ak-modal-button href="{% url 'authentik_admin:property-mapping-create' %}?type={{ type }}">
 | 
				
			||||||
                                    href="{% url 'passbook_admin:property-mapping-create' %}?type={{ type }}&back={{ request.get_full_path }}">
 | 
					                                    <button slot="trigger" class="pf-c-dropdown__menu-item">
 | 
				
			||||||
                                        {{ name|verbose_name }}<br>
 | 
					                                        {{ name|verbose_name }}<br>
 | 
				
			||||||
                                        <small>
 | 
					                                        <small>
 | 
				
			||||||
                                            {{ name|doc }}
 | 
					                                            {{ name|doc }}
 | 
				
			||||||
                                        </small>
 | 
					                                        </small>
 | 
				
			||||||
                                </a>
 | 
					                                    </button>
 | 
				
			||||||
 | 
					                                    <div slot="modal"></div>
 | 
				
			||||||
 | 
					                                </ak-modal-button>
 | 
				
			||||||
                            </li>
 | 
					                            </li>
 | 
				
			||||||
                            {% endfor %}
 | 
					                            {% endfor %}
 | 
				
			||||||
                        </ul>
 | 
					                        </ul>
 | 
				
			||||||
                    </div>
 | 
					                    </ak-dropdown>
 | 
				
			||||||
 | 
					                    <button role="ak-refresh" class="pf-c-button pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Refresh' %}
 | 
				
			||||||
 | 
					                    </button>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                {% include 'partials/pagination.html' %}
 | 
					                {% include 'partials/pagination.html' %}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
@ -66,8 +71,18 @@
 | 
				
			|||||||
                        </span>
 | 
					                        </span>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                        <a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:property-mapping-update' pk=property_mapping.pk %}?back={{ request.get_full_path }}">{% trans 'Edit' %}</a>
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:property-mapping-update' pk=property_mapping.pk %}">
 | 
				
			||||||
                        <a class="pf-c-button pf-m-danger" href="{% url 'passbook_admin:property-mapping-delete' pk=property_mapping.pk %}?back={{ request.get_full_path }}">{% trans 'Delete' %}</a>
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-secondary">
 | 
				
			||||||
 | 
					                                {% trans 'Edit' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:property-mapping-delete' pk=property_mapping.pk %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-danger">
 | 
				
			||||||
 | 
					                                {% trans 'Delete' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                </tr>
 | 
					                </tr>
 | 
				
			||||||
                {% endfor %}
 | 
					                {% endfor %}
 | 
				
			||||||
@ -95,7 +110,7 @@
 | 
				
			|||||||
                    {% trans 'Currently no property mappings exist. Click the button below to create one.' %}
 | 
					                    {% trans 'Currently no property mappings exist. Click the button below to create one.' %}
 | 
				
			||||||
                {% endif %}
 | 
					                {% endif %}
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <div class="pf-c-dropdown">
 | 
					                <ak-dropdown class="pf-c-dropdown">
 | 
				
			||||||
                    <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
					                    <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
				
			||||||
                        <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
					                        <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
				
			||||||
                        <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
					                        <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
				
			||||||
@ -103,17 +118,19 @@
 | 
				
			|||||||
                    <ul class="pf-c-dropdown__menu" hidden>
 | 
					                    <ul class="pf-c-dropdown__menu" hidden>
 | 
				
			||||||
                        {% for type, name in types.items %}
 | 
					                        {% for type, name in types.items %}
 | 
				
			||||||
                        <li>
 | 
					                        <li>
 | 
				
			||||||
                            <a class="pf-c-dropdown__menu-item"
 | 
					                            <ak-modal-button href="{% url 'authentik_admin:property-mapping-create' %}?type={{ type }}">
 | 
				
			||||||
                                href="{% url 'passbook_admin:property-mapping-create' %}?type={{ type }}&back={{ request.get_full_path }}">
 | 
					                                <button slot="trigger" class="pf-c-dropdown__menu-item">
 | 
				
			||||||
                                    {{ name|verbose_name }}<br>
 | 
					                                    {{ name|verbose_name }}<br>
 | 
				
			||||||
                                    <small>
 | 
					                                    <small>
 | 
				
			||||||
                                        {{ name|doc }}
 | 
					                                        {{ name|doc }}
 | 
				
			||||||
                                    </small>
 | 
					                                    </small>
 | 
				
			||||||
                            </a>
 | 
					                                </button>
 | 
				
			||||||
 | 
					                                <div slot="modal"></div>
 | 
				
			||||||
 | 
					                            </ak-modal-button>
 | 
				
			||||||
                        </li>
 | 
					                        </li>
 | 
				
			||||||
                        {% endfor %}
 | 
					                        {% endfor %}
 | 
				
			||||||
                    </ul>
 | 
					                    </ul>
 | 
				
			||||||
                </div>
 | 
					                </ak-dropdown>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        {% endif %}
 | 
					        {% endif %}
 | 
				
			||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
{% extends "administration/base.html" %}
 | 
					{% extends "administration/base.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
{% load admin_reflection %}
 | 
					{% load admin_reflection %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
@ -22,7 +22,7 @@
 | 
				
			|||||||
            <div class="pf-c-toolbar__content">
 | 
					            <div class="pf-c-toolbar__content">
 | 
				
			||||||
                {% include 'partials/toolbar_search.html' %}
 | 
					                {% include 'partials/toolbar_search.html' %}
 | 
				
			||||||
                <div class="pf-c-toolbar__bulk-select">
 | 
					                <div class="pf-c-toolbar__bulk-select">
 | 
				
			||||||
                    <div class="pf-c-dropdown">
 | 
					                    <ak-dropdown class="pf-c-dropdown">
 | 
				
			||||||
                        <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
					                        <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
				
			||||||
                            <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
					                            <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
				
			||||||
                            <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
					                            <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
				
			||||||
@ -30,16 +30,33 @@
 | 
				
			|||||||
                        <ul class="pf-c-dropdown__menu" hidden>
 | 
					                        <ul class="pf-c-dropdown__menu" hidden>
 | 
				
			||||||
                            {% for type, name in types.items %}
 | 
					                            {% for type, name in types.items %}
 | 
				
			||||||
                            <li>
 | 
					                            <li>
 | 
				
			||||||
                                <a class="pf-c-dropdown__menu-item" href="{% url 'passbook_admin:provider-create' %}?type={{ type }}&back={{ request.get_full_path }}">
 | 
					                                <ak-modal-button href="{% url 'authentik_admin:provider-create' %}?type={{ type }}">
 | 
				
			||||||
 | 
					                                    <button slot="trigger" class="pf-c-dropdown__menu-item">
 | 
				
			||||||
                                        {{ name|verbose_name }}<br>
 | 
					                                        {{ name|verbose_name }}<br>
 | 
				
			||||||
                                        <small>
 | 
					                                        <small>
 | 
				
			||||||
                                            {{ name|doc }}
 | 
					                                            {{ name|doc }}
 | 
				
			||||||
                                        </small>
 | 
					                                        </small>
 | 
				
			||||||
                                </a>
 | 
					                                    </button>
 | 
				
			||||||
 | 
					                                    <div slot="modal"></div>
 | 
				
			||||||
 | 
					                                </ak-modal-button>
 | 
				
			||||||
                            </li>
 | 
					                            </li>
 | 
				
			||||||
                            {% endfor %}
 | 
					                            {% endfor %}
 | 
				
			||||||
 | 
					                            <li>
 | 
				
			||||||
 | 
					                                <ak-modal-button href="{% url 'authentik_admin:provider-saml-from-metadata' %}">
 | 
				
			||||||
 | 
					                                    <button slot="trigger" class="pf-c-dropdown__menu-item">
 | 
				
			||||||
 | 
					                                        {% trans 'SAML Provider from Metadata' %}<br>
 | 
				
			||||||
 | 
					                                        <small>
 | 
				
			||||||
 | 
					                                            {% trans "Create a SAML Provider by importing its Metadata." %}
 | 
				
			||||||
 | 
					                                        </small>
 | 
				
			||||||
 | 
					                                    </button>
 | 
				
			||||||
 | 
					                                    <div slot="modal"></div>
 | 
				
			||||||
 | 
					                                </ak-modal-button>
 | 
				
			||||||
 | 
					                            </li>
 | 
				
			||||||
                        </ul>
 | 
					                        </ul>
 | 
				
			||||||
                    </div>
 | 
					                    </ak-dropdown>
 | 
				
			||||||
 | 
					                    <button role="ak-refresh" class="pf-c-button pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Refresh' %}
 | 
				
			||||||
 | 
					                    </button>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                {% include 'partials/pagination.html' %}
 | 
					                {% include 'partials/pagination.html' %}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
@ -77,11 +94,21 @@
 | 
				
			|||||||
                        </span>
 | 
					                        </span>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                        <a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:provider-update' pk=provider.pk %}?back={{ request.get_full_path }}">{% trans 'Edit' %}</a>
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:provider-update' pk=provider.pk %}">
 | 
				
			||||||
                        <a class="pf-c-button pf-m-danger" href="{% url 'passbook_admin:provider-delete' pk=provider.pk %}?back={{ request.get_full_path }}">{% trans 'Delete' %}</a>
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-secondary">
 | 
				
			||||||
 | 
					                                {% trans 'Edit' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:provider-delete' pk=provider.pk %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-danger">
 | 
				
			||||||
 | 
					                                {% trans 'Delete' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
                        {% get_links provider as links %}
 | 
					                        {% get_links provider as links %}
 | 
				
			||||||
                        {% for name, href in links.items %}
 | 
					                        {% for name, href in links.items %}
 | 
				
			||||||
                            <a class="pf-c-button pf-m-tertiary" href="{{ href }}?back={{ request.get_full_path }}">{% trans name %}</a>
 | 
					                            <a class="pf-c-button pf-m-tertiary ak-root-link" href="{{ href }}?back={{ request.get_full_path }}">{% trans name %}</a>
 | 
				
			||||||
                        {% endfor %}
 | 
					                        {% endfor %}
 | 
				
			||||||
                        {% get_htmls provider as htmls %}
 | 
					                        {% get_htmls provider as htmls %}
 | 
				
			||||||
                        {% for html in htmls %}
 | 
					                        {% for html in htmls %}
 | 
				
			||||||
@ -114,7 +141,7 @@
 | 
				
			|||||||
                    {% trans 'Currently no providers exist. Click the button below to create one.' %}
 | 
					                    {% trans 'Currently no providers exist. Click the button below to create one.' %}
 | 
				
			||||||
                {% endif %}
 | 
					                {% endif %}
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <div class="pf-c-dropdown">
 | 
					                <ak-dropdown class="pf-c-dropdown">
 | 
				
			||||||
                    <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
					                    <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
				
			||||||
                        <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
					                        <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
				
			||||||
                        <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
					                        <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
				
			||||||
@ -122,16 +149,19 @@
 | 
				
			|||||||
                    <ul class="pf-c-dropdown__menu" hidden>
 | 
					                    <ul class="pf-c-dropdown__menu" hidden>
 | 
				
			||||||
                        {% for type, name in types.items %}
 | 
					                        {% for type, name in types.items %}
 | 
				
			||||||
                        <li>
 | 
					                        <li>
 | 
				
			||||||
                            <a class="pf-c-dropdown__menu-item" href="{% url 'passbook_admin:provider-create' %}?type={{ type }}&back={{ request.get_full_path }}">
 | 
					                            <ak-modal-button href="{% url 'authentik_admin:provider-create' %}?type={{ type }}">
 | 
				
			||||||
 | 
					                                <button slot="trigger" class="pf-c-dropdown__menu-item">
 | 
				
			||||||
                                    {{ name|verbose_name }}<br>
 | 
					                                    {{ name|verbose_name }}<br>
 | 
				
			||||||
                                    <small>
 | 
					                                    <small>
 | 
				
			||||||
                                        {{ name|doc }}
 | 
					                                        {{ name|doc }}
 | 
				
			||||||
                                    </small>
 | 
					                                    </small>
 | 
				
			||||||
                            </a>
 | 
					                                </button>
 | 
				
			||||||
 | 
					                                <div slot="modal"></div>
 | 
				
			||||||
 | 
					                            </ak-modal-button>
 | 
				
			||||||
                        </li>
 | 
					                        </li>
 | 
				
			||||||
                        {% endfor %}
 | 
					                        {% endfor %}
 | 
				
			||||||
                    </ul>
 | 
					                    </ul>
 | 
				
			||||||
                </div>
 | 
					                </ak-dropdown>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        {% endif %}
 | 
					        {% endif %}
 | 
				
			||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
{% extends "administration/base.html" %}
 | 
					{% extends "administration/base.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
{% load admin_reflection %}
 | 
					{% load admin_reflection %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
@ -11,7 +11,7 @@
 | 
				
			|||||||
            <i class="pf-icon pf-icon-middleware"></i>
 | 
					            <i class="pf-icon pf-icon-middleware"></i>
 | 
				
			||||||
            {% trans 'Source' %}
 | 
					            {% trans 'Source' %}
 | 
				
			||||||
        </h1>
 | 
					        </h1>
 | 
				
			||||||
        <p>{% trans "External Sources which can be used to get Identities into passbook, for example Social Providers like Twiter and GitHub or Enterprise Providers like ADFS and LDAP." %}
 | 
					        <p>{% trans "External Sources which can be used to get Identities into authentik, for example Social Providers like Twiter and GitHub or Enterprise Providers like ADFS and LDAP." %}
 | 
				
			||||||
        </p>
 | 
					        </p>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</section>
 | 
					</section>
 | 
				
			||||||
@ -22,7 +22,7 @@
 | 
				
			|||||||
            <div class="pf-c-toolbar__content">
 | 
					            <div class="pf-c-toolbar__content">
 | 
				
			||||||
                {% include 'partials/toolbar_search.html' %}
 | 
					                {% include 'partials/toolbar_search.html' %}
 | 
				
			||||||
                <div class="pf-c-toolbar__bulk-select">
 | 
					                <div class="pf-c-toolbar__bulk-select">
 | 
				
			||||||
                    <div class="pf-c-dropdown">
 | 
					                    <ak-dropdown class="pf-c-dropdown">
 | 
				
			||||||
                        <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
					                        <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
				
			||||||
                            <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
					                            <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
				
			||||||
                            <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
					                            <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
				
			||||||
@ -30,16 +30,22 @@
 | 
				
			|||||||
                        <ul class="pf-c-dropdown__menu" hidden>
 | 
					                        <ul class="pf-c-dropdown__menu" hidden>
 | 
				
			||||||
                            {% for type, name in types.items %}
 | 
					                            {% for type, name in types.items %}
 | 
				
			||||||
                            <li>
 | 
					                            <li>
 | 
				
			||||||
                                <a class="pf-c-dropdown__menu-item" href="{% url 'passbook_admin:source-create' %}?type={{ type }}&back={{ request.get_full_path }}">
 | 
					                                <ak-modal-button href="{% url 'authentik_admin:source-create' %}?type={{ type }}">
 | 
				
			||||||
 | 
					                                    <button slot="trigger" class="pf-c-dropdown__menu-item">
 | 
				
			||||||
                                        {{ name|verbose_name }}<br>
 | 
					                                        {{ name|verbose_name }}<br>
 | 
				
			||||||
                                        <small>
 | 
					                                        <small>
 | 
				
			||||||
                                            {{ name|doc }}
 | 
					                                            {{ name|doc }}
 | 
				
			||||||
                                        </small>
 | 
					                                        </small>
 | 
				
			||||||
                                </a>
 | 
					                                    </button>
 | 
				
			||||||
 | 
					                                    <div slot="modal"></div>
 | 
				
			||||||
 | 
					                                </ak-modal-button>
 | 
				
			||||||
                            </li>
 | 
					                            </li>
 | 
				
			||||||
                            {% endfor %}
 | 
					                            {% endfor %}
 | 
				
			||||||
                        </ul>
 | 
					                        </ul>
 | 
				
			||||||
                    </div>
 | 
					                    </ak-dropdown>
 | 
				
			||||||
 | 
					                    <button role="ak-refresh" class="pf-c-button pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Refresh' %}
 | 
				
			||||||
 | 
					                    </button>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                {% include 'partials/pagination.html' %}
 | 
					                {% include 'partials/pagination.html' %}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
@ -57,12 +63,12 @@
 | 
				
			|||||||
                {% for source in object_list %}
 | 
					                {% for source in object_list %}
 | 
				
			||||||
                <tr role="row">
 | 
					                <tr role="row">
 | 
				
			||||||
                    <th role="columnheader">
 | 
					                    <th role="columnheader">
 | 
				
			||||||
                        <div>
 | 
					                        <a href="/sources/{{ source.slug }}/">
 | 
				
			||||||
                            <div>{{ source.name }}</div>
 | 
					                            <div>{{ source.name }}</div>
 | 
				
			||||||
                            {% if not source.enabled %}
 | 
					                            {% if not source.enabled %}
 | 
				
			||||||
                            <small>{% trans 'Disabled' %}</small>
 | 
					                            <small>{% trans 'Disabled' %}</small>
 | 
				
			||||||
                            {% endif %}
 | 
					                            {% endif %}
 | 
				
			||||||
                        </div>
 | 
					                        </a>
 | 
				
			||||||
                    </th>
 | 
					                    </th>
 | 
				
			||||||
                    <td role="cell">
 | 
					                    <td role="cell">
 | 
				
			||||||
                        <span>
 | 
					                        <span>
 | 
				
			||||||
@ -75,11 +81,21 @@
 | 
				
			|||||||
                        </span>
 | 
					                        </span>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                        <a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:source-update' pk=source.pk %}?back={{ request.get_full_path }}">{% trans 'Edit' %}</a>
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:source-update' pk=source.pk %}">
 | 
				
			||||||
                        <a class="pf-c-button pf-m-danger" href="{% url 'passbook_admin:source-delete' pk=source.pk %}?back={{ request.get_full_path }}">{% trans 'Delete' %}</a>
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-secondary">
 | 
				
			||||||
 | 
					                                {% trans 'Edit' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:source-delete' pk=source.pk %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-danger">
 | 
				
			||||||
 | 
					                                {% trans 'Delete' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
                        {% get_links source as links %}
 | 
					                        {% get_links source as links %}
 | 
				
			||||||
                        {% for name, href in links %}
 | 
					                        {% for name, href in links %}
 | 
				
			||||||
                            <a class="pf-c-button pf-m-tertiary" href="{{ href }}?back={{ request.get_full_path }}">{% trans name %}</a>
 | 
					                            <a class="pf-c-button pf-m-tertiary ak-root-link" href="{{ href }}?back={{ request.get_full_path }}">{% trans name %}</a>
 | 
				
			||||||
                        {% endfor %}
 | 
					                        {% endfor %}
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                </tr>
 | 
					                </tr>
 | 
				
			||||||
@ -108,7 +124,7 @@
 | 
				
			|||||||
                    {% trans 'Currently no sources exist. Click the button below to create one.' %}
 | 
					                    {% trans 'Currently no sources exist. Click the button below to create one.' %}
 | 
				
			||||||
                {% endif %}
 | 
					                {% endif %}
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <div class="pf-c-dropdown">
 | 
					                <ak-dropdown class="pf-c-dropdown">
 | 
				
			||||||
                    <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
					                    <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
				
			||||||
                        <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
					                        <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
				
			||||||
                        <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
					                        <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
				
			||||||
@ -116,16 +132,19 @@
 | 
				
			|||||||
                    <ul class="pf-c-dropdown__menu" hidden>
 | 
					                    <ul class="pf-c-dropdown__menu" hidden>
 | 
				
			||||||
                        {% for type, name in types.items %}
 | 
					                        {% for type, name in types.items %}
 | 
				
			||||||
                        <li>
 | 
					                        <li>
 | 
				
			||||||
                            <a class="pf-c-dropdown__menu-item" href="{% url 'passbook_admin:source-create' %}?type={{ type }}&back={{ request.get_full_path }}">
 | 
					                            <ak-modal-button href="{% url 'authentik_admin:source-create' %}?type={{ type }}">
 | 
				
			||||||
 | 
					                                <button slot="trigger" class="pf-c-dropdown__menu-item">
 | 
				
			||||||
                                    {{ name|verbose_name }}<br>
 | 
					                                    {{ name|verbose_name }}<br>
 | 
				
			||||||
                                    <small>
 | 
					                                    <small>
 | 
				
			||||||
                                        {{ name|doc }}
 | 
					                                        {{ name|doc }}
 | 
				
			||||||
                                    </small>
 | 
					                                    </small>
 | 
				
			||||||
                            </a>
 | 
					                                </button>
 | 
				
			||||||
 | 
					                                <div slot="modal"></div>
 | 
				
			||||||
 | 
					                            </ak-modal-button>
 | 
				
			||||||
                        </li>
 | 
					                        </li>
 | 
				
			||||||
                        {% endfor %}
 | 
					                        {% endfor %}
 | 
				
			||||||
                    </ul>
 | 
					                    </ul>
 | 
				
			||||||
                </div>
 | 
					                </ak-dropdown>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        {% endif %}
 | 
					        {% endif %}
 | 
				
			||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
{% extends "administration/base.html" %}
 | 
					{% extends "administration/base.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
{% load admin_reflection %}
 | 
					{% load admin_reflection %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
@ -21,7 +21,7 @@
 | 
				
			|||||||
            <div class="pf-c-toolbar__content">
 | 
					            <div class="pf-c-toolbar__content">
 | 
				
			||||||
                {% include 'partials/toolbar_search.html' %}
 | 
					                {% include 'partials/toolbar_search.html' %}
 | 
				
			||||||
                <div class="pf-c-toolbar__bulk-select">
 | 
					                <div class="pf-c-toolbar__bulk-select">
 | 
				
			||||||
                    <div class="pf-c-dropdown">
 | 
					                    <ak-dropdown class="pf-c-dropdown">
 | 
				
			||||||
                        <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
					                        <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
				
			||||||
                            <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
					                            <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
				
			||||||
                            <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
					                            <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
				
			||||||
@ -29,16 +29,22 @@
 | 
				
			|||||||
                        <ul class="pf-c-dropdown__menu" hidden>
 | 
					                        <ul class="pf-c-dropdown__menu" hidden>
 | 
				
			||||||
                            {% for type, name in types.items %}
 | 
					                            {% for type, name in types.items %}
 | 
				
			||||||
                            <li>
 | 
					                            <li>
 | 
				
			||||||
                                <a class="pf-c-dropdown__menu-item" href="{% url 'passbook_admin:stage-create' %}?type={{ type }}&back={{ request.get_full_path }}">
 | 
					                                <ak-modal-button href="{% url 'authentik_admin:stage-create' %}?type={{ type }}">
 | 
				
			||||||
 | 
					                                    <button slot="trigger" class="pf-c-dropdown__menu-item">
 | 
				
			||||||
                                        {{ name|verbose_name }}<br>
 | 
					                                        {{ name|verbose_name }}<br>
 | 
				
			||||||
                                        <small>
 | 
					                                        <small>
 | 
				
			||||||
                                            {{ name|doc }}
 | 
					                                            {{ name|doc }}
 | 
				
			||||||
                                        </small>
 | 
					                                        </small>
 | 
				
			||||||
                                </a>
 | 
					                                    </button>
 | 
				
			||||||
 | 
					                                    <div slot="modal"></div>
 | 
				
			||||||
 | 
					                                </ak-modal-button>
 | 
				
			||||||
                            </li>
 | 
					                            </li>
 | 
				
			||||||
                            {% endfor %}
 | 
					                            {% endfor %}
 | 
				
			||||||
                        </ul>
 | 
					                        </ul>
 | 
				
			||||||
                    </div>
 | 
					                    </ak-dropdown>
 | 
				
			||||||
 | 
					                    <button role="ak-refresh" class="pf-c-button pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Refresh' %}
 | 
				
			||||||
 | 
					                    </button>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                {% include 'partials/pagination.html' %}
 | 
					                {% include 'partials/pagination.html' %}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
@ -63,18 +69,28 @@
 | 
				
			|||||||
                    <td role="cell">
 | 
					                    <td role="cell">
 | 
				
			||||||
                        <ul>
 | 
					                        <ul>
 | 
				
			||||||
                            {% for flow in stage.flow_set.all %}
 | 
					                            {% for flow in stage.flow_set.all %}
 | 
				
			||||||
                            <li><a href="{% url 'passbook_admin:flow-update' pk=flow.pk %}">{{ flow.slug }}</a></li>
 | 
					                            <li>{{ flow.slug }}<</li>
 | 
				
			||||||
                            {% empty %}
 | 
					                            {% empty %}
 | 
				
			||||||
                            <li>-</li>
 | 
					                            <li>-</li>
 | 
				
			||||||
                            {% endfor %}
 | 
					                            {% endfor %}
 | 
				
			||||||
                        </ul>
 | 
					                        </ul>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                        <a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:stage-update' pk=stage.stage_uuid %}?back={{ request.get_full_path }}">{% trans 'Edit' %}</a>
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:stage-update' pk=stage.stage_uuid %}">
 | 
				
			||||||
                        <a class="pf-c-button pf-m-danger" href="{% url 'passbook_admin:stage-delete' pk=stage.stage_uuid %}?back={{ request.get_full_path }}">{% trans 'Delete' %}</a>
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-secondary">
 | 
				
			||||||
 | 
					                                {% trans 'Edit' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:stage-delete' pk=stage.stage_uuid %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-danger">
 | 
				
			||||||
 | 
					                                {% trans 'Delete' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
                        {% get_links stage as links %}
 | 
					                        {% get_links stage as links %}
 | 
				
			||||||
                        {% for name, href in links.items %}
 | 
					                        {% for name, href in links.items %}
 | 
				
			||||||
                        <a class="pf-c-button pf-m-tertiary" href="{{ href }}?back={{ request.get_full_path }}">{% trans name %}</a>
 | 
					                        <a class="pf-c-button pf-m-tertiary ak-root-link" href="{{ href }}?back={{ request.get_full_path }}">{% trans name %}</a>
 | 
				
			||||||
                        {% endfor %}
 | 
					                        {% endfor %}
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                </tr>
 | 
					                </tr>
 | 
				
			||||||
@ -103,7 +119,7 @@
 | 
				
			|||||||
                    {% trans 'Currently no stages exist. Click the button below to create one.' %}
 | 
					                    {% trans 'Currently no stages exist. Click the button below to create one.' %}
 | 
				
			||||||
                {% endif %}
 | 
					                {% endif %}
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <div class="pf-c-dropdown">
 | 
					                <ak-dropdown class="pf-c-dropdown">
 | 
				
			||||||
                    <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
					                    <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
 | 
				
			||||||
                        <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
					                        <span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
 | 
				
			||||||
                        <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
					                        <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
 | 
				
			||||||
@ -111,17 +127,19 @@
 | 
				
			|||||||
                    <ul class="pf-c-dropdown__menu" hidden>
 | 
					                    <ul class="pf-c-dropdown__menu" hidden>
 | 
				
			||||||
                        {% for type, name in types.items %}
 | 
					                        {% for type, name in types.items %}
 | 
				
			||||||
                        <li>
 | 
					                        <li>
 | 
				
			||||||
                            <a class="pf-c-dropdown__menu-item"
 | 
					                            <ak-modal-button href="{% url 'authentik_admin:stage-create' %}?type={{ type }}">
 | 
				
			||||||
                                href="{% url 'passbook_admin:stage-create' %}?type={{ type }}&back={{ request.get_full_path }}">
 | 
					                                <button slot="trigger" class="pf-c-dropdown__menu-item">
 | 
				
			||||||
                                    {{ name|verbose_name }}<br>
 | 
					                                    {{ name|verbose_name }}<br>
 | 
				
			||||||
                                    <small>
 | 
					                                    <small>
 | 
				
			||||||
                                        {{ name|doc }}
 | 
					                                        {{ name|doc }}
 | 
				
			||||||
                                    </small>
 | 
					                                    </small>
 | 
				
			||||||
                            </a>
 | 
					                                </button>
 | 
				
			||||||
 | 
					                                <div slot="modal"></div>
 | 
				
			||||||
 | 
					                            </ak-modal-button>
 | 
				
			||||||
                        </li>
 | 
					                        </li>
 | 
				
			||||||
                        {% endfor %}
 | 
					                        {% endfor %}
 | 
				
			||||||
                    </ul>
 | 
					                    </ul>
 | 
				
			||||||
                </div>
 | 
					                </ak-dropdown>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        {% endif %}
 | 
					        {% endif %}
 | 
				
			||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
{% extends "administration/base.html" %}
 | 
					{% extends "administration/base.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
<section class="pf-c-page__main-section pf-m-light">
 | 
					<section class="pf-c-page__main-section pf-m-light">
 | 
				
			||||||
@ -19,8 +19,15 @@
 | 
				
			|||||||
        <div class="pf-c-toolbar">
 | 
					        <div class="pf-c-toolbar">
 | 
				
			||||||
            <div class="pf-c-toolbar__content">
 | 
					            <div class="pf-c-toolbar__content">
 | 
				
			||||||
                <div class="pf-c-toolbar__bulk-select">
 | 
					                <div class="pf-c-toolbar__bulk-select">
 | 
				
			||||||
                    <a href="{% url 'passbook_admin:stage-binding-create' %}?back={{ request.get_full_path }}"
 | 
					                    <ak-modal-button href="{% url 'authentik_admin:stage-binding-create' %}">
 | 
				
			||||||
                        class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                        <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                            {% trans 'Create' %}
 | 
				
			||||||
 | 
					                        </ak-spinner-button>
 | 
				
			||||||
 | 
					                        <div slot="modal"></div>
 | 
				
			||||||
 | 
					                    </ak-modal-button>
 | 
				
			||||||
 | 
					                    <button role="ak-refresh" class="pf-c-button pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Refresh' %}
 | 
				
			||||||
 | 
					                    </button>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                {% include 'partials/pagination.html' %}
 | 
					                {% include 'partials/pagination.html' %}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
@ -73,8 +80,18 @@
 | 
				
			|||||||
                            </div>
 | 
					                            </div>
 | 
				
			||||||
                        </td>
 | 
					                        </td>
 | 
				
			||||||
                        <td>
 | 
					                        <td>
 | 
				
			||||||
                            <a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:stage-binding-update' pk=binding.pk %}?back={{ request.get_full_path }}">{% trans 'Edit' %}</a>
 | 
					                            <ak-modal-button href="{% url 'authentik_admin:stage-binding-update' pk=binding.pk %}">
 | 
				
			||||||
                            <a class="pf-c-button pf-m-danger" href="{% url 'passbook_admin:stage-binding-delete' pk=binding.pk %}?back={{ request.get_full_path }}">{% trans 'Delete' %}</a>
 | 
					                                <ak-spinner-button slot="trigger" class="pf-m-secondary">
 | 
				
			||||||
 | 
					                                    {% trans 'Update' %}
 | 
				
			||||||
 | 
					                                </ak-spinner-button>
 | 
				
			||||||
 | 
					                                <div slot="modal"></div>
 | 
				
			||||||
 | 
					                            </ak-modal-button>
 | 
				
			||||||
 | 
					                            <ak-modal-button href="{% url 'authentik_admin:stage-binding-delete' pk=binding.pk %}">
 | 
				
			||||||
 | 
					                                <ak-spinner-button slot="trigger" class="pf-m-danger">
 | 
				
			||||||
 | 
					                                    {% trans 'Delete' %}
 | 
				
			||||||
 | 
					                                </ak-spinner-button>
 | 
				
			||||||
 | 
					                                <div slot="modal"></div>
 | 
				
			||||||
 | 
					                            </ak-modal-button>
 | 
				
			||||||
                        </td>
 | 
					                        </td>
 | 
				
			||||||
                    </tr>
 | 
					                    </tr>
 | 
				
			||||||
                    {% endfor %}
 | 
					                    {% endfor %}
 | 
				
			||||||
@ -94,7 +111,12 @@
 | 
				
			|||||||
                <div class="pf-c-empty-state__body">
 | 
					                <div class="pf-c-empty-state__body">
 | 
				
			||||||
                    {% trans 'Currently no flow-stage bindings exist. Click the button below to create one.' %}
 | 
					                    {% trans 'Currently no flow-stage bindings exist. Click the button below to create one.' %}
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <a href="{% url 'passbook_admin:certificatekeypair-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                <ak-modal-button href="{% url 'authentik_admin:stage-binding-create' %}">
 | 
				
			||||||
 | 
					                    <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Create' %}
 | 
				
			||||||
 | 
					                    </ak-spinner-button>
 | 
				
			||||||
 | 
					                    <div slot="modal"></div>
 | 
				
			||||||
 | 
					                </ak-modal-button>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        {% endif %}
 | 
					        {% endif %}
 | 
				
			||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
{% extends "administration/base.html" %}
 | 
					{% extends "administration/base.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
<section class="pf-c-page__main-section pf-m-light">
 | 
					<section class="pf-c-page__main-section pf-m-light">
 | 
				
			||||||
@ -21,8 +21,15 @@
 | 
				
			|||||||
            <div class="pf-c-toolbar__content">
 | 
					            <div class="pf-c-toolbar__content">
 | 
				
			||||||
                {% include 'partials/toolbar_search.html' %}
 | 
					                {% include 'partials/toolbar_search.html' %}
 | 
				
			||||||
                <div class="pf-c-toolbar__bulk-select">
 | 
					                <div class="pf-c-toolbar__bulk-select">
 | 
				
			||||||
                    <a href="{% url 'passbook_admin:stage-invitation-create' %}?back={{ request.get_full_path }}"
 | 
					                    <ak-modal-button href="{% url 'authentik_admin:stage-invitation-create' %}">
 | 
				
			||||||
                        class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                        <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                            {% trans 'Create' %}
 | 
				
			||||||
 | 
					                        </ak-spinner-button>
 | 
				
			||||||
 | 
					                        <div slot="modal"></div>
 | 
				
			||||||
 | 
					                    </ak-modal-button>
 | 
				
			||||||
 | 
					                    <button role="ak-refresh" class="pf-c-button pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Refresh' %}
 | 
				
			||||||
 | 
					                    </button>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                {% include 'partials/pagination.html' %}
 | 
					                {% include 'partials/pagination.html' %}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
@ -30,8 +37,9 @@
 | 
				
			|||||||
        <table class="pf-c-table pf-m-compact pf-m-grid-xl" role="grid">
 | 
					        <table class="pf-c-table pf-m-compact pf-m-grid-xl" role="grid">
 | 
				
			||||||
            <thead>
 | 
					            <thead>
 | 
				
			||||||
                <tr role="row">
 | 
					                <tr role="row">
 | 
				
			||||||
 | 
					                    <th role="columnheader" scope="col">{% trans 'ID' %}</th>
 | 
				
			||||||
 | 
					                    <th role="columnheader" scope="col">{% trans 'Created by' %}</th>
 | 
				
			||||||
                    <th role="columnheader" scope="col">{% trans 'Expiry' %}</th>
 | 
					                    <th role="columnheader" scope="col">{% trans 'Expiry' %}</th>
 | 
				
			||||||
                    <th role="columnheader" scope="col">{% trans 'Link' %}</th>
 | 
					 | 
				
			||||||
                    <th role="cell"></th>
 | 
					                    <th role="cell"></th>
 | 
				
			||||||
                </tr>
 | 
					                </tr>
 | 
				
			||||||
            </thead>
 | 
					            </thead>
 | 
				
			||||||
@ -40,16 +48,26 @@
 | 
				
			|||||||
                <tr role="row">
 | 
					                <tr role="row">
 | 
				
			||||||
                    <td role="cell">
 | 
					                    <td role="cell">
 | 
				
			||||||
                        <span>
 | 
					                        <span>
 | 
				
			||||||
                            {{ invitation.expiry }}
 | 
					                            {{ invitation.invite_uuid }}
 | 
				
			||||||
                        </span>
 | 
					                        </span>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td role="cell">
 | 
					                    <td role="cell">
 | 
				
			||||||
                        <span>
 | 
					                        <span>
 | 
				
			||||||
                            {{ invitation.Link }}
 | 
					                            {{ invitation.created_by }}
 | 
				
			||||||
 | 
					                        </span>
 | 
				
			||||||
 | 
					                    </td>
 | 
				
			||||||
 | 
					                    <td role="cell">
 | 
				
			||||||
 | 
					                        <span>
 | 
				
			||||||
 | 
					                            {{ invitation.expiry|default:"-" }}
 | 
				
			||||||
                        </span>
 | 
					                        </span>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                        <a class="pf-c-button pf-m-danger" href="{% url 'passbook_admin:stage-invitation-delete' pk=invitation.pk %}?back={{ request.get_full_path }}">{% trans 'Delete' %}</a>
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:stage-invitation-delete' pk=invitation.pk %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-danger">
 | 
				
			||||||
 | 
					                                {% trans 'Delete' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                </tr>
 | 
					                </tr>
 | 
				
			||||||
                {% endfor %}
 | 
					                {% endfor %}
 | 
				
			||||||
@ -77,7 +95,12 @@
 | 
				
			|||||||
                    {% trans 'Currently no invitations exist. Click the button below to create one.' %}
 | 
					                    {% trans 'Currently no invitations exist. Click the button below to create one.' %}
 | 
				
			||||||
                {% endif %}
 | 
					                {% endif %}
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <a href="{% url 'passbook_admin:stage-invitation-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                <ak-modal-button href="{% url 'authentik_admin:stage-invitation-create' %}">
 | 
				
			||||||
 | 
					                    <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Create' %}
 | 
				
			||||||
 | 
					                    </ak-spinner-button>
 | 
				
			||||||
 | 
					                    <div slot="modal"></div>
 | 
				
			||||||
 | 
					                </ak-modal-button>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        {% endif %}
 | 
					        {% endif %}
 | 
				
			||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
{% extends "administration/base.html" %}
 | 
					{% extends "administration/base.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
{% load admin_reflection %}
 | 
					{% load admin_reflection %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
@ -21,7 +21,15 @@
 | 
				
			|||||||
            <div class="pf-c-toolbar__content">
 | 
					            <div class="pf-c-toolbar__content">
 | 
				
			||||||
                {% include 'partials/toolbar_search.html' %}
 | 
					                {% include 'partials/toolbar_search.html' %}
 | 
				
			||||||
                <div class="pf-c-toolbar__bulk-select">
 | 
					                <div class="pf-c-toolbar__bulk-select">
 | 
				
			||||||
                    <a href="{% url 'passbook_admin:stage-prompt-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                    <ak-modal-button href="{% url 'authentik_admin:stage-prompt-create' %}">
 | 
				
			||||||
 | 
					                        <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                            {% trans 'Create' %}
 | 
				
			||||||
 | 
					                        </ak-spinner-button>
 | 
				
			||||||
 | 
					                        <div slot="modal"></div>
 | 
				
			||||||
 | 
					                    </ak-modal-button>
 | 
				
			||||||
 | 
					                    <button role="ak-refresh" class="pf-c-button pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Refresh' %}
 | 
				
			||||||
 | 
					                    </button>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                {% include 'partials/pagination.html' %}
 | 
					                {% include 'partials/pagination.html' %}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
@ -63,18 +71,28 @@
 | 
				
			|||||||
                    <td role="cell">
 | 
					                    <td role="cell">
 | 
				
			||||||
                        <ul>
 | 
					                        <ul>
 | 
				
			||||||
                            {% for flow in prompt.flow_set.all %}
 | 
					                            {% for flow in prompt.flow_set.all %}
 | 
				
			||||||
                            <li><a href="{% url 'passbook_admin:flow-update' pk=flow.pk %}">{{ flow.slug }}</a></li>
 | 
					                            <li>{{ flow.slug }}</li>
 | 
				
			||||||
                            {% empty %}
 | 
					                            {% empty %}
 | 
				
			||||||
                            <li>-</li>
 | 
					                            <li>-</li>
 | 
				
			||||||
                            {% endfor %}
 | 
					                            {% endfor %}
 | 
				
			||||||
                        </ul>
 | 
					                        </ul>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                        <a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:stage-prompt-update' pk=prompt.pk %}?back={{ request.get_full_path }}">{% trans 'Edit' %}</a>
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:stage-prompt-update' pk=prompt.pk %}">
 | 
				
			||||||
                        <a class="pf-c-button pf-m-danger" href="{% url 'passbook_admin:stage-prompt-delete' pk=prompt.pk %}?back={{ request.get_full_path }}">{% trans 'Delete' %}</a>
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-secondary">
 | 
				
			||||||
 | 
					                                {% trans 'Update' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:stage-prompt-delete' pk=prompt.pk %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-danger">
 | 
				
			||||||
 | 
					                                {% trans 'Delete' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
                        {% get_links prompt as links %}
 | 
					                        {% get_links prompt as links %}
 | 
				
			||||||
                        {% for name, href in links.items %}
 | 
					                        {% for name, href in links.items %}
 | 
				
			||||||
                        <a class="pf-c-button pf-m-tertiary" href="{{ href }}?back={{ request.get_full_path }}">{% trans name %}</a>
 | 
					                        <a class="pf-c-button pf-m-tertiary ak-root-link" href="{{ href }}?back={{ request.get_full_path }}">{% trans name %}</a>
 | 
				
			||||||
                        {% endfor %}
 | 
					                        {% endfor %}
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                </tr>
 | 
					                </tr>
 | 
				
			||||||
@ -103,7 +121,7 @@
 | 
				
			|||||||
                    {% trans 'Currently no stage prompts exist. Click the button below to create one.' %}
 | 
					                    {% trans 'Currently no stage prompts exist. Click the button below to create one.' %}
 | 
				
			||||||
                {% endif %}
 | 
					                {% endif %}
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <a href="{% url 'passbook_admin:stage-prompt-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                <a href="{% url 'authentik_admin:stage-prompt-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        {% endif %}
 | 
					        {% endif %}
 | 
				
			||||||
@ -2,7 +2,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load humanize %}
 | 
					{% load humanize %}
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
<section class="pf-c-page__main-section pf-m-light">
 | 
					<section class="pf-c-page__main-section pf-m-light">
 | 
				
			||||||
@ -11,17 +11,24 @@
 | 
				
			|||||||
            <i class="pf-icon pf-icon-automation"></i>
 | 
					            <i class="pf-icon pf-icon-automation"></i>
 | 
				
			||||||
            {% trans 'System Tasks' %}
 | 
					            {% trans 'System Tasks' %}
 | 
				
			||||||
        </h1>
 | 
					        </h1>
 | 
				
			||||||
        <p>{% trans "Long-running operations which passbook executes in the background." %}</p>
 | 
					        <p>{% trans "Long-running operations which authentik executes in the background." %}</p>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</section>
 | 
					</section>
 | 
				
			||||||
<section class="pf-c-page__main-section pf-m-no-padding-mobile">
 | 
					<section class="pf-c-page__main-section pf-m-no-padding-mobile">
 | 
				
			||||||
    <div class="pf-c-card">
 | 
					    <div class="pf-c-card">
 | 
				
			||||||
 | 
					        <div class="pf-c-toolbar">
 | 
				
			||||||
 | 
					            <div class="pf-c-toolbar__content">
 | 
				
			||||||
 | 
					                <button role="ak-refresh" class="pf-c-button pf-m-primary">
 | 
				
			||||||
 | 
					                    {% trans 'Refresh' %}
 | 
				
			||||||
 | 
					                </button>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
        <table class="pf-c-table pf-m-compact pf-m-grid-xl" role="grid">
 | 
					        <table class="pf-c-table pf-m-compact pf-m-grid-xl" role="grid">
 | 
				
			||||||
            <thead>
 | 
					            <thead>
 | 
				
			||||||
                <tr role="row">
 | 
					                <tr role="row">
 | 
				
			||||||
                    <th role="columnheader" scope="col">{% trans 'Identifier' %}</th>
 | 
					                    <th role="columnheader" scope="col">{% trans 'Identifier' %}</th>
 | 
				
			||||||
                    <th role="columnheader" scope="col">{% trans 'Description' %}</th>
 | 
					                    <th role="columnheader" scope="col">{% trans 'Description' %}</th>
 | 
				
			||||||
                    <th role="columnheader" scope="col">{% trans 'Last Status' %}</th>
 | 
					                    <th role="columnheader" scope="col">{% trans 'Last Run' %}</th>
 | 
				
			||||||
                    <th role="columnheader" scope="col">{% trans 'Status' %}</th>
 | 
					                    <th role="columnheader" scope="col">{% trans 'Status' %}</th>
 | 
				
			||||||
                    <th role="columnheader" scope="col">{% trans 'Messages' %}</th>
 | 
					                    <th role="columnheader" scope="col">{% trans 'Messages' %}</th>
 | 
				
			||||||
                    <th role="cell"></th>
 | 
					                    <th role="cell"></th>
 | 
				
			||||||
@ -31,7 +38,7 @@
 | 
				
			|||||||
                {% for task in object_list %}
 | 
					                {% for task in object_list %}
 | 
				
			||||||
                <tr role="row">
 | 
					                <tr role="row">
 | 
				
			||||||
                    <th role="columnheader">
 | 
					                    <th role="columnheader">
 | 
				
			||||||
                        <pre>{{ task.task_name }}</pre>
 | 
					                        <span>{{ task.html_name|join:"_­" }}</span>
 | 
				
			||||||
                    </th>
 | 
					                    </th>
 | 
				
			||||||
                    <td role="cell">
 | 
					                    <td role="cell">
 | 
				
			||||||
                        <span>
 | 
					                        <span>
 | 
				
			||||||
@ -64,9 +71,9 @@
 | 
				
			|||||||
                        {% endfor %}
 | 
					                        {% endfor %}
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                        <button is="action-button" class="pf-c-button pf-m-primary" url="{% url 'passbook_api:admin_system_tasks-retry' pk=task.task_name %}">
 | 
					                        <ak-action-button url="{% url 'authentik_api:admin_system_tasks-retry' pk=task.task_name %}">
 | 
				
			||||||
                            {% trans 'Retry Task' %}
 | 
					                            {% trans 'Retry Task' %}
 | 
				
			||||||
                        </button>
 | 
					                        </ak-action-button>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                </tr>
 | 
					                </tr>
 | 
				
			||||||
                {% endfor %}
 | 
					                {% endfor %}
 | 
				
			||||||
@ -1,16 +1,16 @@
 | 
				
			|||||||
{% extends "administration/base.html" %}
 | 
					{% extends "administration/base.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
<section class="pf-c-page__main-section pf-m-light">
 | 
					<section class="pf-c-page__main-section pf-m-light">
 | 
				
			||||||
    <div class="pf-c-content">
 | 
					    <div class="pf-c-content">
 | 
				
			||||||
        <h1>
 | 
					        <h1>
 | 
				
			||||||
            <i class="fas fa-key"></i>
 | 
					            <i class="pf-icon pf-icon-security"></i>
 | 
				
			||||||
            {% trans 'Tokens' %}
 | 
					            {% trans 'Tokens' %}
 | 
				
			||||||
        </h1>
 | 
					        </h1>
 | 
				
			||||||
        <p>{% trans "Tokens are used throughout passbook for Email validation stages, Recovery keys and API access." %}</p>
 | 
					        <p>{% trans "Tokens are used throughout authentik for Email validation stages, Recovery keys and API access." %}</p>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</section>
 | 
					</section>
 | 
				
			||||||
<section class="pf-c-page__main-section pf-m-no-padding-mobile">
 | 
					<section class="pf-c-page__main-section pf-m-no-padding-mobile">
 | 
				
			||||||
@ -58,7 +58,15 @@
 | 
				
			|||||||
                        </span>
 | 
					                        </span>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                        <a class="pf-c-button pf-m-danger" href="{% url 'passbook_admin:token-delete' pk=token.pk %}?back={{ request.get_full_path }}">{% trans 'Delete' %}</a>
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:token-delete' pk=token.pk %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-danger">
 | 
				
			||||||
 | 
					                                {% trans 'Delete' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
 | 
					                        <ak-token-copy-button identifier="{{ token.identifier }}">
 | 
				
			||||||
 | 
					                            {% trans 'Copy token' %}
 | 
				
			||||||
 | 
					                        </ak-token-copy-button>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                </tr>
 | 
					                </tr>
 | 
				
			||||||
                {% endfor %}
 | 
					                {% endfor %}
 | 
				
			||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
{% extends "administration/base.html" %}
 | 
					{% extends "administration/base.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
<section class="pf-c-page__main-section pf-m-light">
 | 
					<section class="pf-c-page__main-section pf-m-light">
 | 
				
			||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
{% extends "administration/base.html" %}
 | 
					{% extends "administration/base.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
<section class="pf-c-page__main-section pf-m-light">
 | 
					<section class="pf-c-page__main-section pf-m-light">
 | 
				
			||||||
@ -19,7 +19,15 @@
 | 
				
			|||||||
            <div class="pf-c-toolbar__content">
 | 
					            <div class="pf-c-toolbar__content">
 | 
				
			||||||
                {% include 'partials/toolbar_search.html' %}
 | 
					                {% include 'partials/toolbar_search.html' %}
 | 
				
			||||||
                <div class="pf-c-toolbar__bulk-select">
 | 
					                <div class="pf-c-toolbar__bulk-select">
 | 
				
			||||||
                    <a href="{% url 'passbook_admin:user-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                    <ak-modal-button href="{% url 'authentik_admin:user-create' %}">
 | 
				
			||||||
 | 
					                        <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                            {% trans 'Create' %}
 | 
				
			||||||
 | 
					                        </ak-spinner-button>
 | 
				
			||||||
 | 
					                        <div slot="modal"></div>
 | 
				
			||||||
 | 
					                    </ak-modal-button>
 | 
				
			||||||
 | 
					                    <button role="ak-refresh" class="pf-c-button pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Refresh' %}
 | 
				
			||||||
 | 
					                    </button>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                {% include 'partials/pagination.html' %}
 | 
					                {% include 'partials/pagination.html' %}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
@ -53,14 +61,29 @@
 | 
				
			|||||||
                        </span>
 | 
					                        </span>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                        <a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:user-update' pk=user.pk %}?back={{ request.get_full_path }}">{% trans 'Edit' %}</a>
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:user-update' pk=user.pk %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-secondary">
 | 
				
			||||||
 | 
					                                {% trans 'Edit' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
                        {% if user.is_active %}
 | 
					                        {% if user.is_active %}
 | 
				
			||||||
                        <a class="pf-c-button pf-m-warning" href="{% url 'passbook_admin:user-disable' pk=user.pk %}?back={{ request.get_full_path }}">{% trans 'Disable' %}</a>
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:user-disable' pk=user.pk %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-warning">
 | 
				
			||||||
 | 
					                                {% trans 'Disable' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
                        {% else %}
 | 
					                        {% else %}
 | 
				
			||||||
                        <a class="pf-c-button pf-m-primary" href="{% url 'passbook_admin:user-enable' pk=user.pk %}?back={{ request.get_full_path }}">{% trans 'Enable' %}</a>
 | 
					                        <ak-modal-button href="{% url 'authentik_admin:user-delete' pk=user.pk %}">
 | 
				
			||||||
 | 
					                            <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                                {% trans 'Enable' %}
 | 
				
			||||||
 | 
					                            </ak-spinner-button>
 | 
				
			||||||
 | 
					                            <div slot="modal"></div>
 | 
				
			||||||
 | 
					                        </ak-modal-button>
 | 
				
			||||||
                        {% endif %}
 | 
					                        {% endif %}
 | 
				
			||||||
                        <a class="pf-c-button pf-m-tertiary" href="{% url 'passbook_admin:user-password-reset' pk=user.pk %}?back={{ request.get_full_path }}">{% trans 'Reset Password' %}</a>
 | 
					                        <a class="pf-c-button pf-m-tertiary ak-root-link" href="{% url 'authentik_admin:user-password-reset' pk=user.pk %}?back={{ request.get_full_path }}">{% trans 'Reset Password' %}</a>
 | 
				
			||||||
                        <a class="pf-c-button pf-m-tertiary" href="{% url 'passbook_core:impersonate-init' user_id=user.pk %}">{% trans 'Impersonate' %}</a>
 | 
					                        <a class="pf-c-button pf-m-tertiary ak-root-link" href="{% url 'authentik_core:impersonate-init' user_id=user.pk %}">{% trans 'Impersonate' %}</a>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                </tr>
 | 
					                </tr>
 | 
				
			||||||
                {% endfor %}
 | 
					                {% endfor %}
 | 
				
			||||||
@ -88,7 +111,12 @@
 | 
				
			|||||||
                    {% trans 'Currently no users exist. How did you even get here.' %}
 | 
					                    {% trans 'Currently no users exist. How did you even get here.' %}
 | 
				
			||||||
                {% endif %}
 | 
					                {% endif %}
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <a href="{% url 'passbook_admin:user-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
 | 
					                <ak-modal-button href="{% url 'authentik_admin:user-create' %}">
 | 
				
			||||||
 | 
					                    <ak-spinner-button slot="trigger" class="pf-m-primary">
 | 
				
			||||||
 | 
					                        {% trans 'Create' %}
 | 
				
			||||||
 | 
					                    </ak-spinner-button>
 | 
				
			||||||
 | 
					                    <div slot="modal"></div>
 | 
				
			||||||
 | 
					                </ak-modal-button>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        {% endif %}
 | 
					        {% endif %}
 | 
				
			||||||
							
								
								
									
										1
									
								
								authentik/admin/templates/fields/codemirror.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								authentik/admin/templates/fields/codemirror.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					<ak-codemirror mode="{{ widget.attrs.mode }}"><textarea class="pf-c-form-control" name="{{ widget.name }}">{% if widget.value %}{{ widget.value }}{% endif %}</textarea></ak-codemirror>
 | 
				
			||||||
@ -1,6 +1,6 @@
 | 
				
			|||||||
{% extends base_template|default:"generic/form.html" %}
 | 
					{% extends base_template|default:"generic/form.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block above_form %}
 | 
					{% block above_form %}
 | 
				
			||||||
							
								
								
									
										38
									
								
								authentik/admin/templates/generic/form.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								authentik/admin/templates/generic/form.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,38 @@
 | 
				
			|||||||
 | 
					{% extends container_template|default:"administration/base.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{% load i18n %}
 | 
				
			||||||
 | 
					{% load authentik_utils %}
 | 
				
			||||||
 | 
					{% load static %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{% block content %}
 | 
				
			||||||
 | 
					<section class="pf-c-page__main-section pf-m-light">
 | 
				
			||||||
 | 
					    <div class="pf-c-content">
 | 
				
			||||||
 | 
					        {% block above_form %}
 | 
				
			||||||
 | 
					        {% endblock %}
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					</section>
 | 
				
			||||||
 | 
					<section class="pf-c-page__main-section">
 | 
				
			||||||
 | 
					    <div class="pf-l-stack">
 | 
				
			||||||
 | 
					        <div class="pf-l-stack__item">
 | 
				
			||||||
 | 
					            <div class="pf-c-card">
 | 
				
			||||||
 | 
					                <div class="pf-c-card__body">
 | 
				
			||||||
 | 
					                    <form id="main-form" action="" method="post" class="pf-c-form pf-m-horizontal" enctype="multipart/form-data">
 | 
				
			||||||
 | 
					                        {% include 'partials/form_horizontal.html' with form=form %}
 | 
				
			||||||
 | 
					                        {% block beneath_form %}
 | 
				
			||||||
 | 
					                        {% endblock %}
 | 
				
			||||||
 | 
					                    </form>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					</section>
 | 
				
			||||||
 | 
					<footer class="pf-c-modal-box__footer">
 | 
				
			||||||
 | 
					    <input class="pf-c-button pf-m-primary" type="submit" form="main-form" value="{% block action %}{% endblock %}" />
 | 
				
			||||||
 | 
					    <a class="pf-c-button pf-m-secondary" href="{% back %}">{% trans "Cancel" %}</a>
 | 
				
			||||||
 | 
					</footer>
 | 
				
			||||||
 | 
					{% endblock %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{% block scripts %}
 | 
				
			||||||
 | 
					{{ block.super }}
 | 
				
			||||||
 | 
					{{ form.media.js }}
 | 
				
			||||||
 | 
					{% endblock %}
 | 
				
			||||||
							
								
								
									
										20
									
								
								authentik/admin/templates/generic/form_non_model.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								authentik/admin/templates/generic/form_non_model.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,20 @@
 | 
				
			|||||||
 | 
					{% extends base_template|default:"generic/form.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{% load authentik_utils %}
 | 
				
			||||||
 | 
					{% load i18n %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{% block above_form %}
 | 
				
			||||||
 | 
					<h1>
 | 
				
			||||||
 | 
					    {% trans form.title %}
 | 
				
			||||||
 | 
					</h1>
 | 
				
			||||||
 | 
					{% endblock %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{% block beneath_form %}
 | 
				
			||||||
 | 
					<p>
 | 
				
			||||||
 | 
					    {% trans form.body %}
 | 
				
			||||||
 | 
					</p>
 | 
				
			||||||
 | 
					{% endblock %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{% block action %}
 | 
				
			||||||
 | 
					{% trans 'Confirm' %}
 | 
				
			||||||
 | 
					{% endblock %}
 | 
				
			||||||
@ -1,6 +1,6 @@
 | 
				
			|||||||
{% extends base_template|default:"generic/form.html" %}
 | 
					{% extends base_template|default:"generic/form.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load passbook_utils %}
 | 
					{% load authentik_utils %}
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block above_form %}
 | 
					{% block above_form %}
 | 
				
			||||||
@ -1,8 +1,8 @@
 | 
				
			|||||||
"""passbook admin templatetags"""
 | 
					"""authentik admin templatetags"""
 | 
				
			||||||
from django import template
 | 
					from django import template
 | 
				
			||||||
from django.db.models import Model
 | 
					from django.db.models import Model
 | 
				
			||||||
from django.utils.html import mark_safe
 | 
					from django.utils.html import mark_safe
 | 
				
			||||||
from structlog import get_logger
 | 
					from structlog.stdlib import get_logger
 | 
				
			||||||
 | 
					
 | 
				
			||||||
register = template.Library()
 | 
					register = template.Library()
 | 
				
			||||||
LOGGER = get_logger()
 | 
					LOGGER = get_logger()
 | 
				
			||||||
							
								
								
									
										73
									
								
								authentik/admin/tests/test_api.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								authentik/admin/tests/test_api.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,73 @@
 | 
				
			|||||||
 | 
					"""test admin api"""
 | 
				
			||||||
 | 
					from json import loads
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from django.shortcuts import reverse
 | 
				
			||||||
 | 
					from django.test import TestCase
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from authentik import __version__
 | 
				
			||||||
 | 
					from authentik.core.models import Group, User
 | 
				
			||||||
 | 
					from authentik.core.tasks import clean_expired_models
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class TestAdminAPI(TestCase):
 | 
				
			||||||
 | 
					    """test admin api"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def setUp(self) -> None:
 | 
				
			||||||
 | 
					        super().setUp()
 | 
				
			||||||
 | 
					        self.user = User.objects.create(username="test-user")
 | 
				
			||||||
 | 
					        self.group = Group.objects.create(name="superusers", is_superuser=True)
 | 
				
			||||||
 | 
					        self.group.users.add(self.user)
 | 
				
			||||||
 | 
					        self.group.save()
 | 
				
			||||||
 | 
					        self.client.force_login(self.user)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_tasks(self):
 | 
				
			||||||
 | 
					        """Test Task API"""
 | 
				
			||||||
 | 
					        clean_expired_models.delay()
 | 
				
			||||||
 | 
					        response = self.client.get(reverse("authentik_api:admin_system_tasks-list"))
 | 
				
			||||||
 | 
					        self.assertEqual(response.status_code, 200)
 | 
				
			||||||
 | 
					        body = loads(response.content)
 | 
				
			||||||
 | 
					        self.assertTrue(
 | 
				
			||||||
 | 
					            any([task["task_name"] == "clean_expired_models" for task in body])
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_tasks_retry(self):
 | 
				
			||||||
 | 
					        """Test Task API (retry)"""
 | 
				
			||||||
 | 
					        clean_expired_models.delay()
 | 
				
			||||||
 | 
					        response = self.client.post(
 | 
				
			||||||
 | 
					            reverse(
 | 
				
			||||||
 | 
					                "authentik_api:admin_system_tasks-retry",
 | 
				
			||||||
 | 
					                kwargs={"pk": "clean_expired_models"},
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					        self.assertEqual(response.status_code, 200)
 | 
				
			||||||
 | 
					        body = loads(response.content)
 | 
				
			||||||
 | 
					        self.assertTrue(body["successful"])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_tasks_retry_404(self):
 | 
				
			||||||
 | 
					        """Test Task API (retry, 404)"""
 | 
				
			||||||
 | 
					        response = self.client.post(
 | 
				
			||||||
 | 
					            reverse(
 | 
				
			||||||
 | 
					                "authentik_api:admin_system_tasks-retry",
 | 
				
			||||||
 | 
					                kwargs={"pk": "qwerqewrqrqewrqewr"},
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					        self.assertEqual(response.status_code, 404)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_version(self):
 | 
				
			||||||
 | 
					        """Test Version API"""
 | 
				
			||||||
 | 
					        response = self.client.get(reverse("authentik_api:admin_version-list"))
 | 
				
			||||||
 | 
					        self.assertEqual(response.status_code, 200)
 | 
				
			||||||
 | 
					        body = loads(response.content)
 | 
				
			||||||
 | 
					        self.assertEqual(body["version_current"], __version__)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_workers(self):
 | 
				
			||||||
 | 
					        """Test Workers API"""
 | 
				
			||||||
 | 
					        response = self.client.get(reverse("authentik_api:admin_workers-list"))
 | 
				
			||||||
 | 
					        self.assertEqual(response.status_code, 200)
 | 
				
			||||||
 | 
					        body = loads(response.content)
 | 
				
			||||||
 | 
					        self.assertEqual(body["pagination"]["count"], 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_metrics(self):
 | 
				
			||||||
 | 
					        """Test metrics API"""
 | 
				
			||||||
 | 
					        response = self.client.get(reverse("authentik_api:admin_metrics-list"))
 | 
				
			||||||
 | 
					        self.assertEqual(response.status_code, 200)
 | 
				
			||||||
@ -7,9 +7,9 @@ from django.shortcuts import reverse
 | 
				
			|||||||
from django.test import Client, TestCase
 | 
					from django.test import Client, TestCase
 | 
				
			||||||
from django.urls.exceptions import NoReverseMatch
 | 
					from django.urls.exceptions import NoReverseMatch
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.urls import urlpatterns
 | 
					from authentik.admin.urls import urlpatterns
 | 
				
			||||||
from passbook.core.models import Group, User
 | 
					from authentik.core.models import Group, User
 | 
				
			||||||
from passbook.lib.utils.reflection import get_apps
 | 
					from authentik.lib.utils.reflection import get_apps
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestAdmin(TestCase):
 | 
					class TestAdmin(TestCase):
 | 
				
			||||||
@ -17,7 +17,7 @@ class TestAdmin(TestCase):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    def setUp(self):
 | 
					    def setUp(self):
 | 
				
			||||||
        self.user = User.objects.create_user(username="test")
 | 
					        self.user = User.objects.create_user(username="test")
 | 
				
			||||||
        self.user.pb_groups.add(Group.objects.filter(is_superuser=True).first())
 | 
					        self.user.ak_groups.add(Group.objects.filter(is_superuser=True).first())
 | 
				
			||||||
        self.user.save()
 | 
					        self.user.save()
 | 
				
			||||||
        self.client = Client()
 | 
					        self.client = Client()
 | 
				
			||||||
        self.client.force_login(self.user)
 | 
					        self.client.force_login(self.user)
 | 
				
			||||||
@ -28,7 +28,7 @@ def generic_view_tester(view_name: str) -> Callable:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    def tester(self: TestAdmin):
 | 
					    def tester(self: TestAdmin):
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            full_url = reverse(f"passbook_admin:{view_name}")
 | 
					            full_url = reverse(f"authentik_admin:{view_name}")
 | 
				
			||||||
            response = self.client.get(full_url)
 | 
					            response = self.client.get(full_url)
 | 
				
			||||||
            self.assertTrue(response.status_code < 500)
 | 
					            self.assertTrue(response.status_code < 500)
 | 
				
			||||||
        except NoReverseMatch:
 | 
					        except NoReverseMatch:
 | 
				
			||||||
							
								
								
									
										43
									
								
								authentik/admin/tests/test_policy_binding.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								authentik/admin/tests/test_policy_binding.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,43 @@
 | 
				
			|||||||
 | 
					"""admin tests"""
 | 
				
			||||||
 | 
					from uuid import uuid4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from django import forms
 | 
				
			||||||
 | 
					from django.test import TestCase
 | 
				
			||||||
 | 
					from django.test.client import RequestFactory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from authentik.admin.views.policies_bindings import PolicyBindingCreateView
 | 
				
			||||||
 | 
					from authentik.core.models import Application
 | 
				
			||||||
 | 
					from authentik.policies.forms import PolicyBindingForm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class TestPolicyBindingView(TestCase):
 | 
				
			||||||
 | 
					    """Generic admin tests"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def setUp(self):
 | 
				
			||||||
 | 
					        self.factory = RequestFactory()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_without_get_param(self):
 | 
				
			||||||
 | 
					        """Test PolicyBindingCreateView without get params"""
 | 
				
			||||||
 | 
					        request = self.factory.get("/")
 | 
				
			||||||
 | 
					        view = PolicyBindingCreateView(request=request)
 | 
				
			||||||
 | 
					        self.assertEqual(view.get_initial(), {})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_with_params_invalid(self):
 | 
				
			||||||
 | 
					        """Test PolicyBindingCreateView with invalid get params"""
 | 
				
			||||||
 | 
					        request = self.factory.get("/", {"target": uuid4()})
 | 
				
			||||||
 | 
					        view = PolicyBindingCreateView(request=request)
 | 
				
			||||||
 | 
					        self.assertEqual(view.get_initial(), {})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_with_params(self):
 | 
				
			||||||
 | 
					        """Test PolicyBindingCreateView with get params"""
 | 
				
			||||||
 | 
					        target = Application.objects.create(name="test")
 | 
				
			||||||
 | 
					        request = self.factory.get("/", {"target": target.pk.hex})
 | 
				
			||||||
 | 
					        view = PolicyBindingCreateView(request=request)
 | 
				
			||||||
 | 
					        self.assertEqual(view.get_initial(), {"target": target, "order": 0})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        self.assertTrue(
 | 
				
			||||||
 | 
					            isinstance(
 | 
				
			||||||
 | 
					                PolicyBindingForm(initial={"target": "foo"}).fields["target"].widget,
 | 
				
			||||||
 | 
					                forms.HiddenInput,
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
							
								
								
									
										43
									
								
								authentik/admin/tests/test_stage_bindings.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								authentik/admin/tests/test_stage_bindings.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,43 @@
 | 
				
			|||||||
 | 
					"""admin tests"""
 | 
				
			||||||
 | 
					from uuid import uuid4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from django import forms
 | 
				
			||||||
 | 
					from django.test import TestCase
 | 
				
			||||||
 | 
					from django.test.client import RequestFactory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from authentik.admin.views.stages_bindings import StageBindingCreateView
 | 
				
			||||||
 | 
					from authentik.flows.forms import FlowStageBindingForm
 | 
				
			||||||
 | 
					from authentik.flows.models import Flow
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class TestStageBindingView(TestCase):
 | 
				
			||||||
 | 
					    """Generic admin tests"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def setUp(self):
 | 
				
			||||||
 | 
					        self.factory = RequestFactory()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_without_get_param(self):
 | 
				
			||||||
 | 
					        """Test StageBindingCreateView without get params"""
 | 
				
			||||||
 | 
					        request = self.factory.get("/")
 | 
				
			||||||
 | 
					        view = StageBindingCreateView(request=request)
 | 
				
			||||||
 | 
					        self.assertEqual(view.get_initial(), {})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_with_params_invalid(self):
 | 
				
			||||||
 | 
					        """Test StageBindingCreateView with invalid get params"""
 | 
				
			||||||
 | 
					        request = self.factory.get("/", {"target": uuid4()})
 | 
				
			||||||
 | 
					        view = StageBindingCreateView(request=request)
 | 
				
			||||||
 | 
					        self.assertEqual(view.get_initial(), {})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_with_params(self):
 | 
				
			||||||
 | 
					        """Test StageBindingCreateView with get params"""
 | 
				
			||||||
 | 
					        target = Flow.objects.create(name="test", slug="test")
 | 
				
			||||||
 | 
					        request = self.factory.get("/", {"target": target.pk.hex})
 | 
				
			||||||
 | 
					        view = StageBindingCreateView(request=request)
 | 
				
			||||||
 | 
					        self.assertEqual(view.get_initial(), {"target": target, "order": 0})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        self.assertTrue(
 | 
				
			||||||
 | 
					            isinstance(
 | 
				
			||||||
 | 
					                FlowStageBindingForm(initial={"target": "foo"}).fields["target"].widget,
 | 
				
			||||||
 | 
					                forms.HiddenInput,
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
							
								
								
									
										78
									
								
								authentik/admin/tests/test_tasks.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								authentik/admin/tests/test_tasks.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,78 @@
 | 
				
			|||||||
 | 
					"""test admin tasks"""
 | 
				
			||||||
 | 
					import json
 | 
				
			||||||
 | 
					from dataclasses import dataclass
 | 
				
			||||||
 | 
					from unittest.mock import Mock, patch
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from django.core.cache import cache
 | 
				
			||||||
 | 
					from django.test import TestCase
 | 
				
			||||||
 | 
					from requests.exceptions import RequestException
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from authentik.admin.tasks import VERSION_CACHE_KEY, update_latest_version
 | 
				
			||||||
 | 
					from authentik.events.models import Event, EventAction
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@dataclass
 | 
				
			||||||
 | 
					class MockResponse:
 | 
				
			||||||
 | 
					    """Mock class to emulate the methods of requests's Response we need"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    status_code: int
 | 
				
			||||||
 | 
					    response: str
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def json(self) -> dict:
 | 
				
			||||||
 | 
					        """Get json parsed response"""
 | 
				
			||||||
 | 
					        return json.loads(self.response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def raise_for_status(self):
 | 
				
			||||||
 | 
					        """raise RequestException if status code is 400 or more"""
 | 
				
			||||||
 | 
					        if self.status_code >= 400:
 | 
				
			||||||
 | 
					            raise RequestException
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					REQUEST_MOCK_VALID = Mock(
 | 
				
			||||||
 | 
					    return_value=MockResponse(
 | 
				
			||||||
 | 
					        200,
 | 
				
			||||||
 | 
					        """{
 | 
				
			||||||
 | 
					            "tag_name": "version/99999999.9999999"
 | 
				
			||||||
 | 
					        }""",
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					REQUEST_MOCK_INVALID = Mock(return_value=MockResponse(400, "{}"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class TestAdminTasks(TestCase):
 | 
				
			||||||
 | 
					    """test admin tasks"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @patch("authentik.admin.tasks.get", REQUEST_MOCK_VALID)
 | 
				
			||||||
 | 
					    def test_version_valid_response(self):
 | 
				
			||||||
 | 
					        """Test Update checker with valid response"""
 | 
				
			||||||
 | 
					        update_latest_version.delay().get()
 | 
				
			||||||
 | 
					        self.assertEqual(cache.get(VERSION_CACHE_KEY), "99999999.9999999")
 | 
				
			||||||
 | 
					        self.assertTrue(
 | 
				
			||||||
 | 
					            Event.objects.filter(
 | 
				
			||||||
 | 
					                action=EventAction.UPDATE_AVAILABLE,
 | 
				
			||||||
 | 
					                context__new_version="99999999.9999999",
 | 
				
			||||||
 | 
					            ).exists()
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					        # test that a consecutive check doesn't create a duplicate event
 | 
				
			||||||
 | 
					        update_latest_version.delay().get()
 | 
				
			||||||
 | 
					        self.assertEqual(
 | 
				
			||||||
 | 
					            len(
 | 
				
			||||||
 | 
					                Event.objects.filter(
 | 
				
			||||||
 | 
					                    action=EventAction.UPDATE_AVAILABLE,
 | 
				
			||||||
 | 
					                    context__new_version="99999999.9999999",
 | 
				
			||||||
 | 
					                )
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
 | 
					            1,
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @patch("authentik.admin.tasks.get", REQUEST_MOCK_INVALID)
 | 
				
			||||||
 | 
					    def test_version_error(self):
 | 
				
			||||||
 | 
					        """Test Update checker with invalid response"""
 | 
				
			||||||
 | 
					        update_latest_version.delay().get()
 | 
				
			||||||
 | 
					        self.assertEqual(cache.get(VERSION_CACHE_KEY), "0.0.0")
 | 
				
			||||||
 | 
					        self.assertFalse(
 | 
				
			||||||
 | 
					            Event.objects.filter(
 | 
				
			||||||
 | 
					                action=EventAction.UPDATE_AVAILABLE, context__new_version="0.0.0"
 | 
				
			||||||
 | 
					            ).exists()
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
@ -1,16 +1,19 @@
 | 
				
			|||||||
"""passbook URL Configuration"""
 | 
					"""authentik URL Configuration"""
 | 
				
			||||||
from django.urls import path
 | 
					from django.urls import path
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.views import (
 | 
					from authentik.admin.views import (
 | 
				
			||||||
    applications,
 | 
					    applications,
 | 
				
			||||||
    certificate_key_pair,
 | 
					    certificate_key_pair,
 | 
				
			||||||
 | 
					    events_notifications_rules,
 | 
				
			||||||
 | 
					    events_notifications_transports,
 | 
				
			||||||
    flows,
 | 
					    flows,
 | 
				
			||||||
    groups,
 | 
					    groups,
 | 
				
			||||||
    outposts,
 | 
					    outposts,
 | 
				
			||||||
 | 
					    outposts_service_connections,
 | 
				
			||||||
    overview,
 | 
					    overview,
 | 
				
			||||||
    policies,
 | 
					    policies,
 | 
				
			||||||
    policies_bindings,
 | 
					    policies_bindings,
 | 
				
			||||||
    property_mapping,
 | 
					    property_mappings,
 | 
				
			||||||
    providers,
 | 
					    providers,
 | 
				
			||||||
    sources,
 | 
					    sources,
 | 
				
			||||||
    stages,
 | 
					    stages,
 | 
				
			||||||
@ -21,13 +24,20 @@ from passbook.admin.views import (
 | 
				
			|||||||
    tokens,
 | 
					    tokens,
 | 
				
			||||||
    users,
 | 
					    users,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					from authentik.providers.saml.views import MetadataImportView
 | 
				
			||||||
 | 
					
 | 
				
			||||||
urlpatterns = [
 | 
					urlpatterns = [
 | 
				
			||||||
    path("", overview.AdministrationOverviewView.as_view(), name="overview"),
 | 
					 | 
				
			||||||
    # Applications
 | 
					 | 
				
			||||||
    path(
 | 
					    path(
 | 
				
			||||||
        "applications/", applications.ApplicationListView.as_view(), name="applications"
 | 
					        "overview/cache/flow/",
 | 
				
			||||||
 | 
					        overview.FlowCacheClearView.as_view(),
 | 
				
			||||||
 | 
					        name="overview-clear-flow-cache",
 | 
				
			||||||
    ),
 | 
					    ),
 | 
				
			||||||
 | 
					    path(
 | 
				
			||||||
 | 
					        "overview/cache/policy/",
 | 
				
			||||||
 | 
					        overview.PolicyCacheClearView.as_view(),
 | 
				
			||||||
 | 
					        name="overview-clear-policy-cache",
 | 
				
			||||||
 | 
					    ),
 | 
				
			||||||
 | 
					    # Applications
 | 
				
			||||||
    path(
 | 
					    path(
 | 
				
			||||||
        "applications/create/",
 | 
					        "applications/create/",
 | 
				
			||||||
        applications.ApplicationCreateView.as_view(),
 | 
					        applications.ApplicationCreateView.as_view(),
 | 
				
			||||||
@ -109,6 +119,11 @@ urlpatterns = [
 | 
				
			|||||||
        providers.ProviderCreateView.as_view(),
 | 
					        providers.ProviderCreateView.as_view(),
 | 
				
			||||||
        name="provider-create",
 | 
					        name="provider-create",
 | 
				
			||||||
    ),
 | 
					    ),
 | 
				
			||||||
 | 
					    path(
 | 
				
			||||||
 | 
					        "providers/create/saml/from-metadata/",
 | 
				
			||||||
 | 
					        MetadataImportView.as_view(),
 | 
				
			||||||
 | 
					        name="provider-saml-from-metadata",
 | 
				
			||||||
 | 
					    ),
 | 
				
			||||||
    path(
 | 
					    path(
 | 
				
			||||||
        "providers/<int:pk>/update/",
 | 
					        "providers/<int:pk>/update/",
 | 
				
			||||||
        providers.ProviderUpdateView.as_view(),
 | 
					        providers.ProviderUpdateView.as_view(),
 | 
				
			||||||
@ -225,22 +240,22 @@ urlpatterns = [
 | 
				
			|||||||
    # Property Mappings
 | 
					    # Property Mappings
 | 
				
			||||||
    path(
 | 
					    path(
 | 
				
			||||||
        "property-mappings/",
 | 
					        "property-mappings/",
 | 
				
			||||||
        property_mapping.PropertyMappingListView.as_view(),
 | 
					        property_mappings.PropertyMappingListView.as_view(),
 | 
				
			||||||
        name="property-mappings",
 | 
					        name="property-mappings",
 | 
				
			||||||
    ),
 | 
					    ),
 | 
				
			||||||
    path(
 | 
					    path(
 | 
				
			||||||
        "property-mappings/create/",
 | 
					        "property-mappings/create/",
 | 
				
			||||||
        property_mapping.PropertyMappingCreateView.as_view(),
 | 
					        property_mappings.PropertyMappingCreateView.as_view(),
 | 
				
			||||||
        name="property-mapping-create",
 | 
					        name="property-mapping-create",
 | 
				
			||||||
    ),
 | 
					    ),
 | 
				
			||||||
    path(
 | 
					    path(
 | 
				
			||||||
        "property-mappings/<uuid:pk>/update/",
 | 
					        "property-mappings/<uuid:pk>/update/",
 | 
				
			||||||
        property_mapping.PropertyMappingUpdateView.as_view(),
 | 
					        property_mappings.PropertyMappingUpdateView.as_view(),
 | 
				
			||||||
        name="property-mapping-update",
 | 
					        name="property-mapping-update",
 | 
				
			||||||
    ),
 | 
					    ),
 | 
				
			||||||
    path(
 | 
					    path(
 | 
				
			||||||
        "property-mappings/<uuid:pk>/delete/",
 | 
					        "property-mappings/<uuid:pk>/delete/",
 | 
				
			||||||
        property_mapping.PropertyMappingDeleteView.as_view(),
 | 
					        property_mappings.PropertyMappingDeleteView.as_view(),
 | 
				
			||||||
        name="property-mapping-delete",
 | 
					        name="property-mapping-delete",
 | 
				
			||||||
    ),
 | 
					    ),
 | 
				
			||||||
    # Users
 | 
					    # Users
 | 
				
			||||||
@ -312,10 +327,63 @@ urlpatterns = [
 | 
				
			|||||||
        outposts.OutpostDeleteView.as_view(),
 | 
					        outposts.OutpostDeleteView.as_view(),
 | 
				
			||||||
        name="outpost-delete",
 | 
					        name="outpost-delete",
 | 
				
			||||||
    ),
 | 
					    ),
 | 
				
			||||||
 | 
					    # Outpost Service Connections
 | 
				
			||||||
 | 
					    path(
 | 
				
			||||||
 | 
					        "outposts/service_connections/",
 | 
				
			||||||
 | 
					        outposts_service_connections.OutpostServiceConnectionListView.as_view(),
 | 
				
			||||||
 | 
					        name="outpost-service-connections",
 | 
				
			||||||
 | 
					    ),
 | 
				
			||||||
 | 
					    path(
 | 
				
			||||||
 | 
					        "outposts/service_connections/create/",
 | 
				
			||||||
 | 
					        outposts_service_connections.OutpostServiceConnectionCreateView.as_view(),
 | 
				
			||||||
 | 
					        name="outpost-service-connection-create",
 | 
				
			||||||
 | 
					    ),
 | 
				
			||||||
 | 
					    path(
 | 
				
			||||||
 | 
					        "outposts/service_connections/<uuid:pk>/update/",
 | 
				
			||||||
 | 
					        outposts_service_connections.OutpostServiceConnectionUpdateView.as_view(),
 | 
				
			||||||
 | 
					        name="outpost-service-connection-update",
 | 
				
			||||||
 | 
					    ),
 | 
				
			||||||
 | 
					    path(
 | 
				
			||||||
 | 
					        "outposts/service_connections/<uuid:pk>/delete/",
 | 
				
			||||||
 | 
					        outposts_service_connections.OutpostServiceConnectionDeleteView.as_view(),
 | 
				
			||||||
 | 
					        name="outpost-service-connection-delete",
 | 
				
			||||||
 | 
					    ),
 | 
				
			||||||
    # Tasks
 | 
					    # Tasks
 | 
				
			||||||
    path(
 | 
					    path(
 | 
				
			||||||
        "tasks/",
 | 
					        "tasks/",
 | 
				
			||||||
        tasks.TaskListView.as_view(),
 | 
					        tasks.TaskListView.as_view(),
 | 
				
			||||||
        name="tasks",
 | 
					        name="tasks",
 | 
				
			||||||
    ),
 | 
					    ),
 | 
				
			||||||
 | 
					    # Event Notification Transpots
 | 
				
			||||||
 | 
					    path(
 | 
				
			||||||
 | 
					        "events/transports/create/",
 | 
				
			||||||
 | 
					        events_notifications_transports.NotificationTransportCreateView.as_view(),
 | 
				
			||||||
 | 
					        name="notification-transport-create",
 | 
				
			||||||
 | 
					    ),
 | 
				
			||||||
 | 
					    path(
 | 
				
			||||||
 | 
					        "events/transports/<uuid:pk>/update/",
 | 
				
			||||||
 | 
					        events_notifications_transports.NotificationTransportUpdateView.as_view(),
 | 
				
			||||||
 | 
					        name="notification-transport-update",
 | 
				
			||||||
 | 
					    ),
 | 
				
			||||||
 | 
					    path(
 | 
				
			||||||
 | 
					        "events/transports/<uuid:pk>/delete/",
 | 
				
			||||||
 | 
					        events_notifications_transports.NotificationTransportDeleteView.as_view(),
 | 
				
			||||||
 | 
					        name="notification-transport-delete",
 | 
				
			||||||
 | 
					    ),
 | 
				
			||||||
 | 
					    # Event Notification Rules
 | 
				
			||||||
 | 
					    path(
 | 
				
			||||||
 | 
					        "events/rules/create/",
 | 
				
			||||||
 | 
					        events_notifications_rules.NotificationRuleCreateView.as_view(),
 | 
				
			||||||
 | 
					        name="notification-rule-create",
 | 
				
			||||||
 | 
					    ),
 | 
				
			||||||
 | 
					    path(
 | 
				
			||||||
 | 
					        "events/rules/<uuid:pk>/update/",
 | 
				
			||||||
 | 
					        events_notifications_rules.NotificationRuleUpdateView.as_view(),
 | 
				
			||||||
 | 
					        name="notification-rule-update",
 | 
				
			||||||
 | 
					    ),
 | 
				
			||||||
 | 
					    path(
 | 
				
			||||||
 | 
					        "events/rules/<uuid:pk>/delete/",
 | 
				
			||||||
 | 
					        events_notifications_rules.NotificationRuleDeleteView.as_view(),
 | 
				
			||||||
 | 
					        name="notification-rule-delete",
 | 
				
			||||||
 | 
					    ),
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
							
								
								
									
										64
									
								
								authentik/admin/views/applications.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								authentik/admin/views/applications.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,64 @@
 | 
				
			|||||||
 | 
					"""authentik Application administration"""
 | 
				
			||||||
 | 
					from django.contrib.auth.mixins import LoginRequiredMixin
 | 
				
			||||||
 | 
					from django.contrib.auth.mixins import (
 | 
				
			||||||
 | 
					    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					from django.contrib.messages.views import SuccessMessageMixin
 | 
				
			||||||
 | 
					from django.urls import reverse_lazy
 | 
				
			||||||
 | 
					from django.utils.translation import gettext as _
 | 
				
			||||||
 | 
					from django.views.generic import UpdateView
 | 
				
			||||||
 | 
					from guardian.mixins import PermissionRequiredMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from authentik.admin.views.utils import BackSuccessUrlMixin, DeleteMessageView
 | 
				
			||||||
 | 
					from authentik.core.forms.applications import ApplicationForm
 | 
				
			||||||
 | 
					from authentik.core.models import Application
 | 
				
			||||||
 | 
					from authentik.lib.views import CreateAssignPermView
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class ApplicationCreateView(
 | 
				
			||||||
 | 
					    SuccessMessageMixin,
 | 
				
			||||||
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
 | 
					    LoginRequiredMixin,
 | 
				
			||||||
 | 
					    DjangoPermissionRequiredMixin,
 | 
				
			||||||
 | 
					    CreateAssignPermView,
 | 
				
			||||||
 | 
					):
 | 
				
			||||||
 | 
					    """Create new Application"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    model = Application
 | 
				
			||||||
 | 
					    form_class = ApplicationForm
 | 
				
			||||||
 | 
					    permission_required = "authentik_core.add_application"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
 | 
					    success_url = reverse_lazy("authentik_core:shell")
 | 
				
			||||||
 | 
					    success_message = _("Successfully created Application")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class ApplicationUpdateView(
 | 
				
			||||||
 | 
					    SuccessMessageMixin,
 | 
				
			||||||
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
 | 
					    LoginRequiredMixin,
 | 
				
			||||||
 | 
					    PermissionRequiredMixin,
 | 
				
			||||||
 | 
					    UpdateView,
 | 
				
			||||||
 | 
					):
 | 
				
			||||||
 | 
					    """Update application"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    model = Application
 | 
				
			||||||
 | 
					    form_class = ApplicationForm
 | 
				
			||||||
 | 
					    permission_required = "authentik_core.change_application"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    template_name = "generic/update.html"
 | 
				
			||||||
 | 
					    success_url = reverse_lazy("authentik_core:shell")
 | 
				
			||||||
 | 
					    success_message = _("Successfully updated Application")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class ApplicationDeleteView(
 | 
				
			||||||
 | 
					    LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView
 | 
				
			||||||
 | 
					):
 | 
				
			||||||
 | 
					    """Delete application"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    model = Application
 | 
				
			||||||
 | 
					    permission_required = "authentik_core.delete_application"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
 | 
					    success_url = reverse_lazy("authentik_core:shell")
 | 
				
			||||||
 | 
					    success_message = _("Successfully deleted Application")
 | 
				
			||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
"""passbook CertificateKeyPair administration"""
 | 
					"""authentik CertificateKeyPair administration"""
 | 
				
			||||||
from django.contrib.auth.mixins import LoginRequiredMixin
 | 
					from django.contrib.auth.mixins import LoginRequiredMixin
 | 
				
			||||||
from django.contrib.auth.mixins import (
 | 
					from django.contrib.auth.mixins import (
 | 
				
			||||||
    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
					    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
				
			||||||
@ -9,15 +9,15 @@ from django.utils.translation import gettext as _
 | 
				
			|||||||
from django.views.generic import ListView, UpdateView
 | 
					from django.views.generic import ListView, UpdateView
 | 
				
			||||||
from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
					from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.views.utils import (
 | 
					from authentik.admin.views.utils import (
 | 
				
			||||||
    BackSuccessUrlMixin,
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
    DeleteMessageView,
 | 
					    DeleteMessageView,
 | 
				
			||||||
    SearchListMixin,
 | 
					    SearchListMixin,
 | 
				
			||||||
    UserPaginateListMixin,
 | 
					    UserPaginateListMixin,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from passbook.crypto.forms import CertificateKeyPairForm
 | 
					from authentik.crypto.forms import CertificateKeyPairForm
 | 
				
			||||||
from passbook.crypto.models import CertificateKeyPair
 | 
					from authentik.crypto.models import CertificateKeyPair
 | 
				
			||||||
from passbook.lib.views import CreateAssignPermView
 | 
					from authentik.lib.views import CreateAssignPermView
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class CertificateKeyPairListView(
 | 
					class CertificateKeyPairListView(
 | 
				
			||||||
@ -30,7 +30,7 @@ class CertificateKeyPairListView(
 | 
				
			|||||||
    """Show list of all keypairs"""
 | 
					    """Show list of all keypairs"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = CertificateKeyPair
 | 
					    model = CertificateKeyPair
 | 
				
			||||||
    permission_required = "passbook_crypto.view_certificatekeypair"
 | 
					    permission_required = "authentik_crypto.view_certificatekeypair"
 | 
				
			||||||
    ordering = "name"
 | 
					    ordering = "name"
 | 
				
			||||||
    template_name = "administration/certificatekeypair/list.html"
 | 
					    template_name = "administration/certificatekeypair/list.html"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -48,10 +48,10 @@ class CertificateKeyPairCreateView(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    model = CertificateKeyPair
 | 
					    model = CertificateKeyPair
 | 
				
			||||||
    form_class = CertificateKeyPairForm
 | 
					    form_class = CertificateKeyPairForm
 | 
				
			||||||
    permission_required = "passbook_crypto.add_certificatekeypair"
 | 
					    permission_required = "authentik_crypto.add_certificatekeypair"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/create.html"
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:certificate_key_pair")
 | 
					    success_url = reverse_lazy("authentik_admin:certificate_key_pair")
 | 
				
			||||||
    success_message = _("Successfully created CertificateKeyPair")
 | 
					    success_message = _("Successfully created CertificateKeyPair")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -66,10 +66,10 @@ class CertificateKeyPairUpdateView(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    model = CertificateKeyPair
 | 
					    model = CertificateKeyPair
 | 
				
			||||||
    form_class = CertificateKeyPairForm
 | 
					    form_class = CertificateKeyPairForm
 | 
				
			||||||
    permission_required = "passbook_crypto.change_certificatekeypair"
 | 
					    permission_required = "authentik_crypto.change_certificatekeypair"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/update.html"
 | 
					    template_name = "generic/update.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:certificate_key_pair")
 | 
					    success_url = reverse_lazy("authentik_admin:certificate_key_pair")
 | 
				
			||||||
    success_message = _("Successfully updated Certificate-Key Pair")
 | 
					    success_message = _("Successfully updated Certificate-Key Pair")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -79,8 +79,8 @@ class CertificateKeyPairDeleteView(
 | 
				
			|||||||
    """Delete certificatekeypair"""
 | 
					    """Delete certificatekeypair"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = CertificateKeyPair
 | 
					    model = CertificateKeyPair
 | 
				
			||||||
    permission_required = "passbook_crypto.delete_certificatekeypair"
 | 
					    permission_required = "authentik_crypto.delete_certificatekeypair"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/delete.html"
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:certificate_key_pair")
 | 
					    success_url = reverse_lazy("authentik_admin:certificate_key_pair")
 | 
				
			||||||
    success_message = _("Successfully deleted Certificate-Key Pair")
 | 
					    success_message = _("Successfully deleted Certificate-Key Pair")
 | 
				
			||||||
							
								
								
									
										64
									
								
								authentik/admin/views/events_notifications_rules.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								authentik/admin/views/events_notifications_rules.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,64 @@
 | 
				
			|||||||
 | 
					"""authentik NotificationRule administration"""
 | 
				
			||||||
 | 
					from django.contrib.auth.mixins import LoginRequiredMixin
 | 
				
			||||||
 | 
					from django.contrib.auth.mixins import (
 | 
				
			||||||
 | 
					    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					from django.contrib.messages.views import SuccessMessageMixin
 | 
				
			||||||
 | 
					from django.urls import reverse_lazy
 | 
				
			||||||
 | 
					from django.utils.translation import gettext as _
 | 
				
			||||||
 | 
					from django.views.generic import UpdateView
 | 
				
			||||||
 | 
					from guardian.mixins import PermissionRequiredMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from authentik.admin.views.utils import BackSuccessUrlMixin, DeleteMessageView
 | 
				
			||||||
 | 
					from authentik.events.forms import NotificationRuleForm
 | 
				
			||||||
 | 
					from authentik.events.models import NotificationRule
 | 
				
			||||||
 | 
					from authentik.lib.views import CreateAssignPermView
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class NotificationRuleCreateView(
 | 
				
			||||||
 | 
					    SuccessMessageMixin,
 | 
				
			||||||
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
 | 
					    LoginRequiredMixin,
 | 
				
			||||||
 | 
					    DjangoPermissionRequiredMixin,
 | 
				
			||||||
 | 
					    CreateAssignPermView,
 | 
				
			||||||
 | 
					):
 | 
				
			||||||
 | 
					    """Create new NotificationRule"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    model = NotificationRule
 | 
				
			||||||
 | 
					    form_class = NotificationRuleForm
 | 
				
			||||||
 | 
					    permission_required = "authentik_events.add_NotificationRule"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
 | 
					    success_url = reverse_lazy("authentik_core:shell")
 | 
				
			||||||
 | 
					    success_message = _("Successfully created Notification Rule")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class NotificationRuleUpdateView(
 | 
				
			||||||
 | 
					    SuccessMessageMixin,
 | 
				
			||||||
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
 | 
					    LoginRequiredMixin,
 | 
				
			||||||
 | 
					    PermissionRequiredMixin,
 | 
				
			||||||
 | 
					    UpdateView,
 | 
				
			||||||
 | 
					):
 | 
				
			||||||
 | 
					    """Update application"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    model = NotificationRule
 | 
				
			||||||
 | 
					    form_class = NotificationRuleForm
 | 
				
			||||||
 | 
					    permission_required = "authentik_events.change_NotificationRule"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    template_name = "generic/update.html"
 | 
				
			||||||
 | 
					    success_url = reverse_lazy("authentik_core:shell")
 | 
				
			||||||
 | 
					    success_message = _("Successfully updated Notification Rule")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class NotificationRuleDeleteView(
 | 
				
			||||||
 | 
					    LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView
 | 
				
			||||||
 | 
					):
 | 
				
			||||||
 | 
					    """Delete application"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    model = NotificationRule
 | 
				
			||||||
 | 
					    permission_required = "authentik_events.delete_NotificationRule"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
 | 
					    success_url = reverse_lazy("authentik_core:shell")
 | 
				
			||||||
 | 
					    success_message = _("Successfully deleted Notification Rule")
 | 
				
			||||||
							
								
								
									
										64
									
								
								authentik/admin/views/events_notifications_transports.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								authentik/admin/views/events_notifications_transports.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,64 @@
 | 
				
			|||||||
 | 
					"""authentik NotificationTransport administration"""
 | 
				
			||||||
 | 
					from django.contrib.auth.mixins import LoginRequiredMixin
 | 
				
			||||||
 | 
					from django.contrib.auth.mixins import (
 | 
				
			||||||
 | 
					    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					from django.contrib.messages.views import SuccessMessageMixin
 | 
				
			||||||
 | 
					from django.urls import reverse_lazy
 | 
				
			||||||
 | 
					from django.utils.translation import gettext as _
 | 
				
			||||||
 | 
					from django.views.generic import UpdateView
 | 
				
			||||||
 | 
					from guardian.mixins import PermissionRequiredMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from authentik.admin.views.utils import BackSuccessUrlMixin, DeleteMessageView
 | 
				
			||||||
 | 
					from authentik.events.forms import NotificationTransportForm
 | 
				
			||||||
 | 
					from authentik.events.models import NotificationTransport
 | 
				
			||||||
 | 
					from authentik.lib.views import CreateAssignPermView
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class NotificationTransportCreateView(
 | 
				
			||||||
 | 
					    SuccessMessageMixin,
 | 
				
			||||||
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
 | 
					    LoginRequiredMixin,
 | 
				
			||||||
 | 
					    DjangoPermissionRequiredMixin,
 | 
				
			||||||
 | 
					    CreateAssignPermView,
 | 
				
			||||||
 | 
					):
 | 
				
			||||||
 | 
					    """Create new NotificationTransport"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    model = NotificationTransport
 | 
				
			||||||
 | 
					    form_class = NotificationTransportForm
 | 
				
			||||||
 | 
					    permission_required = "authentik_events.add_notificationtransport"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
 | 
					    success_url = reverse_lazy("authentik_core:shell")
 | 
				
			||||||
 | 
					    success_message = _("Successfully created Notification Transport")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class NotificationTransportUpdateView(
 | 
				
			||||||
 | 
					    SuccessMessageMixin,
 | 
				
			||||||
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
 | 
					    LoginRequiredMixin,
 | 
				
			||||||
 | 
					    PermissionRequiredMixin,
 | 
				
			||||||
 | 
					    UpdateView,
 | 
				
			||||||
 | 
					):
 | 
				
			||||||
 | 
					    """Update application"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    model = NotificationTransport
 | 
				
			||||||
 | 
					    form_class = NotificationTransportForm
 | 
				
			||||||
 | 
					    permission_required = "authentik_events.change_notificationtransport"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    template_name = "generic/update.html"
 | 
				
			||||||
 | 
					    success_url = reverse_lazy("authentik_core:shell")
 | 
				
			||||||
 | 
					    success_message = _("Successfully updated Notification Transport")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class NotificationTransportDeleteView(
 | 
				
			||||||
 | 
					    LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView
 | 
				
			||||||
 | 
					):
 | 
				
			||||||
 | 
					    """Delete application"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    model = NotificationTransport
 | 
				
			||||||
 | 
					    permission_required = "authentik_events.delete_notificationtransport"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
 | 
					    success_url = reverse_lazy("authentik_core:shell")
 | 
				
			||||||
 | 
					    success_message = _("Successfully deleted Notification Transport")
 | 
				
			||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
"""passbook Flow administration"""
 | 
					"""authentik Flow administration"""
 | 
				
			||||||
from django.contrib import messages
 | 
					from django.contrib import messages
 | 
				
			||||||
from django.contrib.auth.mixins import LoginRequiredMixin
 | 
					from django.contrib.auth.mixins import LoginRequiredMixin
 | 
				
			||||||
from django.contrib.auth.mixins import (
 | 
					from django.contrib.auth.mixins import (
 | 
				
			||||||
@ -11,21 +11,21 @@ from django.utils.translation import gettext as _
 | 
				
			|||||||
from django.views.generic import DetailView, FormView, ListView, UpdateView
 | 
					from django.views.generic import DetailView, FormView, ListView, UpdateView
 | 
				
			||||||
from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
					from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.views.utils import (
 | 
					from authentik.admin.views.utils import (
 | 
				
			||||||
    BackSuccessUrlMixin,
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
    DeleteMessageView,
 | 
					    DeleteMessageView,
 | 
				
			||||||
    SearchListMixin,
 | 
					    SearchListMixin,
 | 
				
			||||||
    UserPaginateListMixin,
 | 
					    UserPaginateListMixin,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from passbook.flows.forms import FlowForm, FlowImportForm
 | 
					from authentik.flows.forms import FlowForm, FlowImportForm
 | 
				
			||||||
from passbook.flows.models import Flow
 | 
					from authentik.flows.models import Flow
 | 
				
			||||||
from passbook.flows.planner import PLAN_CONTEXT_PENDING_USER
 | 
					from authentik.flows.planner import PLAN_CONTEXT_PENDING_USER
 | 
				
			||||||
from passbook.flows.transfer.common import DataclassEncoder
 | 
					from authentik.flows.transfer.common import DataclassEncoder
 | 
				
			||||||
from passbook.flows.transfer.exporter import FlowExporter
 | 
					from authentik.flows.transfer.exporter import FlowExporter
 | 
				
			||||||
from passbook.flows.transfer.importer import FlowImporter
 | 
					from authentik.flows.transfer.importer import FlowImporter
 | 
				
			||||||
from passbook.flows.views import SESSION_KEY_PLAN, FlowPlanner
 | 
					from authentik.flows.views import SESSION_KEY_PLAN, FlowPlanner
 | 
				
			||||||
from passbook.lib.utils.urls import redirect_with_qs
 | 
					from authentik.lib.utils.urls import redirect_with_qs
 | 
				
			||||||
from passbook.lib.views import CreateAssignPermView
 | 
					from authentik.lib.views import CreateAssignPermView
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class FlowListView(
 | 
					class FlowListView(
 | 
				
			||||||
@ -38,7 +38,7 @@ class FlowListView(
 | 
				
			|||||||
    """Show list of all flows"""
 | 
					    """Show list of all flows"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Flow
 | 
					    model = Flow
 | 
				
			||||||
    permission_required = "passbook_flows.view_flow"
 | 
					    permission_required = "authentik_flows.view_flow"
 | 
				
			||||||
    ordering = "name"
 | 
					    ordering = "name"
 | 
				
			||||||
    template_name = "administration/flow/list.html"
 | 
					    template_name = "administration/flow/list.html"
 | 
				
			||||||
    search_fields = ["name", "slug", "designation", "title"]
 | 
					    search_fields = ["name", "slug", "designation", "title"]
 | 
				
			||||||
@ -55,10 +55,10 @@ class FlowCreateView(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    model = Flow
 | 
					    model = Flow
 | 
				
			||||||
    form_class = FlowForm
 | 
					    form_class = FlowForm
 | 
				
			||||||
    permission_required = "passbook_flows.add_flow"
 | 
					    permission_required = "authentik_flows.add_flow"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/create.html"
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:flows")
 | 
					    success_url = reverse_lazy("authentik_admin:flows")
 | 
				
			||||||
    success_message = _("Successfully created Flow")
 | 
					    success_message = _("Successfully created Flow")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -73,10 +73,10 @@ class FlowUpdateView(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    model = Flow
 | 
					    model = Flow
 | 
				
			||||||
    form_class = FlowForm
 | 
					    form_class = FlowForm
 | 
				
			||||||
    permission_required = "passbook_flows.change_flow"
 | 
					    permission_required = "authentik_flows.change_flow"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/update.html"
 | 
					    template_name = "generic/update.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:flows")
 | 
					    success_url = reverse_lazy("authentik_admin:flows")
 | 
				
			||||||
    success_message = _("Successfully updated Flow")
 | 
					    success_message = _("Successfully updated Flow")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -84,10 +84,10 @@ class FlowDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageV
 | 
				
			|||||||
    """Delete flow"""
 | 
					    """Delete flow"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Flow
 | 
					    model = Flow
 | 
				
			||||||
    permission_required = "passbook_flows.delete_flow"
 | 
					    permission_required = "authentik_flows.delete_flow"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/delete.html"
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:flows")
 | 
					    success_url = reverse_lazy("authentik_admin:flows")
 | 
				
			||||||
    success_message = _("Successfully deleted Flow")
 | 
					    success_message = _("Successfully deleted Flow")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -95,7 +95,7 @@ class FlowDebugExecuteView(LoginRequiredMixin, PermissionRequiredMixin, DetailVi
 | 
				
			|||||||
    """Debug exectue flow, setting the current user as pending user"""
 | 
					    """Debug exectue flow, setting the current user as pending user"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Flow
 | 
					    model = Flow
 | 
				
			||||||
    permission_required = "passbook_flows.view_flow"
 | 
					    permission_required = "authentik_flows.view_flow"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # pylint: disable=unused-argument
 | 
					    # pylint: disable=unused-argument
 | 
				
			||||||
    def get(self, request: HttpRequest, pk: str) -> HttpResponse:
 | 
					    def get(self, request: HttpRequest, pk: str) -> HttpResponse:
 | 
				
			||||||
@ -106,7 +106,7 @@ class FlowDebugExecuteView(LoginRequiredMixin, PermissionRequiredMixin, DetailVi
 | 
				
			|||||||
        plan = planner.plan(self.request, {PLAN_CONTEXT_PENDING_USER: request.user})
 | 
					        plan = planner.plan(self.request, {PLAN_CONTEXT_PENDING_USER: request.user})
 | 
				
			||||||
        self.request.session[SESSION_KEY_PLAN] = plan
 | 
					        self.request.session[SESSION_KEY_PLAN] = plan
 | 
				
			||||||
        return redirect_with_qs(
 | 
					        return redirect_with_qs(
 | 
				
			||||||
            "passbook_flows:flow-executor-shell",
 | 
					            "authentik_flows:flow-executor-shell",
 | 
				
			||||||
            self.request.GET,
 | 
					            self.request.GET,
 | 
				
			||||||
            flow_slug=flow.slug,
 | 
					            flow_slug=flow.slug,
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
@ -118,7 +118,7 @@ class FlowImportView(LoginRequiredMixin, FormView):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    form_class = FlowImportForm
 | 
					    form_class = FlowImportForm
 | 
				
			||||||
    template_name = "administration/flow/import.html"
 | 
					    template_name = "administration/flow/import.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:flows")
 | 
					    success_url = reverse_lazy("authentik_admin:flows")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def dispatch(self, request, *args, **kwargs):
 | 
					    def dispatch(self, request, *args, **kwargs):
 | 
				
			||||||
        if not request.user.is_superuser:
 | 
					        if not request.user.is_superuser:
 | 
				
			||||||
@ -139,7 +139,7 @@ class FlowExportView(LoginRequiredMixin, PermissionRequiredMixin, DetailView):
 | 
				
			|||||||
    """Export Flow"""
 | 
					    """Export Flow"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Flow
 | 
					    model = Flow
 | 
				
			||||||
    permission_required = "passbook_flows.export_flow"
 | 
					    permission_required = "authentik_flows.export_flow"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # pylint: disable=unused-argument
 | 
					    # pylint: disable=unused-argument
 | 
				
			||||||
    def get(self, request: HttpRequest, pk: str) -> HttpResponse:
 | 
					    def get(self, request: HttpRequest, pk: str) -> HttpResponse:
 | 
				
			||||||
@ -147,5 +147,5 @@ class FlowExportView(LoginRequiredMixin, PermissionRequiredMixin, DetailView):
 | 
				
			|||||||
        flow: Flow = self.get_object()
 | 
					        flow: Flow = self.get_object()
 | 
				
			||||||
        exporter = FlowExporter(flow)
 | 
					        exporter = FlowExporter(flow)
 | 
				
			||||||
        response = JsonResponse(exporter.export(), encoder=DataclassEncoder, safe=False)
 | 
					        response = JsonResponse(exporter.export(), encoder=DataclassEncoder, safe=False)
 | 
				
			||||||
        response["Content-Disposition"] = f'attachment; filename="{flow.slug}.json"'
 | 
					        response["Content-Disposition"] = f'attachment; filename="{flow.slug}.akflow"'
 | 
				
			||||||
        return response
 | 
					        return response
 | 
				
			||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
"""passbook Group administration"""
 | 
					"""authentik Group administration"""
 | 
				
			||||||
from django.contrib.auth.mixins import LoginRequiredMixin
 | 
					from django.contrib.auth.mixins import LoginRequiredMixin
 | 
				
			||||||
from django.contrib.auth.mixins import (
 | 
					from django.contrib.auth.mixins import (
 | 
				
			||||||
    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
					    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
				
			||||||
@ -9,15 +9,15 @@ from django.utils.translation import gettext as _
 | 
				
			|||||||
from django.views.generic import ListView, UpdateView
 | 
					from django.views.generic import ListView, UpdateView
 | 
				
			||||||
from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
					from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.views.utils import (
 | 
					from authentik.admin.views.utils import (
 | 
				
			||||||
    BackSuccessUrlMixin,
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
    DeleteMessageView,
 | 
					    DeleteMessageView,
 | 
				
			||||||
    SearchListMixin,
 | 
					    SearchListMixin,
 | 
				
			||||||
    UserPaginateListMixin,
 | 
					    UserPaginateListMixin,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from passbook.core.forms.groups import GroupForm
 | 
					from authentik.core.forms.groups import GroupForm
 | 
				
			||||||
from passbook.core.models import Group
 | 
					from authentik.core.models import Group
 | 
				
			||||||
from passbook.lib.views import CreateAssignPermView
 | 
					from authentik.lib.views import CreateAssignPermView
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class GroupListView(
 | 
					class GroupListView(
 | 
				
			||||||
@ -30,7 +30,7 @@ class GroupListView(
 | 
				
			|||||||
    """Show list of all groups"""
 | 
					    """Show list of all groups"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Group
 | 
					    model = Group
 | 
				
			||||||
    permission_required = "passbook_core.view_group"
 | 
					    permission_required = "authentik_core.view_group"
 | 
				
			||||||
    ordering = "name"
 | 
					    ordering = "name"
 | 
				
			||||||
    template_name = "administration/group/list.html"
 | 
					    template_name = "administration/group/list.html"
 | 
				
			||||||
    search_fields = ["name", "attributes"]
 | 
					    search_fields = ["name", "attributes"]
 | 
				
			||||||
@ -47,10 +47,10 @@ class GroupCreateView(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    model = Group
 | 
					    model = Group
 | 
				
			||||||
    form_class = GroupForm
 | 
					    form_class = GroupForm
 | 
				
			||||||
    permission_required = "passbook_core.add_group"
 | 
					    permission_required = "authentik_core.add_group"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/create.html"
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:groups")
 | 
					    success_url = reverse_lazy("authentik_admin:groups")
 | 
				
			||||||
    success_message = _("Successfully created Group")
 | 
					    success_message = _("Successfully created Group")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -65,10 +65,10 @@ class GroupUpdateView(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    model = Group
 | 
					    model = Group
 | 
				
			||||||
    form_class = GroupForm
 | 
					    form_class = GroupForm
 | 
				
			||||||
    permission_required = "passbook_core.change_group"
 | 
					    permission_required = "authentik_core.change_group"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/update.html"
 | 
					    template_name = "generic/update.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:groups")
 | 
					    success_url = reverse_lazy("authentik_admin:groups")
 | 
				
			||||||
    success_message = _("Successfully updated Group")
 | 
					    success_message = _("Successfully updated Group")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -76,8 +76,8 @@ class GroupDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessage
 | 
				
			|||||||
    """Delete group"""
 | 
					    """Delete group"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Group
 | 
					    model = Group
 | 
				
			||||||
    permission_required = "passbook_flows.delete_group"
 | 
					    permission_required = "authentik_flows.delete_group"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/delete.html"
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:groups")
 | 
					    success_url = reverse_lazy("authentik_admin:groups")
 | 
				
			||||||
    success_message = _("Successfully deleted Group")
 | 
					    success_message = _("Successfully deleted Group")
 | 
				
			||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
"""passbook Outpost administration"""
 | 
					"""authentik Outpost administration"""
 | 
				
			||||||
from dataclasses import asdict
 | 
					from dataclasses import asdict
 | 
				
			||||||
from typing import Any, Dict
 | 
					from typing import Any, Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -12,15 +12,15 @@ from django.utils.translation import gettext as _
 | 
				
			|||||||
from django.views.generic import ListView, UpdateView
 | 
					from django.views.generic import ListView, UpdateView
 | 
				
			||||||
from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
					from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.views.utils import (
 | 
					from authentik.admin.views.utils import (
 | 
				
			||||||
    BackSuccessUrlMixin,
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
    DeleteMessageView,
 | 
					    DeleteMessageView,
 | 
				
			||||||
    SearchListMixin,
 | 
					    SearchListMixin,
 | 
				
			||||||
    UserPaginateListMixin,
 | 
					    UserPaginateListMixin,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from passbook.lib.views import CreateAssignPermView
 | 
					from authentik.lib.views import CreateAssignPermView
 | 
				
			||||||
from passbook.outposts.forms import OutpostForm
 | 
					from authentik.outposts.forms import OutpostForm
 | 
				
			||||||
from passbook.outposts.models import Outpost, OutpostConfig
 | 
					from authentik.outposts.models import Outpost, OutpostConfig
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class OutpostListView(
 | 
					class OutpostListView(
 | 
				
			||||||
@ -33,7 +33,7 @@ class OutpostListView(
 | 
				
			|||||||
    """Show list of all outposts"""
 | 
					    """Show list of all outposts"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Outpost
 | 
					    model = Outpost
 | 
				
			||||||
    permission_required = "passbook_outposts.view_outpost"
 | 
					    permission_required = "authentik_outposts.view_outpost"
 | 
				
			||||||
    ordering = "name"
 | 
					    ordering = "name"
 | 
				
			||||||
    template_name = "administration/outpost/list.html"
 | 
					    template_name = "administration/outpost/list.html"
 | 
				
			||||||
    search_fields = ["name", "_config"]
 | 
					    search_fields = ["name", "_config"]
 | 
				
			||||||
@ -50,16 +50,16 @@ class OutpostCreateView(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    model = Outpost
 | 
					    model = Outpost
 | 
				
			||||||
    form_class = OutpostForm
 | 
					    form_class = OutpostForm
 | 
				
			||||||
    permission_required = "passbook_outposts.add_outpost"
 | 
					    permission_required = "authentik_outposts.add_outpost"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/create.html"
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:outposts")
 | 
					    success_url = reverse_lazy("authentik_admin:outposts")
 | 
				
			||||||
    success_message = _("Successfully created Outpost")
 | 
					    success_message = _("Successfully created Outpost")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_initial(self) -> Dict[str, Any]:
 | 
					    def get_initial(self) -> Dict[str, Any]:
 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
            "_config": asdict(
 | 
					            "_config": asdict(
 | 
				
			||||||
                OutpostConfig(passbook_host=self.request.build_absolute_uri("/"))
 | 
					                OutpostConfig(authentik_host=self.request.build_absolute_uri("/"))
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -75,10 +75,10 @@ class OutpostUpdateView(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    model = Outpost
 | 
					    model = Outpost
 | 
				
			||||||
    form_class = OutpostForm
 | 
					    form_class = OutpostForm
 | 
				
			||||||
    permission_required = "passbook_outposts.change_outpost"
 | 
					    permission_required = "authentik_outposts.change_outpost"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/update.html"
 | 
					    template_name = "generic/update.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:outposts")
 | 
					    success_url = reverse_lazy("authentik_admin:outposts")
 | 
				
			||||||
    success_message = _("Successfully updated Outpost")
 | 
					    success_message = _("Successfully updated Outpost")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -86,8 +86,8 @@ class OutpostDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessa
 | 
				
			|||||||
    """Delete outpost"""
 | 
					    """Delete outpost"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Outpost
 | 
					    model = Outpost
 | 
				
			||||||
    permission_required = "passbook_outposts.delete_outpost"
 | 
					    permission_required = "authentik_outposts.delete_outpost"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/delete.html"
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:outposts")
 | 
					    success_url = reverse_lazy("authentik_admin:outposts")
 | 
				
			||||||
    success_message = _("Successfully deleted Outpost")
 | 
					    success_message = _("Successfully deleted Outpost")
 | 
				
			||||||
							
								
								
									
										83
									
								
								authentik/admin/views/outposts_service_connections.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										83
									
								
								authentik/admin/views/outposts_service_connections.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,83 @@
 | 
				
			|||||||
 | 
					"""authentik OutpostServiceConnection administration"""
 | 
				
			||||||
 | 
					from django.contrib.auth.mixins import LoginRequiredMixin
 | 
				
			||||||
 | 
					from django.contrib.auth.mixins import (
 | 
				
			||||||
 | 
					    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					from django.contrib.messages.views import SuccessMessageMixin
 | 
				
			||||||
 | 
					from django.urls import reverse_lazy
 | 
				
			||||||
 | 
					from django.utils.translation import gettext as _
 | 
				
			||||||
 | 
					from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from authentik.admin.views.utils import (
 | 
				
			||||||
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
 | 
					    DeleteMessageView,
 | 
				
			||||||
 | 
					    InheritanceCreateView,
 | 
				
			||||||
 | 
					    InheritanceListView,
 | 
				
			||||||
 | 
					    InheritanceUpdateView,
 | 
				
			||||||
 | 
					    SearchListMixin,
 | 
				
			||||||
 | 
					    UserPaginateListMixin,
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					from authentik.outposts.models import OutpostServiceConnection
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class OutpostServiceConnectionListView(
 | 
				
			||||||
 | 
					    LoginRequiredMixin,
 | 
				
			||||||
 | 
					    PermissionListMixin,
 | 
				
			||||||
 | 
					    UserPaginateListMixin,
 | 
				
			||||||
 | 
					    SearchListMixin,
 | 
				
			||||||
 | 
					    InheritanceListView,
 | 
				
			||||||
 | 
					):
 | 
				
			||||||
 | 
					    """Show list of all outpost-service-connections"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    model = OutpostServiceConnection
 | 
				
			||||||
 | 
					    permission_required = "authentik_outposts.add_outpostserviceconnection"
 | 
				
			||||||
 | 
					    template_name = "administration/outpost_service_connection/list.html"
 | 
				
			||||||
 | 
					    ordering = "pk"
 | 
				
			||||||
 | 
					    search_fields = ["pk", "name"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class OutpostServiceConnectionCreateView(
 | 
				
			||||||
 | 
					    SuccessMessageMixin,
 | 
				
			||||||
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
 | 
					    LoginRequiredMixin,
 | 
				
			||||||
 | 
					    DjangoPermissionRequiredMixin,
 | 
				
			||||||
 | 
					    InheritanceCreateView,
 | 
				
			||||||
 | 
					):
 | 
				
			||||||
 | 
					    """Create new OutpostServiceConnection"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    model = OutpostServiceConnection
 | 
				
			||||||
 | 
					    permission_required = "authentik_outposts.add_outpostserviceconnection"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
 | 
					    success_url = reverse_lazy("authentik_admin:outpost-service-connections")
 | 
				
			||||||
 | 
					    success_message = _("Successfully created OutpostServiceConnection")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class OutpostServiceConnectionUpdateView(
 | 
				
			||||||
 | 
					    SuccessMessageMixin,
 | 
				
			||||||
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
 | 
					    LoginRequiredMixin,
 | 
				
			||||||
 | 
					    PermissionRequiredMixin,
 | 
				
			||||||
 | 
					    InheritanceUpdateView,
 | 
				
			||||||
 | 
					):
 | 
				
			||||||
 | 
					    """Update outpostserviceconnection"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    model = OutpostServiceConnection
 | 
				
			||||||
 | 
					    permission_required = "authentik_outposts.change_outpostserviceconnection"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    template_name = "generic/update.html"
 | 
				
			||||||
 | 
					    success_url = reverse_lazy("authentik_admin:outpost-service-connections")
 | 
				
			||||||
 | 
					    success_message = _("Successfully updated OutpostServiceConnection")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class OutpostServiceConnectionDeleteView(
 | 
				
			||||||
 | 
					    LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView
 | 
				
			||||||
 | 
					):
 | 
				
			||||||
 | 
					    """Delete outpostserviceconnection"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    model = OutpostServiceConnection
 | 
				
			||||||
 | 
					    permission_required = "authentik_outposts.delete_outpostserviceconnection"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
 | 
					    success_url = reverse_lazy("authentik_admin:outpost-service-connections")
 | 
				
			||||||
 | 
					    success_message = _("Successfully deleted OutpostServiceConnection")
 | 
				
			||||||
							
								
								
									
										49
									
								
								authentik/admin/views/overview.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								authentik/admin/views/overview.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,49 @@
 | 
				
			|||||||
 | 
					"""authentik administration overview"""
 | 
				
			||||||
 | 
					from django.contrib.messages.views import SuccessMessageMixin
 | 
				
			||||||
 | 
					from django.core.cache import cache
 | 
				
			||||||
 | 
					from django.http.request import HttpRequest
 | 
				
			||||||
 | 
					from django.http.response import HttpResponse
 | 
				
			||||||
 | 
					from django.utils.translation import gettext as _
 | 
				
			||||||
 | 
					from django.views.generic import FormView
 | 
				
			||||||
 | 
					from structlog.stdlib import get_logger
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from authentik.admin.forms.overview import FlowCacheClearForm, PolicyCacheClearForm
 | 
				
			||||||
 | 
					from authentik.admin.mixins import AdminRequiredMixin
 | 
				
			||||||
 | 
					from authentik.core.api.applications import user_app_cache_key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					LOGGER = get_logger()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class PolicyCacheClearView(AdminRequiredMixin, SuccessMessageMixin, FormView):
 | 
				
			||||||
 | 
					    """View to clear Policy cache"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    form_class = PolicyCacheClearForm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    template_name = "generic/form_non_model.html"
 | 
				
			||||||
 | 
					    success_url = "/"
 | 
				
			||||||
 | 
					    success_message = _("Successfully cleared Policy cache")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def post(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
 | 
				
			||||||
 | 
					        keys = cache.keys("policy_*")
 | 
				
			||||||
 | 
					        cache.delete_many(keys)
 | 
				
			||||||
 | 
					        LOGGER.debug("Cleared Policy cache", keys=len(keys))
 | 
				
			||||||
 | 
					        # Also delete user application cache
 | 
				
			||||||
 | 
					        keys = user_app_cache_key("*")
 | 
				
			||||||
 | 
					        cache.delete_many(keys)
 | 
				
			||||||
 | 
					        return super().post(request, *args, **kwargs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class FlowCacheClearView(AdminRequiredMixin, SuccessMessageMixin, FormView):
 | 
				
			||||||
 | 
					    """View to clear Flow cache"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    form_class = FlowCacheClearForm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    template_name = "generic/form_non_model.html"
 | 
				
			||||||
 | 
					    success_url = "/"
 | 
				
			||||||
 | 
					    success_message = _("Successfully cleared Flow cache")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def post(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
 | 
				
			||||||
 | 
					        keys = cache.keys("flow_*")
 | 
				
			||||||
 | 
					        cache.delete_many(keys)
 | 
				
			||||||
 | 
					        LOGGER.debug("Cleared flow cache", keys=len(keys))
 | 
				
			||||||
 | 
					        return super().post(request, *args, **kwargs)
 | 
				
			||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
"""passbook Policy administration"""
 | 
					"""authentik Policy administration"""
 | 
				
			||||||
from typing import Any, Dict
 | 
					from typing import Any, Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from django.contrib import messages
 | 
					from django.contrib import messages
 | 
				
			||||||
@ -15,8 +15,8 @@ from django.views.generic import FormView
 | 
				
			|||||||
from django.views.generic.detail import DetailView
 | 
					from django.views.generic.detail import DetailView
 | 
				
			||||||
from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
					from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.forms.policies import PolicyTestForm
 | 
					from authentik.admin.forms.policies import PolicyTestForm
 | 
				
			||||||
from passbook.admin.views.utils import (
 | 
					from authentik.admin.views.utils import (
 | 
				
			||||||
    BackSuccessUrlMixin,
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
    DeleteMessageView,
 | 
					    DeleteMessageView,
 | 
				
			||||||
    InheritanceCreateView,
 | 
					    InheritanceCreateView,
 | 
				
			||||||
@ -25,8 +25,8 @@ from passbook.admin.views.utils import (
 | 
				
			|||||||
    SearchListMixin,
 | 
					    SearchListMixin,
 | 
				
			||||||
    UserPaginateListMixin,
 | 
					    UserPaginateListMixin,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from passbook.policies.models import Policy, PolicyBinding
 | 
					from authentik.policies.models import Policy, PolicyBinding
 | 
				
			||||||
from passbook.policies.process import PolicyProcess, PolicyRequest
 | 
					from authentik.policies.process import PolicyProcess, PolicyRequest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class PolicyListView(
 | 
					class PolicyListView(
 | 
				
			||||||
@ -39,7 +39,7 @@ class PolicyListView(
 | 
				
			|||||||
    """Show list of all policies"""
 | 
					    """Show list of all policies"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Policy
 | 
					    model = Policy
 | 
				
			||||||
    permission_required = "passbook_policies.view_policy"
 | 
					    permission_required = "authentik_policies.view_policy"
 | 
				
			||||||
    ordering = "name"
 | 
					    ordering = "name"
 | 
				
			||||||
    template_name = "administration/policy/list.html"
 | 
					    template_name = "administration/policy/list.html"
 | 
				
			||||||
    search_fields = ["name"]
 | 
					    search_fields = ["name"]
 | 
				
			||||||
@ -55,10 +55,10 @@ class PolicyCreateView(
 | 
				
			|||||||
    """Create new Policy"""
 | 
					    """Create new Policy"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Policy
 | 
					    model = Policy
 | 
				
			||||||
    permission_required = "passbook_policies.add_policy"
 | 
					    permission_required = "authentik_policies.add_policy"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/create.html"
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:policies")
 | 
					    success_url = reverse_lazy("authentik_admin:policies")
 | 
				
			||||||
    success_message = _("Successfully created Policy")
 | 
					    success_message = _("Successfully created Policy")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -72,10 +72,10 @@ class PolicyUpdateView(
 | 
				
			|||||||
    """Update policy"""
 | 
					    """Update policy"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Policy
 | 
					    model = Policy
 | 
				
			||||||
    permission_required = "passbook_policies.change_policy"
 | 
					    permission_required = "authentik_policies.change_policy"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/update.html"
 | 
					    template_name = "generic/update.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:policies")
 | 
					    success_url = reverse_lazy("authentik_admin:policies")
 | 
				
			||||||
    success_message = _("Successfully updated Policy")
 | 
					    success_message = _("Successfully updated Policy")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -83,10 +83,10 @@ class PolicyDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessag
 | 
				
			|||||||
    """Delete policy"""
 | 
					    """Delete policy"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Policy
 | 
					    model = Policy
 | 
				
			||||||
    permission_required = "passbook_policies.delete_policy"
 | 
					    permission_required = "authentik_policies.delete_policy"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/delete.html"
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:policies")
 | 
					    success_url = reverse_lazy("authentik_admin:policies")
 | 
				
			||||||
    success_message = _("Successfully deleted Policy")
 | 
					    success_message = _("Successfully deleted Policy")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -95,7 +95,7 @@ class PolicyTestView(LoginRequiredMixin, DetailView, PermissionRequiredMixin, Fo
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    model = Policy
 | 
					    model = Policy
 | 
				
			||||||
    form_class = PolicyTestForm
 | 
					    form_class = PolicyTestForm
 | 
				
			||||||
    permission_required = "passbook_policies.view_policy"
 | 
					    permission_required = "authentik_policies.view_policy"
 | 
				
			||||||
    template_name = "administration/policy/test.html"
 | 
					    template_name = "administration/policy/test.html"
 | 
				
			||||||
    object = None
 | 
					    object = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1,24 +1,26 @@
 | 
				
			|||||||
"""passbook PolicyBinding administration"""
 | 
					"""authentik PolicyBinding administration"""
 | 
				
			||||||
 | 
					from typing import Any
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from django.contrib.auth.mixins import LoginRequiredMixin
 | 
					from django.contrib.auth.mixins import LoginRequiredMixin
 | 
				
			||||||
from django.contrib.auth.mixins import (
 | 
					from django.contrib.auth.mixins import (
 | 
				
			||||||
    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
					    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from django.contrib.messages.views import SuccessMessageMixin
 | 
					from django.contrib.messages.views import SuccessMessageMixin
 | 
				
			||||||
from django.db.models import QuerySet
 | 
					from django.db.models import Max, QuerySet
 | 
				
			||||||
from django.urls import reverse_lazy
 | 
					from django.urls import reverse_lazy
 | 
				
			||||||
from django.utils.translation import gettext as _
 | 
					from django.utils.translation import gettext as _
 | 
				
			||||||
from django.views.generic import ListView, UpdateView
 | 
					from django.views.generic import ListView, UpdateView
 | 
				
			||||||
from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
					from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
				
			||||||
from guardian.shortcuts import get_objects_for_user
 | 
					from guardian.shortcuts import get_objects_for_user
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.views.utils import (
 | 
					from authentik.admin.views.utils import (
 | 
				
			||||||
    BackSuccessUrlMixin,
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
    DeleteMessageView,
 | 
					    DeleteMessageView,
 | 
				
			||||||
    UserPaginateListMixin,
 | 
					    UserPaginateListMixin,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from passbook.lib.views import CreateAssignPermView
 | 
					from authentik.lib.views import CreateAssignPermView
 | 
				
			||||||
from passbook.policies.forms import PolicyBindingForm
 | 
					from authentik.policies.forms import PolicyBindingForm
 | 
				
			||||||
from passbook.policies.models import PolicyBinding
 | 
					from authentik.policies.models import PolicyBinding, PolicyBindingModel
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class PolicyBindingListView(
 | 
					class PolicyBindingListView(
 | 
				
			||||||
@ -27,7 +29,7 @@ class PolicyBindingListView(
 | 
				
			|||||||
    """Show list of all policies"""
 | 
					    """Show list of all policies"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = PolicyBinding
 | 
					    model = PolicyBinding
 | 
				
			||||||
    permission_required = "passbook_policies.view_policybinding"
 | 
					    permission_required = "authentik_policies.view_policybinding"
 | 
				
			||||||
    ordering = ["order", "target"]
 | 
					    ordering = ["order", "target"]
 | 
				
			||||||
    template_name = "administration/policy_binding/list.html"
 | 
					    template_name = "administration/policy_binding/list.html"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -36,7 +38,7 @@ class PolicyBindingListView(
 | 
				
			|||||||
        # First, get all pbm objects that have bindings attached
 | 
					        # First, get all pbm objects that have bindings attached
 | 
				
			||||||
        objects = (
 | 
					        objects = (
 | 
				
			||||||
            get_objects_for_user(
 | 
					            get_objects_for_user(
 | 
				
			||||||
                self.request.user, "passbook_policies.view_policybindingmodel"
 | 
					                self.request.user, "authentik_policies.view_policybindingmodel"
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
            .filter(policies__isnull=False)
 | 
					            .filter(policies__isnull=False)
 | 
				
			||||||
            .select_subclasses()
 | 
					            .select_subclasses()
 | 
				
			||||||
@ -60,13 +62,29 @@ class PolicyBindingCreateView(
 | 
				
			|||||||
    """Create new PolicyBinding"""
 | 
					    """Create new PolicyBinding"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = PolicyBinding
 | 
					    model = PolicyBinding
 | 
				
			||||||
    permission_required = "passbook_policies.add_policybinding"
 | 
					    permission_required = "authentik_policies.add_policybinding"
 | 
				
			||||||
    form_class = PolicyBindingForm
 | 
					    form_class = PolicyBindingForm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/create.html"
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:policies-bindings")
 | 
					    success_url = reverse_lazy("authentik_admin:policies-bindings")
 | 
				
			||||||
    success_message = _("Successfully created PolicyBinding")
 | 
					    success_message = _("Successfully created PolicyBinding")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get_initial(self) -> dict[str, Any]:
 | 
				
			||||||
 | 
					        if "target" in self.request.GET:
 | 
				
			||||||
 | 
					            initial_target_pk = self.request.GET["target"]
 | 
				
			||||||
 | 
					            targets = PolicyBindingModel.objects.filter(
 | 
				
			||||||
 | 
					                pk=initial_target_pk
 | 
				
			||||||
 | 
					            ).select_subclasses()
 | 
				
			||||||
 | 
					            if not targets.exists():
 | 
				
			||||||
 | 
					                return {}
 | 
				
			||||||
 | 
					            max_order = PolicyBinding.objects.filter(target=targets.first()).aggregate(
 | 
				
			||||||
 | 
					                Max("order")
 | 
				
			||||||
 | 
					            )["order__max"]
 | 
				
			||||||
 | 
					            if not isinstance(max_order, int):
 | 
				
			||||||
 | 
					                max_order = -1
 | 
				
			||||||
 | 
					            return {"target": targets.first(), "order": max_order + 1}
 | 
				
			||||||
 | 
					        return super().get_initial()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class PolicyBindingUpdateView(
 | 
					class PolicyBindingUpdateView(
 | 
				
			||||||
    SuccessMessageMixin,
 | 
					    SuccessMessageMixin,
 | 
				
			||||||
@ -78,11 +96,11 @@ class PolicyBindingUpdateView(
 | 
				
			|||||||
    """Update policybinding"""
 | 
					    """Update policybinding"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = PolicyBinding
 | 
					    model = PolicyBinding
 | 
				
			||||||
    permission_required = "passbook_policies.change_policybinding"
 | 
					    permission_required = "authentik_policies.change_policybinding"
 | 
				
			||||||
    form_class = PolicyBindingForm
 | 
					    form_class = PolicyBindingForm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/update.html"
 | 
					    template_name = "generic/update.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:policies-bindings")
 | 
					    success_url = reverse_lazy("authentik_admin:policies-bindings")
 | 
				
			||||||
    success_message = _("Successfully updated PolicyBinding")
 | 
					    success_message = _("Successfully updated PolicyBinding")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -92,8 +110,8 @@ class PolicyBindingDeleteView(
 | 
				
			|||||||
    """Delete policybinding"""
 | 
					    """Delete policybinding"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = PolicyBinding
 | 
					    model = PolicyBinding
 | 
				
			||||||
    permission_required = "passbook_policies.delete_policybinding"
 | 
					    permission_required = "authentik_policies.delete_policybinding"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/delete.html"
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:policies-bindings")
 | 
					    success_url = reverse_lazy("authentik_admin:policies-bindings")
 | 
				
			||||||
    success_message = _("Successfully deleted PolicyBinding")
 | 
					    success_message = _("Successfully deleted PolicyBinding")
 | 
				
			||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
"""passbook PropertyMapping administration"""
 | 
					"""authentik PropertyMapping administration"""
 | 
				
			||||||
from django.contrib.auth.mixins import LoginRequiredMixin
 | 
					from django.contrib.auth.mixins import LoginRequiredMixin
 | 
				
			||||||
from django.contrib.auth.mixins import (
 | 
					from django.contrib.auth.mixins import (
 | 
				
			||||||
    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
					    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
				
			||||||
@ -8,7 +8,7 @@ from django.urls import reverse_lazy
 | 
				
			|||||||
from django.utils.translation import gettext as _
 | 
					from django.utils.translation import gettext as _
 | 
				
			||||||
from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
					from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.views.utils import (
 | 
					from authentik.admin.views.utils import (
 | 
				
			||||||
    BackSuccessUrlMixin,
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
    DeleteMessageView,
 | 
					    DeleteMessageView,
 | 
				
			||||||
    InheritanceCreateView,
 | 
					    InheritanceCreateView,
 | 
				
			||||||
@ -17,7 +17,7 @@ from passbook.admin.views.utils import (
 | 
				
			|||||||
    SearchListMixin,
 | 
					    SearchListMixin,
 | 
				
			||||||
    UserPaginateListMixin,
 | 
					    UserPaginateListMixin,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from passbook.core.models import PropertyMapping
 | 
					from authentik.core.models import PropertyMapping
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class PropertyMappingListView(
 | 
					class PropertyMappingListView(
 | 
				
			||||||
@ -30,7 +30,7 @@ class PropertyMappingListView(
 | 
				
			|||||||
    """Show list of all property_mappings"""
 | 
					    """Show list of all property_mappings"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = PropertyMapping
 | 
					    model = PropertyMapping
 | 
				
			||||||
    permission_required = "passbook_core.view_propertymapping"
 | 
					    permission_required = "authentik_core.view_propertymapping"
 | 
				
			||||||
    template_name = "administration/property_mapping/list.html"
 | 
					    template_name = "administration/property_mapping/list.html"
 | 
				
			||||||
    ordering = "name"
 | 
					    ordering = "name"
 | 
				
			||||||
    search_fields = ["name", "expression"]
 | 
					    search_fields = ["name", "expression"]
 | 
				
			||||||
@ -46,10 +46,10 @@ class PropertyMappingCreateView(
 | 
				
			|||||||
    """Create new PropertyMapping"""
 | 
					    """Create new PropertyMapping"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = PropertyMapping
 | 
					    model = PropertyMapping
 | 
				
			||||||
    permission_required = "passbook_core.add_propertymapping"
 | 
					    permission_required = "authentik_core.add_propertymapping"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/create.html"
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:property-mappings")
 | 
					    success_url = reverse_lazy("authentik_admin:property-mappings")
 | 
				
			||||||
    success_message = _("Successfully created Property Mapping")
 | 
					    success_message = _("Successfully created Property Mapping")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -63,10 +63,10 @@ class PropertyMappingUpdateView(
 | 
				
			|||||||
    """Update property_mapping"""
 | 
					    """Update property_mapping"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = PropertyMapping
 | 
					    model = PropertyMapping
 | 
				
			||||||
    permission_required = "passbook_core.change_propertymapping"
 | 
					    permission_required = "authentik_core.change_propertymapping"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/update.html"
 | 
					    template_name = "generic/update.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:property-mappings")
 | 
					    success_url = reverse_lazy("authentik_admin:property-mappings")
 | 
				
			||||||
    success_message = _("Successfully updated Property Mapping")
 | 
					    success_message = _("Successfully updated Property Mapping")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -76,8 +76,8 @@ class PropertyMappingDeleteView(
 | 
				
			|||||||
    """Delete property_mapping"""
 | 
					    """Delete property_mapping"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = PropertyMapping
 | 
					    model = PropertyMapping
 | 
				
			||||||
    permission_required = "passbook_core.delete_propertymapping"
 | 
					    permission_required = "authentik_core.delete_propertymapping"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/delete.html"
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:property-mappings")
 | 
					    success_url = reverse_lazy("authentik_admin:property-mappings")
 | 
				
			||||||
    success_message = _("Successfully deleted Property Mapping")
 | 
					    success_message = _("Successfully deleted Property Mapping")
 | 
				
			||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
"""passbook Provider administration"""
 | 
					"""authentik Provider administration"""
 | 
				
			||||||
from django.contrib.auth.mixins import LoginRequiredMixin
 | 
					from django.contrib.auth.mixins import LoginRequiredMixin
 | 
				
			||||||
from django.contrib.auth.mixins import (
 | 
					from django.contrib.auth.mixins import (
 | 
				
			||||||
    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
					    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
				
			||||||
@ -8,7 +8,7 @@ from django.urls import reverse_lazy
 | 
				
			|||||||
from django.utils.translation import gettext as _
 | 
					from django.utils.translation import gettext as _
 | 
				
			||||||
from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
					from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.views.utils import (
 | 
					from authentik.admin.views.utils import (
 | 
				
			||||||
    BackSuccessUrlMixin,
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
    DeleteMessageView,
 | 
					    DeleteMessageView,
 | 
				
			||||||
    InheritanceCreateView,
 | 
					    InheritanceCreateView,
 | 
				
			||||||
@ -17,7 +17,7 @@ from passbook.admin.views.utils import (
 | 
				
			|||||||
    SearchListMixin,
 | 
					    SearchListMixin,
 | 
				
			||||||
    UserPaginateListMixin,
 | 
					    UserPaginateListMixin,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from passbook.core.models import Provider
 | 
					from authentik.core.models import Provider
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ProviderListView(
 | 
					class ProviderListView(
 | 
				
			||||||
@ -30,10 +30,10 @@ class ProviderListView(
 | 
				
			|||||||
    """Show list of all providers"""
 | 
					    """Show list of all providers"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Provider
 | 
					    model = Provider
 | 
				
			||||||
    permission_required = "passbook_core.add_provider"
 | 
					    permission_required = "authentik_core.add_provider"
 | 
				
			||||||
    template_name = "administration/provider/list.html"
 | 
					    template_name = "administration/provider/list.html"
 | 
				
			||||||
    ordering = "id"
 | 
					    ordering = "pk"
 | 
				
			||||||
    search_fields = ["id", "name"]
 | 
					    search_fields = ["pk", "name"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ProviderCreateView(
 | 
					class ProviderCreateView(
 | 
				
			||||||
@ -46,10 +46,10 @@ class ProviderCreateView(
 | 
				
			|||||||
    """Create new Provider"""
 | 
					    """Create new Provider"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Provider
 | 
					    model = Provider
 | 
				
			||||||
    permission_required = "passbook_core.add_provider"
 | 
					    permission_required = "authentik_core.add_provider"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/create.html"
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:providers")
 | 
					    success_url = reverse_lazy("authentik_admin:providers")
 | 
				
			||||||
    success_message = _("Successfully created Provider")
 | 
					    success_message = _("Successfully created Provider")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -63,10 +63,10 @@ class ProviderUpdateView(
 | 
				
			|||||||
    """Update provider"""
 | 
					    """Update provider"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Provider
 | 
					    model = Provider
 | 
				
			||||||
    permission_required = "passbook_core.change_provider"
 | 
					    permission_required = "authentik_core.change_provider"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/update.html"
 | 
					    template_name = "generic/update.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:providers")
 | 
					    success_url = reverse_lazy("authentik_admin:providers")
 | 
				
			||||||
    success_message = _("Successfully updated Provider")
 | 
					    success_message = _("Successfully updated Provider")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -76,8 +76,8 @@ class ProviderDeleteView(
 | 
				
			|||||||
    """Delete provider"""
 | 
					    """Delete provider"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Provider
 | 
					    model = Provider
 | 
				
			||||||
    permission_required = "passbook_core.delete_provider"
 | 
					    permission_required = "authentik_core.delete_provider"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/delete.html"
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:providers")
 | 
					    success_url = reverse_lazy("authentik_admin:providers")
 | 
				
			||||||
    success_message = _("Successfully deleted Provider")
 | 
					    success_message = _("Successfully deleted Provider")
 | 
				
			||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
"""passbook Source administration"""
 | 
					"""authentik Source administration"""
 | 
				
			||||||
from django.contrib.auth.mixins import LoginRequiredMixin
 | 
					from django.contrib.auth.mixins import LoginRequiredMixin
 | 
				
			||||||
from django.contrib.auth.mixins import (
 | 
					from django.contrib.auth.mixins import (
 | 
				
			||||||
    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
					    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
				
			||||||
@ -8,7 +8,7 @@ from django.urls import reverse_lazy
 | 
				
			|||||||
from django.utils.translation import gettext as _
 | 
					from django.utils.translation import gettext as _
 | 
				
			||||||
from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
					from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.views.utils import (
 | 
					from authentik.admin.views.utils import (
 | 
				
			||||||
    BackSuccessUrlMixin,
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
    DeleteMessageView,
 | 
					    DeleteMessageView,
 | 
				
			||||||
    InheritanceCreateView,
 | 
					    InheritanceCreateView,
 | 
				
			||||||
@ -17,7 +17,7 @@ from passbook.admin.views.utils import (
 | 
				
			|||||||
    SearchListMixin,
 | 
					    SearchListMixin,
 | 
				
			||||||
    UserPaginateListMixin,
 | 
					    UserPaginateListMixin,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from passbook.core.models import Source
 | 
					from authentik.core.models import Source
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class SourceListView(
 | 
					class SourceListView(
 | 
				
			||||||
@ -30,7 +30,7 @@ class SourceListView(
 | 
				
			|||||||
    """Show list of all sources"""
 | 
					    """Show list of all sources"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Source
 | 
					    model = Source
 | 
				
			||||||
    permission_required = "passbook_core.view_source"
 | 
					    permission_required = "authentik_core.view_source"
 | 
				
			||||||
    ordering = "name"
 | 
					    ordering = "name"
 | 
				
			||||||
    template_name = "administration/source/list.html"
 | 
					    template_name = "administration/source/list.html"
 | 
				
			||||||
    search_fields = ["name", "slug"]
 | 
					    search_fields = ["name", "slug"]
 | 
				
			||||||
@ -46,10 +46,10 @@ class SourceCreateView(
 | 
				
			|||||||
    """Create new Source"""
 | 
					    """Create new Source"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Source
 | 
					    model = Source
 | 
				
			||||||
    permission_required = "passbook_core.add_source"
 | 
					    permission_required = "authentik_core.add_source"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/create.html"
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:sources")
 | 
					    success_url = reverse_lazy("authentik_admin:sources")
 | 
				
			||||||
    success_message = _("Successfully created Source")
 | 
					    success_message = _("Successfully created Source")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -63,10 +63,10 @@ class SourceUpdateView(
 | 
				
			|||||||
    """Update source"""
 | 
					    """Update source"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Source
 | 
					    model = Source
 | 
				
			||||||
    permission_required = "passbook_core.change_source"
 | 
					    permission_required = "authentik_core.change_source"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/update.html"
 | 
					    template_name = "generic/update.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:sources")
 | 
					    success_url = reverse_lazy("authentik_admin:sources")
 | 
				
			||||||
    success_message = _("Successfully updated Source")
 | 
					    success_message = _("Successfully updated Source")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -74,8 +74,8 @@ class SourceDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessag
 | 
				
			|||||||
    """Delete source"""
 | 
					    """Delete source"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Source
 | 
					    model = Source
 | 
				
			||||||
    permission_required = "passbook_core.delete_source"
 | 
					    permission_required = "authentik_core.delete_source"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/delete.html"
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:sources")
 | 
					    success_url = reverse_lazy("authentik_admin:sources")
 | 
				
			||||||
    success_message = _("Successfully deleted Source")
 | 
					    success_message = _("Successfully deleted Source")
 | 
				
			||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
"""passbook Stage administration"""
 | 
					"""authentik Stage administration"""
 | 
				
			||||||
from django.contrib.auth.mixins import LoginRequiredMixin
 | 
					from django.contrib.auth.mixins import LoginRequiredMixin
 | 
				
			||||||
from django.contrib.auth.mixins import (
 | 
					from django.contrib.auth.mixins import (
 | 
				
			||||||
    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
					    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
				
			||||||
@ -8,7 +8,7 @@ from django.urls import reverse_lazy
 | 
				
			|||||||
from django.utils.translation import gettext as _
 | 
					from django.utils.translation import gettext as _
 | 
				
			||||||
from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
					from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.views.utils import (
 | 
					from authentik.admin.views.utils import (
 | 
				
			||||||
    BackSuccessUrlMixin,
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
    DeleteMessageView,
 | 
					    DeleteMessageView,
 | 
				
			||||||
    InheritanceCreateView,
 | 
					    InheritanceCreateView,
 | 
				
			||||||
@ -17,7 +17,7 @@ from passbook.admin.views.utils import (
 | 
				
			|||||||
    SearchListMixin,
 | 
					    SearchListMixin,
 | 
				
			||||||
    UserPaginateListMixin,
 | 
					    UserPaginateListMixin,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from passbook.flows.models import Stage
 | 
					from authentik.flows.models import Stage
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class StageListView(
 | 
					class StageListView(
 | 
				
			||||||
@ -31,7 +31,7 @@ class StageListView(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    model = Stage
 | 
					    model = Stage
 | 
				
			||||||
    template_name = "administration/stage/list.html"
 | 
					    template_name = "administration/stage/list.html"
 | 
				
			||||||
    permission_required = "passbook_flows.view_stage"
 | 
					    permission_required = "authentik_flows.view_stage"
 | 
				
			||||||
    ordering = "name"
 | 
					    ordering = "name"
 | 
				
			||||||
    search_fields = ["name"]
 | 
					    search_fields = ["name"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -47,9 +47,9 @@ class StageCreateView(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    model = Stage
 | 
					    model = Stage
 | 
				
			||||||
    template_name = "generic/create.html"
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
    permission_required = "passbook_flows.add_stage"
 | 
					    permission_required = "authentik_flows.add_stage"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:stages")
 | 
					    success_url = reverse_lazy("authentik_admin:stages")
 | 
				
			||||||
    success_message = _("Successfully created Stage")
 | 
					    success_message = _("Successfully created Stage")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -63,9 +63,9 @@ class StageUpdateView(
 | 
				
			|||||||
    """Update stage"""
 | 
					    """Update stage"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Stage
 | 
					    model = Stage
 | 
				
			||||||
    permission_required = "passbook_flows.update_application"
 | 
					    permission_required = "authentik_flows.update_application"
 | 
				
			||||||
    template_name = "generic/update.html"
 | 
					    template_name = "generic/update.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:stages")
 | 
					    success_url = reverse_lazy("authentik_admin:stages")
 | 
				
			||||||
    success_message = _("Successfully updated Stage")
 | 
					    success_message = _("Successfully updated Stage")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -74,6 +74,6 @@ class StageDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessage
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    model = Stage
 | 
					    model = Stage
 | 
				
			||||||
    template_name = "generic/delete.html"
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
    permission_required = "passbook_flows.delete_stage"
 | 
					    permission_required = "authentik_flows.delete_stage"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:stages")
 | 
					    success_url = reverse_lazy("authentik_admin:stages")
 | 
				
			||||||
    success_message = _("Successfully deleted Stage")
 | 
					    success_message = _("Successfully deleted Stage")
 | 
				
			||||||
@ -1,22 +1,25 @@
 | 
				
			|||||||
"""passbook StageBinding administration"""
 | 
					"""authentik StageBinding administration"""
 | 
				
			||||||
 | 
					from typing import Any
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from django.contrib.auth.mixins import LoginRequiredMixin
 | 
					from django.contrib.auth.mixins import LoginRequiredMixin
 | 
				
			||||||
from django.contrib.auth.mixins import (
 | 
					from django.contrib.auth.mixins import (
 | 
				
			||||||
    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
					    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from django.contrib.messages.views import SuccessMessageMixin
 | 
					from django.contrib.messages.views import SuccessMessageMixin
 | 
				
			||||||
 | 
					from django.db.models import Max
 | 
				
			||||||
from django.urls import reverse_lazy
 | 
					from django.urls import reverse_lazy
 | 
				
			||||||
from django.utils.translation import gettext as _
 | 
					from django.utils.translation import gettext as _
 | 
				
			||||||
from django.views.generic import ListView, UpdateView
 | 
					from django.views.generic import ListView, UpdateView
 | 
				
			||||||
from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
					from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.views.utils import (
 | 
					from authentik.admin.views.utils import (
 | 
				
			||||||
    BackSuccessUrlMixin,
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
    DeleteMessageView,
 | 
					    DeleteMessageView,
 | 
				
			||||||
    UserPaginateListMixin,
 | 
					    UserPaginateListMixin,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from passbook.flows.forms import FlowStageBindingForm
 | 
					from authentik.flows.forms import FlowStageBindingForm
 | 
				
			||||||
from passbook.flows.models import FlowStageBinding
 | 
					from authentik.flows.models import Flow, FlowStageBinding
 | 
				
			||||||
from passbook.lib.views import CreateAssignPermView
 | 
					from authentik.lib.views import CreateAssignPermView
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class StageBindingListView(
 | 
					class StageBindingListView(
 | 
				
			||||||
@ -25,7 +28,7 @@ class StageBindingListView(
 | 
				
			|||||||
    """Show list of all flows"""
 | 
					    """Show list of all flows"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = FlowStageBinding
 | 
					    model = FlowStageBinding
 | 
				
			||||||
    permission_required = "passbook_flows.view_flowstagebinding"
 | 
					    permission_required = "authentik_flows.view_flowstagebinding"
 | 
				
			||||||
    ordering = ["target", "order"]
 | 
					    ordering = ["target", "order"]
 | 
				
			||||||
    template_name = "administration/stage_binding/list.html"
 | 
					    template_name = "administration/stage_binding/list.html"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -40,13 +43,27 @@ class StageBindingCreateView(
 | 
				
			|||||||
    """Create new StageBinding"""
 | 
					    """Create new StageBinding"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = FlowStageBinding
 | 
					    model = FlowStageBinding
 | 
				
			||||||
    permission_required = "passbook_flows.add_flowstagebinding"
 | 
					    permission_required = "authentik_flows.add_flowstagebinding"
 | 
				
			||||||
    form_class = FlowStageBindingForm
 | 
					    form_class = FlowStageBindingForm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/create.html"
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:stage-bindings")
 | 
					    success_url = reverse_lazy("authentik_admin:stage-bindings")
 | 
				
			||||||
    success_message = _("Successfully created StageBinding")
 | 
					    success_message = _("Successfully created StageBinding")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get_initial(self) -> dict[str, Any]:
 | 
				
			||||||
 | 
					        if "target" in self.request.GET:
 | 
				
			||||||
 | 
					            initial_target_pk = self.request.GET["target"]
 | 
				
			||||||
 | 
					            targets = Flow.objects.filter(pk=initial_target_pk).select_subclasses()
 | 
				
			||||||
 | 
					            if not targets.exists():
 | 
				
			||||||
 | 
					                return {}
 | 
				
			||||||
 | 
					            max_order = FlowStageBinding.objects.filter(
 | 
				
			||||||
 | 
					                target=targets.first()
 | 
				
			||||||
 | 
					            ).aggregate(Max("order"))["order__max"]
 | 
				
			||||||
 | 
					            if not isinstance(max_order, int):
 | 
				
			||||||
 | 
					                max_order = -1
 | 
				
			||||||
 | 
					            return {"target": targets.first(), "order": max_order + 1}
 | 
				
			||||||
 | 
					        return super().get_initial()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class StageBindingUpdateView(
 | 
					class StageBindingUpdateView(
 | 
				
			||||||
    SuccessMessageMixin,
 | 
					    SuccessMessageMixin,
 | 
				
			||||||
@ -58,11 +75,11 @@ class StageBindingUpdateView(
 | 
				
			|||||||
    """Update FlowStageBinding"""
 | 
					    """Update FlowStageBinding"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = FlowStageBinding
 | 
					    model = FlowStageBinding
 | 
				
			||||||
    permission_required = "passbook_flows.change_flowstagebinding"
 | 
					    permission_required = "authentik_flows.change_flowstagebinding"
 | 
				
			||||||
    form_class = FlowStageBindingForm
 | 
					    form_class = FlowStageBindingForm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/update.html"
 | 
					    template_name = "generic/update.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:stage-bindings")
 | 
					    success_url = reverse_lazy("authentik_admin:stage-bindings")
 | 
				
			||||||
    success_message = _("Successfully updated StageBinding")
 | 
					    success_message = _("Successfully updated StageBinding")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -72,8 +89,8 @@ class StageBindingDeleteView(
 | 
				
			|||||||
    """Delete FlowStageBinding"""
 | 
					    """Delete FlowStageBinding"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = FlowStageBinding
 | 
					    model = FlowStageBinding
 | 
				
			||||||
    permission_required = "passbook_flows.delete_flowstagebinding"
 | 
					    permission_required = "authentik_flows.delete_flowstagebinding"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/delete.html"
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:stage-bindings")
 | 
					    success_url = reverse_lazy("authentik_admin:stage-bindings")
 | 
				
			||||||
    success_message = _("Successfully deleted FlowStageBinding")
 | 
					    success_message = _("Successfully deleted FlowStageBinding")
 | 
				
			||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
"""passbook Invitation administration"""
 | 
					"""authentik Invitation administration"""
 | 
				
			||||||
from django.contrib.auth.mixins import LoginRequiredMixin
 | 
					from django.contrib.auth.mixins import LoginRequiredMixin
 | 
				
			||||||
from django.contrib.auth.mixins import (
 | 
					from django.contrib.auth.mixins import (
 | 
				
			||||||
    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
					    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
				
			||||||
@ -10,16 +10,15 @@ from django.utils.translation import gettext as _
 | 
				
			|||||||
from django.views.generic import ListView
 | 
					from django.views.generic import ListView
 | 
				
			||||||
from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
					from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.views.utils import (
 | 
					from authentik.admin.views.utils import (
 | 
				
			||||||
    BackSuccessUrlMixin,
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
    DeleteMessageView,
 | 
					    DeleteMessageView,
 | 
				
			||||||
    SearchListMixin,
 | 
					    SearchListMixin,
 | 
				
			||||||
    UserPaginateListMixin,
 | 
					    UserPaginateListMixin,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from passbook.lib.views import CreateAssignPermView
 | 
					from authentik.lib.views import CreateAssignPermView
 | 
				
			||||||
from passbook.stages.invitation.forms import InvitationForm
 | 
					from authentik.stages.invitation.forms import InvitationForm
 | 
				
			||||||
from passbook.stages.invitation.models import Invitation
 | 
					from authentik.stages.invitation.models import Invitation
 | 
				
			||||||
from passbook.stages.invitation.signals import invitation_created
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class InvitationListView(
 | 
					class InvitationListView(
 | 
				
			||||||
@ -32,7 +31,7 @@ class InvitationListView(
 | 
				
			|||||||
    """Show list of all invitations"""
 | 
					    """Show list of all invitations"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Invitation
 | 
					    model = Invitation
 | 
				
			||||||
    permission_required = "passbook_stages_invitation.view_invitation"
 | 
					    permission_required = "authentik_stages_invitation.view_invitation"
 | 
				
			||||||
    template_name = "administration/stage_invitation/list.html"
 | 
					    template_name = "administration/stage_invitation/list.html"
 | 
				
			||||||
    ordering = "-expires"
 | 
					    ordering = "-expires"
 | 
				
			||||||
    search_fields = ["created_by__username", "expires", "fixed_data"]
 | 
					    search_fields = ["created_by__username", "expires", "fixed_data"]
 | 
				
			||||||
@ -49,17 +48,16 @@ class InvitationCreateView(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    model = Invitation
 | 
					    model = Invitation
 | 
				
			||||||
    form_class = InvitationForm
 | 
					    form_class = InvitationForm
 | 
				
			||||||
    permission_required = "passbook_stages_invitation.add_invitation"
 | 
					    permission_required = "authentik_stages_invitation.add_invitation"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/create.html"
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:stage-invitations")
 | 
					    success_url = reverse_lazy("authentik_admin:stage-invitations")
 | 
				
			||||||
    success_message = _("Successfully created Invitation")
 | 
					    success_message = _("Successfully created Invitation")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def form_valid(self, form):
 | 
					    def form_valid(self, form):
 | 
				
			||||||
        obj = form.save(commit=False)
 | 
					        obj = form.save(commit=False)
 | 
				
			||||||
        obj.created_by = self.request.user
 | 
					        obj.created_by = self.request.user
 | 
				
			||||||
        obj.save()
 | 
					        obj.save()
 | 
				
			||||||
        invitation_created.send(sender=self, request=self.request, invitation=obj)
 | 
					 | 
				
			||||||
        return HttpResponseRedirect(self.success_url)
 | 
					        return HttpResponseRedirect(self.success_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -69,8 +67,8 @@ class InvitationDeleteView(
 | 
				
			|||||||
    """Delete invitation"""
 | 
					    """Delete invitation"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Invitation
 | 
					    model = Invitation
 | 
				
			||||||
    permission_required = "passbook_stages_invitation.delete_invitation"
 | 
					    permission_required = "authentik_stages_invitation.delete_invitation"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/delete.html"
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:stage-invitations")
 | 
					    success_url = reverse_lazy("authentik_admin:stage-invitations")
 | 
				
			||||||
    success_message = _("Successfully deleted Invitation")
 | 
					    success_message = _("Successfully deleted Invitation")
 | 
				
			||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
"""passbook Prompt administration"""
 | 
					"""authentik Prompt administration"""
 | 
				
			||||||
from django.contrib.auth.mixins import LoginRequiredMixin
 | 
					from django.contrib.auth.mixins import LoginRequiredMixin
 | 
				
			||||||
from django.contrib.auth.mixins import (
 | 
					from django.contrib.auth.mixins import (
 | 
				
			||||||
    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
					    PermissionRequiredMixin as DjangoPermissionRequiredMixin,
 | 
				
			||||||
@ -9,15 +9,15 @@ from django.utils.translation import gettext as _
 | 
				
			|||||||
from django.views.generic import ListView, UpdateView
 | 
					from django.views.generic import ListView, UpdateView
 | 
				
			||||||
from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
					from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.views.utils import (
 | 
					from authentik.admin.views.utils import (
 | 
				
			||||||
    BackSuccessUrlMixin,
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
    DeleteMessageView,
 | 
					    DeleteMessageView,
 | 
				
			||||||
    SearchListMixin,
 | 
					    SearchListMixin,
 | 
				
			||||||
    UserPaginateListMixin,
 | 
					    UserPaginateListMixin,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from passbook.lib.views import CreateAssignPermView
 | 
					from authentik.lib.views import CreateAssignPermView
 | 
				
			||||||
from passbook.stages.prompt.forms import PromptAdminForm
 | 
					from authentik.stages.prompt.forms import PromptAdminForm
 | 
				
			||||||
from passbook.stages.prompt.models import Prompt
 | 
					from authentik.stages.prompt.models import Prompt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class PromptListView(
 | 
					class PromptListView(
 | 
				
			||||||
@ -30,7 +30,7 @@ class PromptListView(
 | 
				
			|||||||
    """Show list of all prompts"""
 | 
					    """Show list of all prompts"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Prompt
 | 
					    model = Prompt
 | 
				
			||||||
    permission_required = "passbook_stages_prompt.view_prompt"
 | 
					    permission_required = "authentik_stages_prompt.view_prompt"
 | 
				
			||||||
    ordering = "order"
 | 
					    ordering = "order"
 | 
				
			||||||
    template_name = "administration/stage_prompt/list.html"
 | 
					    template_name = "administration/stage_prompt/list.html"
 | 
				
			||||||
    search_fields = [
 | 
					    search_fields = [
 | 
				
			||||||
@ -52,10 +52,10 @@ class PromptCreateView(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    model = Prompt
 | 
					    model = Prompt
 | 
				
			||||||
    form_class = PromptAdminForm
 | 
					    form_class = PromptAdminForm
 | 
				
			||||||
    permission_required = "passbook_stages_prompt.add_prompt"
 | 
					    permission_required = "authentik_stages_prompt.add_prompt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/create.html"
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:stage-prompts")
 | 
					    success_url = reverse_lazy("authentik_admin:stage-prompts")
 | 
				
			||||||
    success_message = _("Successfully created Prompt")
 | 
					    success_message = _("Successfully created Prompt")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -70,10 +70,10 @@ class PromptUpdateView(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    model = Prompt
 | 
					    model = Prompt
 | 
				
			||||||
    form_class = PromptAdminForm
 | 
					    form_class = PromptAdminForm
 | 
				
			||||||
    permission_required = "passbook_stages_prompt.change_prompt"
 | 
					    permission_required = "authentik_stages_prompt.change_prompt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/update.html"
 | 
					    template_name = "generic/update.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:stage-prompts")
 | 
					    success_url = reverse_lazy("authentik_admin:stage-prompts")
 | 
				
			||||||
    success_message = _("Successfully updated Prompt")
 | 
					    success_message = _("Successfully updated Prompt")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -81,8 +81,8 @@ class PromptDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessag
 | 
				
			|||||||
    """Delete prompt"""
 | 
					    """Delete prompt"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Prompt
 | 
					    model = Prompt
 | 
				
			||||||
    permission_required = "passbook_stages_prompt.delete_prompt"
 | 
					    permission_required = "authentik_stages_prompt.delete_prompt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/delete.html"
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:stage-prompts")
 | 
					    success_url = reverse_lazy("authentik_admin:stage-prompts")
 | 
				
			||||||
    success_message = _("Successfully deleted Prompt")
 | 
					    success_message = _("Successfully deleted Prompt")
 | 
				
			||||||
@ -1,10 +1,10 @@
 | 
				
			|||||||
"""passbook Tasks List"""
 | 
					"""authentik Tasks List"""
 | 
				
			||||||
from typing import Any, Dict
 | 
					from typing import Any, Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from django.views.generic.base import TemplateView
 | 
					from django.views.generic.base import TemplateView
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.mixins import AdminRequiredMixin
 | 
					from authentik.admin.mixins import AdminRequiredMixin
 | 
				
			||||||
from passbook.lib.tasks import TaskInfo, TaskResultStatus
 | 
					from authentik.lib.tasks import TaskInfo, TaskResultStatus
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TaskListView(AdminRequiredMixin, TemplateView):
 | 
					class TaskListView(AdminRequiredMixin, TemplateView):
 | 
				
			||||||
@ -1,16 +1,16 @@
 | 
				
			|||||||
"""passbook Token administration"""
 | 
					"""authentik Token administration"""
 | 
				
			||||||
from django.contrib.auth.mixins import LoginRequiredMixin
 | 
					from django.contrib.auth.mixins import LoginRequiredMixin
 | 
				
			||||||
from django.urls import reverse_lazy
 | 
					from django.urls import reverse_lazy
 | 
				
			||||||
from django.utils.translation import gettext as _
 | 
					from django.utils.translation import gettext as _
 | 
				
			||||||
from django.views.generic import ListView
 | 
					from django.views.generic import ListView
 | 
				
			||||||
from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
					from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.views.utils import (
 | 
					from authentik.admin.views.utils import (
 | 
				
			||||||
    DeleteMessageView,
 | 
					    DeleteMessageView,
 | 
				
			||||||
    SearchListMixin,
 | 
					    SearchListMixin,
 | 
				
			||||||
    UserPaginateListMixin,
 | 
					    UserPaginateListMixin,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from passbook.core.models import Token
 | 
					from authentik.core.models import Token
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TokenListView(
 | 
					class TokenListView(
 | 
				
			||||||
@ -23,7 +23,7 @@ class TokenListView(
 | 
				
			|||||||
    """Show list of all tokens"""
 | 
					    """Show list of all tokens"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Token
 | 
					    model = Token
 | 
				
			||||||
    permission_required = "passbook_core.view_token"
 | 
					    permission_required = "authentik_core.view_token"
 | 
				
			||||||
    ordering = "expires"
 | 
					    ordering = "expires"
 | 
				
			||||||
    template_name = "administration/token/list.html"
 | 
					    template_name = "administration/token/list.html"
 | 
				
			||||||
    search_fields = [
 | 
					    search_fields = [
 | 
				
			||||||
@ -38,8 +38,8 @@ class TokenDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessage
 | 
				
			|||||||
    """Delete token"""
 | 
					    """Delete token"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = Token
 | 
					    model = Token
 | 
				
			||||||
    permission_required = "passbook_core.delete_token"
 | 
					    permission_required = "authentik_core.delete_token"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/delete.html"
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:tokens")
 | 
					    success_url = reverse_lazy("authentik_admin:tokens")
 | 
				
			||||||
    success_message = _("Successfully deleted Token")
 | 
					    success_message = _("Successfully deleted Token")
 | 
				
			||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
"""passbook User administration"""
 | 
					"""authentik User administration"""
 | 
				
			||||||
from django.contrib import messages
 | 
					from django.contrib import messages
 | 
				
			||||||
from django.contrib.auth.mixins import LoginRequiredMixin
 | 
					from django.contrib.auth.mixins import LoginRequiredMixin
 | 
				
			||||||
from django.contrib.auth.mixins import (
 | 
					from django.contrib.auth.mixins import (
 | 
				
			||||||
@ -18,15 +18,15 @@ from guardian.mixins import (
 | 
				
			|||||||
    get_anonymous_user,
 | 
					    get_anonymous_user,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.admin.forms.users import UserForm
 | 
					from authentik.admin.forms.users import UserForm
 | 
				
			||||||
from passbook.admin.views.utils import (
 | 
					from authentik.admin.views.utils import (
 | 
				
			||||||
    BackSuccessUrlMixin,
 | 
					    BackSuccessUrlMixin,
 | 
				
			||||||
    DeleteMessageView,
 | 
					    DeleteMessageView,
 | 
				
			||||||
    SearchListMixin,
 | 
					    SearchListMixin,
 | 
				
			||||||
    UserPaginateListMixin,
 | 
					    UserPaginateListMixin,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from passbook.core.models import Token, User
 | 
					from authentik.core.models import Token, User
 | 
				
			||||||
from passbook.lib.views import CreateAssignPermView
 | 
					from authentik.lib.views import CreateAssignPermView
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class UserListView(
 | 
					class UserListView(
 | 
				
			||||||
@ -39,7 +39,7 @@ class UserListView(
 | 
				
			|||||||
    """Show list of all users"""
 | 
					    """Show list of all users"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = User
 | 
					    model = User
 | 
				
			||||||
    permission_required = "passbook_core.view_user"
 | 
					    permission_required = "authentik_core.view_user"
 | 
				
			||||||
    ordering = "username"
 | 
					    ordering = "username"
 | 
				
			||||||
    template_name = "administration/user/list.html"
 | 
					    template_name = "administration/user/list.html"
 | 
				
			||||||
    search_fields = ["username", "name", "attributes"]
 | 
					    search_fields = ["username", "name", "attributes"]
 | 
				
			||||||
@ -59,10 +59,10 @@ class UserCreateView(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    model = User
 | 
					    model = User
 | 
				
			||||||
    form_class = UserForm
 | 
					    form_class = UserForm
 | 
				
			||||||
    permission_required = "passbook_core.add_user"
 | 
					    permission_required = "authentik_core.add_user"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    template_name = "generic/create.html"
 | 
					    template_name = "generic/create.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:users")
 | 
					    success_url = reverse_lazy("authentik_admin:users")
 | 
				
			||||||
    success_message = _("Successfully created User")
 | 
					    success_message = _("Successfully created User")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -77,12 +77,12 @@ class UserUpdateView(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    model = User
 | 
					    model = User
 | 
				
			||||||
    form_class = UserForm
 | 
					    form_class = UserForm
 | 
				
			||||||
    permission_required = "passbook_core.change_user"
 | 
					    permission_required = "authentik_core.change_user"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # By default the object's name is user which is used by other checks
 | 
					    # By default the object's name is user which is used by other checks
 | 
				
			||||||
    context_object_name = "object"
 | 
					    context_object_name = "object"
 | 
				
			||||||
    template_name = "generic/update.html"
 | 
					    template_name = "generic/update.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:users")
 | 
					    success_url = reverse_lazy("authentik_admin:users")
 | 
				
			||||||
    success_message = _("Successfully updated User")
 | 
					    success_message = _("Successfully updated User")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -90,12 +90,12 @@ class UserDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageV
 | 
				
			|||||||
    """Delete user"""
 | 
					    """Delete user"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = User
 | 
					    model = User
 | 
				
			||||||
    permission_required = "passbook_core.delete_user"
 | 
					    permission_required = "authentik_core.delete_user"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # By default the object's name is user which is used by other checks
 | 
					    # By default the object's name is user which is used by other checks
 | 
				
			||||||
    context_object_name = "object"
 | 
					    context_object_name = "object"
 | 
				
			||||||
    template_name = "generic/delete.html"
 | 
					    template_name = "generic/delete.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:users")
 | 
					    success_url = reverse_lazy("authentik_admin:users")
 | 
				
			||||||
    success_message = _("Successfully deleted User")
 | 
					    success_message = _("Successfully deleted User")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -107,12 +107,12 @@ class UserDisableView(
 | 
				
			|||||||
    object: User
 | 
					    object: User
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = User
 | 
					    model = User
 | 
				
			||||||
    permission_required = "passbook_core.update_user"
 | 
					    permission_required = "authentik_core.update_user"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # By default the object's name is user which is used by other checks
 | 
					    # By default the object's name is user which is used by other checks
 | 
				
			||||||
    context_object_name = "object"
 | 
					    context_object_name = "object"
 | 
				
			||||||
    template_name = "administration/user/disable.html"
 | 
					    template_name = "administration/user/disable.html"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:users")
 | 
					    success_url = reverse_lazy("authentik_admin:users")
 | 
				
			||||||
    success_message = _("Successfully disabled User")
 | 
					    success_message = _("Successfully disabled User")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def delete(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
 | 
					    def delete(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
 | 
				
			||||||
@ -131,11 +131,11 @@ class UserEnableView(
 | 
				
			|||||||
    object: User
 | 
					    object: User
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = User
 | 
					    model = User
 | 
				
			||||||
    permission_required = "passbook_core.update_user"
 | 
					    permission_required = "authentik_core.update_user"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # By default the object's name is user which is used by other checks
 | 
					    # By default the object's name is user which is used by other checks
 | 
				
			||||||
    context_object_name = "object"
 | 
					    context_object_name = "object"
 | 
				
			||||||
    success_url = reverse_lazy("passbook_admin:users")
 | 
					    success_url = reverse_lazy("authentik_admin:users")
 | 
				
			||||||
    success_message = _("Successfully enabled User")
 | 
					    success_message = _("Successfully enabled User")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get(self, request: HttpRequest, *args, **kwargs):
 | 
					    def get(self, request: HttpRequest, *args, **kwargs):
 | 
				
			||||||
@ -150,19 +150,19 @@ class UserPasswordResetView(LoginRequiredMixin, PermissionRequiredMixin, DetailV
 | 
				
			|||||||
    """Get Password reset link for user"""
 | 
					    """Get Password reset link for user"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = User
 | 
					    model = User
 | 
				
			||||||
    permission_required = "passbook_core.reset_user_password"
 | 
					    permission_required = "authentik_core.reset_user_password"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
 | 
					    def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
 | 
				
			||||||
        """Create token for user and return link"""
 | 
					        """Create token for user and return link"""
 | 
				
			||||||
        super().get(request, *args, **kwargs)
 | 
					        super().get(request, *args, **kwargs)
 | 
				
			||||||
        token, _ = Token.objects.get_or_create(
 | 
					        token, __ = Token.objects.get_or_create(
 | 
				
			||||||
            identifier="password-reset-temp", user=self.object
 | 
					            identifier="password-reset-temp", user=self.object
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        querystring = urlencode({"token": token.key})
 | 
					        querystring = urlencode({"token": token.key})
 | 
				
			||||||
        link = request.build_absolute_uri(
 | 
					        link = request.build_absolute_uri(
 | 
				
			||||||
            reverse("passbook_flows:default-recovery") + f"?{querystring}"
 | 
					            reverse("authentik_flows:default-recovery") + f"?{querystring}"
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        messages.success(
 | 
					        messages.success(
 | 
				
			||||||
            request, _("Password reset link: <pre>%(link)s</pre>" % {"link": link})
 | 
					            request, _("Password reset link: <pre>%(link)s</pre>" % {"link": link})
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        return redirect("passbook_admin:users")
 | 
					        return redirect("authentik_admin:users")
 | 
				
			||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
"""passbook admin util views"""
 | 
					"""authentik admin util views"""
 | 
				
			||||||
from typing import Any, Dict, List, Optional
 | 
					from typing import Any, Dict, List, Optional
 | 
				
			||||||
from urllib.parse import urlparse
 | 
					from urllib.parse import urlparse
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -11,8 +11,8 @@ from django.http.request import HttpRequest
 | 
				
			|||||||
from django.views.generic import DeleteView, ListView, UpdateView
 | 
					from django.views.generic import DeleteView, ListView, UpdateView
 | 
				
			||||||
from django.views.generic.list import MultipleObjectMixin
 | 
					from django.views.generic.list import MultipleObjectMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.lib.utils.reflection import all_subclasses
 | 
					from authentik.lib.utils.reflection import all_subclasses
 | 
				
			||||||
from passbook.lib.views import CreateAssignPermView
 | 
					from authentik.lib.views import CreateAssignPermView
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class DeleteMessageView(SuccessMessageMixin, DeleteView):
 | 
					class DeleteMessageView(SuccessMessageMixin, DeleteView):
 | 
				
			||||||
							
								
								
									
										12
									
								
								authentik/api/apps.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								authentik/api/apps.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,12 @@
 | 
				
			|||||||
 | 
					"""authentik API AppConfig"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from django.apps import AppConfig
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class AuthentikAPIConfig(AppConfig):
 | 
				
			||||||
 | 
					    """authentik API Config"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    name = "authentik.api"
 | 
				
			||||||
 | 
					    label = "authentik_api"
 | 
				
			||||||
 | 
					    mountpoint = "api/"
 | 
				
			||||||
 | 
					    verbose_name = "authentik API"
 | 
				
			||||||
@ -1,12 +1,13 @@
 | 
				
			|||||||
"""API Authentication"""
 | 
					"""API Authentication"""
 | 
				
			||||||
from base64 import b64decode
 | 
					from base64 import b64decode
 | 
				
			||||||
 | 
					from binascii import Error
 | 
				
			||||||
from typing import Any, Optional, Tuple, Union
 | 
					from typing import Any, Optional, Tuple, Union
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from rest_framework.authentication import BaseAuthentication, get_authorization_header
 | 
					from rest_framework.authentication import BaseAuthentication, get_authorization_header
 | 
				
			||||||
from rest_framework.request import Request
 | 
					from rest_framework.request import Request
 | 
				
			||||||
from structlog import get_logger
 | 
					from structlog.stdlib import get_logger
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from passbook.core.models import Token, TokenIntents, User
 | 
					from authentik.core.models import Token, TokenIntents, User
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LOGGER = get_logger()
 | 
					LOGGER = get_logger()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -24,17 +25,14 @@ def token_from_header(raw_header: bytes) -> Optional[Token]:
 | 
				
			|||||||
            return None
 | 
					            return None
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
        auth_credentials = b64decode(auth_credentials.encode()).decode()
 | 
					        auth_credentials = b64decode(auth_credentials.encode()).decode()
 | 
				
			||||||
    except UnicodeDecodeError:
 | 
					    except (UnicodeDecodeError, Error):
 | 
				
			||||||
        # TODO: Remove this workaround
 | 
					        return None
 | 
				
			||||||
        # temporary fallback for 0.11 to 0.12 upgrade
 | 
					 | 
				
			||||||
        # 0.11 and below proxy sends authorization header not base64 encoded
 | 
					 | 
				
			||||||
        pass
 | 
					 | 
				
			||||||
    # Accept credentials with username and without
 | 
					    # Accept credentials with username and without
 | 
				
			||||||
    if ":" in auth_credentials:
 | 
					    if ":" in auth_credentials:
 | 
				
			||||||
        _, password = auth_credentials.split(":")
 | 
					        _, password = auth_credentials.split(":")
 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
        password = auth_credentials
 | 
					        password = auth_credentials
 | 
				
			||||||
    if password == "":
 | 
					    if password == "":  # nosec
 | 
				
			||||||
        return None
 | 
					        return None
 | 
				
			||||||
    tokens = Token.filter_not_expired(key=password, intent=TokenIntents.INTENT_API)
 | 
					    tokens = Token.filter_not_expired(key=password, intent=TokenIntents.INTENT_API)
 | 
				
			||||||
    if not tokens.exists():
 | 
					    if not tokens.exists():
 | 
				
			||||||
@ -43,7 +41,7 @@ def token_from_header(raw_header: bytes) -> Optional[Token]:
 | 
				
			|||||||
    return tokens.first()
 | 
					    return tokens.first()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class PassbookTokenAuthentication(BaseAuthentication):
 | 
					class AuthentikTokenAuthentication(BaseAuthentication):
 | 
				
			||||||
    """Token-based authentication using HTTP Basic authentication"""
 | 
					    """Token-based authentication using HTTP Basic authentication"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def authenticate(self, request: Request) -> Union[Tuple[User, Any], None]:
 | 
					    def authenticate(self, request: Request) -> Union[Tuple[User, Any], None]:
 | 
				
			||||||
@ -57,4 +55,4 @@ class PassbookTokenAuthentication(BaseAuthentication):
 | 
				
			|||||||
        return (token.user, None)
 | 
					        return (token.user, None)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def authenticate_header(self, request: Request) -> str:
 | 
					    def authenticate_header(self, request: Request) -> str:
 | 
				
			||||||
        return 'Basic realm="passbook"'
 | 
					        return 'Basic realm="authentik"'
 | 
				
			||||||
							
								
								
									
										31
									
								
								authentik/api/pagination.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								authentik/api/pagination.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,31 @@
 | 
				
			|||||||
 | 
					"""Pagination which includes total pages and current page"""
 | 
				
			||||||
 | 
					from rest_framework import pagination
 | 
				
			||||||
 | 
					from rest_framework.response import Response
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class Pagination(pagination.PageNumberPagination):
 | 
				
			||||||
 | 
					    """Pagination which includes total pages and current page"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    page_size_query_param = "page_size"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get_paginated_response(self, data):
 | 
				
			||||||
 | 
					        previous_page_number = 0
 | 
				
			||||||
 | 
					        if self.page.has_previous():
 | 
				
			||||||
 | 
					            previous_page_number = self.page.previous_page_number()
 | 
				
			||||||
 | 
					        next_page_number = 0
 | 
				
			||||||
 | 
					        if self.page.has_next():
 | 
				
			||||||
 | 
					            next_page_number = self.page.next_page_number()
 | 
				
			||||||
 | 
					        return Response(
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                "pagination": {
 | 
				
			||||||
 | 
					                    "next": next_page_number,
 | 
				
			||||||
 | 
					                    "previous": previous_page_number,
 | 
				
			||||||
 | 
					                    "count": self.page.paginator.count,
 | 
				
			||||||
 | 
					                    "current": self.page.number,
 | 
				
			||||||
 | 
					                    "total_pages": self.page.paginator.num_pages,
 | 
				
			||||||
 | 
					                    "start_index": self.page.start_index(),
 | 
				
			||||||
 | 
					                    "end_index": self.page.end_index(),
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                "results": data,
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
@ -2,6 +2,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
{% block branding %}
 | 
					{% block branding %}
 | 
				
			||||||
<span class='navbar-brand'>
 | 
					<span class='navbar-brand'>
 | 
				
			||||||
    passbook
 | 
					    authentik
 | 
				
			||||||
</span>
 | 
					</span>
 | 
				
			||||||
{% endblock %}
 | 
					{% endblock %}
 | 
				
			||||||
							
								
								
									
										37
									
								
								authentik/api/tests.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								authentik/api/tests.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,37 @@
 | 
				
			|||||||
 | 
					"""Test API Authentication"""
 | 
				
			||||||
 | 
					from base64 import b64encode
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from django.test import TestCase
 | 
				
			||||||
 | 
					from guardian.shortcuts import get_anonymous_user
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from authentik.api.auth import token_from_header
 | 
				
			||||||
 | 
					from authentik.core.models import Token, TokenIntents
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class TestAPIAuth(TestCase):
 | 
				
			||||||
 | 
					    """Test API Authentication"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_valid(self):
 | 
				
			||||||
 | 
					        """Test valid token"""
 | 
				
			||||||
 | 
					        token = Token.objects.create(
 | 
				
			||||||
 | 
					            intent=TokenIntents.INTENT_API, user=get_anonymous_user()
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					        auth = b64encode(f":{token.key}".encode()).decode()
 | 
				
			||||||
 | 
					        self.assertEqual(token_from_header(f"Basic {auth}".encode()), token)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_invalid_type(self):
 | 
				
			||||||
 | 
					        """Test invalid type"""
 | 
				
			||||||
 | 
					        self.assertIsNone(token_from_header("foo bar".encode()))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_invalid_decode(self):
 | 
				
			||||||
 | 
					        """Test invalid bas64"""
 | 
				
			||||||
 | 
					        self.assertIsNone(token_from_header("Basic bar".encode()))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_invalid_empty_password(self):
 | 
				
			||||||
 | 
					        """Test invalid with empty password"""
 | 
				
			||||||
 | 
					        self.assertIsNone(token_from_header("Basic :".encode()))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_invalid_no_token(self):
 | 
				
			||||||
 | 
					        """Test invalid with no token"""
 | 
				
			||||||
 | 
					        auth = b64encode(":abc".encode()).decode()
 | 
				
			||||||
 | 
					        self.assertIsNone(token_from_header(f"Basic :{auth}".encode()))
 | 
				
			||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user