ligoj-cli 1.0.0__tar.gz → 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/PKG-INFO +16 -16
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/README.md +12 -12
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligoj_cli.egg-info/PKG-INFO +16 -16
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligoj_cli.egg-info/SOURCES.txt +1 -0
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligoj_cli.egg-info/requires.txt +3 -3
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligojcli/plugins/alfresco.py +103 -22
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligojcli/plugins/argocd.py +49 -11
- ligoj_cli-1.0.2/ligojcli/plugins/bootstrap.py +1086 -0
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligojcli/plugins/gitlab.py +145 -36
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligojcli/plugins/harbor.py +60 -20
- ligoj_cli-1.0.2/ligojcli/plugins/id.py +798 -0
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligojcli/plugins/jenkins.py +218 -50
- ligoj_cli-1.0.2/ligojcli/plugins/ligoj.py +1942 -0
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligojcli/plugins/nexus.py +70 -18
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligojcli/plugins/sonarqube.py +144 -34
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligojcli/plugins/ssl.py +37 -5
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligojcli/plugins/utils.py +126 -28
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/pyproject.toml +5 -5
- ligoj_cli-1.0.0/ligojcli/plugins/bootstrap.py +0 -672
- ligoj_cli-1.0.0/ligojcli/plugins/ligoj.py +0 -1665
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/LICENSE +0 -0
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligoj_cli.egg-info/dependency_links.txt +0 -0
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligoj_cli.egg-info/entry_points.txt +0 -0
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligoj_cli.egg-info/top_level.txt +0 -0
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligojcli/__init__.py +0 -0
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligojcli/ligoj.py +0 -0
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/ligojcli/plugins/__init__.py +0 -0
- {ligoj_cli-1.0.0 → ligoj_cli-1.0.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ligoj-cli
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Summary: Ligoj CLI
|
|
5
5
|
Author-email: Fabrice Daugan <fdaugan@kloudy.io>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -18,12 +18,12 @@ Requires-Python: >=3.11
|
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
20
|
Requires-Dist: colorama==0.4.6
|
|
21
|
-
Requires-Dist: requests==2.
|
|
21
|
+
Requires-Dist: requests==2.34.2
|
|
22
22
|
Requires-Dist: dnspython==2.7.0
|
|
23
|
-
Requires-Dist: pyyaml==6.0.
|
|
23
|
+
Requires-Dist: pyyaml==6.0.3
|
|
24
24
|
Requires-Dist: configparser==7.2.0
|
|
25
25
|
Requires-Dist: unidecode==1.4.0
|
|
26
|
-
Requires-Dist: jsonschema
|
|
26
|
+
Requires-Dist: jsonschema==4.26.0
|
|
27
27
|
Requires-Dist: jsonmerge==1.9.2
|
|
28
28
|
Requires-Dist: Jinja2==3.1.6
|
|
29
29
|
Requires-Dist: pytimeparse==1.1.8
|
|
@@ -327,7 +327,7 @@ ligoj session get
|
|
|
327
327
|
"digestVersion": "rRXmeWPgn+...==",
|
|
328
328
|
"plugins": ["feature:welcome:data-rbac"]
|
|
329
329
|
},
|
|
330
|
-
"userSettings": {"
|
|
330
|
+
"userSettings": {"security-agreement": "1"},
|
|
331
331
|
"uiAuthorizations": ["^id/container/group.*", "^id/user.*", "^id/delegate.*", "^message.*", "^id$", "^home.*", "^id/container/company.*", "^api.*", "^id/home.*", ".*"],
|
|
332
332
|
"apiAuthorizations": [{"pattern": ".*", "method": "DELETE"}], "roles": ["ADMIN", "USER"], "userName": "ligoj-admin"
|
|
333
333
|
}
|
|
@@ -694,7 +694,7 @@ A [file](https://github.com/ligoj/ligoj/blob/master/DOC.md#hook) is a remote fil
|
|
|
694
694
|
Related path must be authorized by the configuration value `ligoj.file.path`. This check is performed at upload and download times.
|
|
695
695
|
|
|
696
696
|
```bash
|
|
697
|
-
ligoj configuration set --id "ligoj.file.path" --value "^/home/files/.*,^/home/hooks/.*,^/home/ligoj/META-INF/resources/webjars/.*,^/home/ligoj/statics
|
|
697
|
+
ligoj configuration set --id "ligoj.file.path" --value "^/home/files/.*,^/home/hooks/.*,^/home/ligoj/META-INF/resources/webjars/.*,^/home/ligoj/statics/.*"
|
|
698
698
|
```
|
|
699
699
|
|
|
700
700
|
### Create or update file
|
|
@@ -702,11 +702,11 @@ ligoj configuration set --id "ligoj.file.path" --value "^/home/files/.*,^/home/h
|
|
|
702
702
|
Upload a local file to a remote file.
|
|
703
703
|
|
|
704
704
|
```bash
|
|
705
|
-
|
|
706
|
-
ligoj file put --from
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
ligoj file put --from docs/ui/logo.
|
|
705
|
+
# Served by UI container, this file will be available from the URL: '/some/icon.png'
|
|
706
|
+
ligoj file put --from https://path/to/icon.png --path "/home/ligoj/statics/some/icon.png"
|
|
707
|
+
|
|
708
|
+
# Served by API container, this file will be available from the URL: '/home/img/logo.svg'
|
|
709
|
+
ligoj file put --from docs/ui/logo.svg --path "/home/ligoj/META-INF/resources/webjars/home/img/logo.svg"
|
|
710
710
|
```
|
|
711
711
|
|
|
712
712
|
### Delete file
|
|
@@ -1398,7 +1398,7 @@ Create a container scope
|
|
|
1398
1398
|
|
|
1399
1399
|
```bash
|
|
1400
1400
|
ligoj id:scope create --id "Unassigned" --type "group" --dn "ou=groups,dc=example,dc=com"
|
|
1401
|
-
ligoj id:scope create --id "Projects" --type "group" --dn "ou=
|
|
1401
|
+
ligoj id:scope create --id "Projects" --type "group" --dn "ou=project,ou=groups,dc=example,dc=com"
|
|
1402
1402
|
ligoj id:scope create --id "Tools" --type "group" --dn "ou=tools,ou=groups,dc=example,dc=com"
|
|
1403
1403
|
ligoj id:scope create --id "Unassigned" --type "company" --dn "ou=people,dc=example,dc=com"
|
|
1404
1404
|
ligoj id:scope create --id "Internal" --type "company" --dn "ou=internal,ou=people,dc=example,dc=com"
|
|
@@ -1432,7 +1432,7 @@ ligoj id:scope list --type "group"
|
|
|
1432
1432
|
"recordsTotal": 4, "recordsFiltered": 3,
|
|
1433
1433
|
"data": [
|
|
1434
1434
|
{"id": 5, "name": "Unassigned", "dn": "ou=groups,dc=sample,dc=com", "type": "group", "locked": false},
|
|
1435
|
-
{"id": 6, "name": "Project", "dn": "ou=
|
|
1435
|
+
{"id": 6, "name": "Project", "dn": "ou=project,ou=groups,dc=sample,dc=com", "type": "group", "locked": false},
|
|
1436
1436
|
{"id": 7, "name": "Technical", "dn": "ou=tools,ou=groups,dc=sample,dc=com", "type": "group", "locked": false}
|
|
1437
1437
|
]
|
|
1438
1438
|
}
|
|
@@ -1680,7 +1680,7 @@ Hierarchy tree sample for base DN `dc=sample,dc=com`
|
|
|
1680
1680
|
| ` ou=technical-users,ou=people` | `Technical` | `company` |
|
|
1681
1681
|
| ` ou=external,ou=people` | `External` | `company` |
|
|
1682
1682
|
| `ou=groups` | `Unassigned` | `group` |
|
|
1683
|
-
| ` ou=
|
|
1683
|
+
| ` ou=project,ou=groups` | `Project` | `group` |
|
|
1684
1684
|
| ` ou=tools,ou=groups` | `Technical` | `group` |
|
|
1685
1685
|
| ` cn=jenkins-administrators,ou=tools,ou=groups` | (inherited) | `group` |
|
|
1686
1686
|
| ` cn=nexus-administrators,ou=tools,ou=groups` | (inherited) | `group` |
|
|
@@ -1691,7 +1691,7 @@ Hierarchy tree sample for base DN `dc=sample,dc=com`
|
|
|
1691
1691
|
### Via `ligoj bootstrap init`
|
|
1692
1692
|
|
|
1693
1693
|
```bash
|
|
1694
|
-
ligoj bootstrap init --base-dn="dc=sample,dc=com" --users-base-dn "ou=people" --internal-users-base-dn "" --technical-users-base-dn "ou=technical-users" --external-users-base-dn "ou=external" --groups-base-dn "ou=groups" --technical-groups-base-dn "ou=tools" --projects-base-dn "ou=
|
|
1694
|
+
ligoj bootstrap init --base-dn="dc=sample,dc=com" --users-base-dn "ou=people" --internal-users-base-dn "" --technical-users-base-dn "ou=technical-users" --external-users-base-dn "ou=external" --groups-base-dn "ou=groups" --technical-groups-base-dn "ou=tools" --projects-base-dn "ou=project" --technical-groups "sonar-administrators" "jenkins-administrators" "nexus-administrators"
|
|
1695
1695
|
```
|
|
1696
1696
|
|
|
1697
1697
|
### Via `ligoj id` commands
|
|
@@ -1718,7 +1718,7 @@ ligoj id:ou create --name "tools" --parent-dn "ou=groups,dc=sample,dc=com"
|
|
|
1718
1718
|
|
|
1719
1719
|
### Scope functionals for groups
|
|
1720
1720
|
ligoj id:scope create --name "Unassigned" --type "group" --dn "ou=groups,dc=sample,dc=com"
|
|
1721
|
-
ligoj id:scope create --name "Project" --type "group" --dn "ou=
|
|
1721
|
+
ligoj id:scope create --name "Project" --type "group" --dn "ou=project,ou=groups,dc=sample,dc=com"
|
|
1722
1722
|
ligoj id:scope create --name "Technical" --type "group" --dn "ou=tools,ou=groups,dc=sample,dc=com"
|
|
1723
1723
|
|
|
1724
1724
|
### Technical groups and sub-groups
|
|
@@ -296,7 +296,7 @@ ligoj session get
|
|
|
296
296
|
"digestVersion": "rRXmeWPgn+...==",
|
|
297
297
|
"plugins": ["feature:welcome:data-rbac"]
|
|
298
298
|
},
|
|
299
|
-
"userSettings": {"
|
|
299
|
+
"userSettings": {"security-agreement": "1"},
|
|
300
300
|
"uiAuthorizations": ["^id/container/group.*", "^id/user.*", "^id/delegate.*", "^message.*", "^id$", "^home.*", "^id/container/company.*", "^api.*", "^id/home.*", ".*"],
|
|
301
301
|
"apiAuthorizations": [{"pattern": ".*", "method": "DELETE"}], "roles": ["ADMIN", "USER"], "userName": "ligoj-admin"
|
|
302
302
|
}
|
|
@@ -663,7 +663,7 @@ A [file](https://github.com/ligoj/ligoj/blob/master/DOC.md#hook) is a remote fil
|
|
|
663
663
|
Related path must be authorized by the configuration value `ligoj.file.path`. This check is performed at upload and download times.
|
|
664
664
|
|
|
665
665
|
```bash
|
|
666
|
-
ligoj configuration set --id "ligoj.file.path" --value "^/home/files/.*,^/home/hooks/.*,^/home/ligoj/META-INF/resources/webjars/.*,^/home/ligoj/statics
|
|
666
|
+
ligoj configuration set --id "ligoj.file.path" --value "^/home/files/.*,^/home/hooks/.*,^/home/ligoj/META-INF/resources/webjars/.*,^/home/ligoj/statics/.*"
|
|
667
667
|
```
|
|
668
668
|
|
|
669
669
|
### Create or update file
|
|
@@ -671,11 +671,11 @@ ligoj configuration set --id "ligoj.file.path" --value "^/home/files/.*,^/home/h
|
|
|
671
671
|
Upload a local file to a remote file.
|
|
672
672
|
|
|
673
673
|
```bash
|
|
674
|
-
|
|
675
|
-
ligoj file put --from
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
ligoj file put --from docs/ui/logo.
|
|
674
|
+
# Served by UI container, this file will be available from the URL: '/some/icon.png'
|
|
675
|
+
ligoj file put --from https://path/to/icon.png --path "/home/ligoj/statics/some/icon.png"
|
|
676
|
+
|
|
677
|
+
# Served by API container, this file will be available from the URL: '/home/img/logo.svg'
|
|
678
|
+
ligoj file put --from docs/ui/logo.svg --path "/home/ligoj/META-INF/resources/webjars/home/img/logo.svg"
|
|
679
679
|
```
|
|
680
680
|
|
|
681
681
|
### Delete file
|
|
@@ -1367,7 +1367,7 @@ Create a container scope
|
|
|
1367
1367
|
|
|
1368
1368
|
```bash
|
|
1369
1369
|
ligoj id:scope create --id "Unassigned" --type "group" --dn "ou=groups,dc=example,dc=com"
|
|
1370
|
-
ligoj id:scope create --id "Projects" --type "group" --dn "ou=
|
|
1370
|
+
ligoj id:scope create --id "Projects" --type "group" --dn "ou=project,ou=groups,dc=example,dc=com"
|
|
1371
1371
|
ligoj id:scope create --id "Tools" --type "group" --dn "ou=tools,ou=groups,dc=example,dc=com"
|
|
1372
1372
|
ligoj id:scope create --id "Unassigned" --type "company" --dn "ou=people,dc=example,dc=com"
|
|
1373
1373
|
ligoj id:scope create --id "Internal" --type "company" --dn "ou=internal,ou=people,dc=example,dc=com"
|
|
@@ -1401,7 +1401,7 @@ ligoj id:scope list --type "group"
|
|
|
1401
1401
|
"recordsTotal": 4, "recordsFiltered": 3,
|
|
1402
1402
|
"data": [
|
|
1403
1403
|
{"id": 5, "name": "Unassigned", "dn": "ou=groups,dc=sample,dc=com", "type": "group", "locked": false},
|
|
1404
|
-
{"id": 6, "name": "Project", "dn": "ou=
|
|
1404
|
+
{"id": 6, "name": "Project", "dn": "ou=project,ou=groups,dc=sample,dc=com", "type": "group", "locked": false},
|
|
1405
1405
|
{"id": 7, "name": "Technical", "dn": "ou=tools,ou=groups,dc=sample,dc=com", "type": "group", "locked": false}
|
|
1406
1406
|
]
|
|
1407
1407
|
}
|
|
@@ -1649,7 +1649,7 @@ Hierarchy tree sample for base DN `dc=sample,dc=com`
|
|
|
1649
1649
|
| ` ou=technical-users,ou=people` | `Technical` | `company` |
|
|
1650
1650
|
| ` ou=external,ou=people` | `External` | `company` |
|
|
1651
1651
|
| `ou=groups` | `Unassigned` | `group` |
|
|
1652
|
-
| ` ou=
|
|
1652
|
+
| ` ou=project,ou=groups` | `Project` | `group` |
|
|
1653
1653
|
| ` ou=tools,ou=groups` | `Technical` | `group` |
|
|
1654
1654
|
| ` cn=jenkins-administrators,ou=tools,ou=groups` | (inherited) | `group` |
|
|
1655
1655
|
| ` cn=nexus-administrators,ou=tools,ou=groups` | (inherited) | `group` |
|
|
@@ -1660,7 +1660,7 @@ Hierarchy tree sample for base DN `dc=sample,dc=com`
|
|
|
1660
1660
|
### Via `ligoj bootstrap init`
|
|
1661
1661
|
|
|
1662
1662
|
```bash
|
|
1663
|
-
ligoj bootstrap init --base-dn="dc=sample,dc=com" --users-base-dn "ou=people" --internal-users-base-dn "" --technical-users-base-dn "ou=technical-users" --external-users-base-dn "ou=external" --groups-base-dn "ou=groups" --technical-groups-base-dn "ou=tools" --projects-base-dn "ou=
|
|
1663
|
+
ligoj bootstrap init --base-dn="dc=sample,dc=com" --users-base-dn "ou=people" --internal-users-base-dn "" --technical-users-base-dn "ou=technical-users" --external-users-base-dn "ou=external" --groups-base-dn "ou=groups" --technical-groups-base-dn "ou=tools" --projects-base-dn "ou=project" --technical-groups "sonar-administrators" "jenkins-administrators" "nexus-administrators"
|
|
1664
1664
|
```
|
|
1665
1665
|
|
|
1666
1666
|
### Via `ligoj id` commands
|
|
@@ -1687,7 +1687,7 @@ ligoj id:ou create --name "tools" --parent-dn "ou=groups,dc=sample,dc=com"
|
|
|
1687
1687
|
|
|
1688
1688
|
### Scope functionals for groups
|
|
1689
1689
|
ligoj id:scope create --name "Unassigned" --type "group" --dn "ou=groups,dc=sample,dc=com"
|
|
1690
|
-
ligoj id:scope create --name "Project" --type "group" --dn "ou=
|
|
1690
|
+
ligoj id:scope create --name "Project" --type "group" --dn "ou=project,ou=groups,dc=sample,dc=com"
|
|
1691
1691
|
ligoj id:scope create --name "Technical" --type "group" --dn "ou=tools,ou=groups,dc=sample,dc=com"
|
|
1692
1692
|
|
|
1693
1693
|
### Technical groups and sub-groups
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ligoj-cli
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Summary: Ligoj CLI
|
|
5
5
|
Author-email: Fabrice Daugan <fdaugan@kloudy.io>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -18,12 +18,12 @@ Requires-Python: >=3.11
|
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
20
|
Requires-Dist: colorama==0.4.6
|
|
21
|
-
Requires-Dist: requests==2.
|
|
21
|
+
Requires-Dist: requests==2.34.2
|
|
22
22
|
Requires-Dist: dnspython==2.7.0
|
|
23
|
-
Requires-Dist: pyyaml==6.0.
|
|
23
|
+
Requires-Dist: pyyaml==6.0.3
|
|
24
24
|
Requires-Dist: configparser==7.2.0
|
|
25
25
|
Requires-Dist: unidecode==1.4.0
|
|
26
|
-
Requires-Dist: jsonschema
|
|
26
|
+
Requires-Dist: jsonschema==4.26.0
|
|
27
27
|
Requires-Dist: jsonmerge==1.9.2
|
|
28
28
|
Requires-Dist: Jinja2==3.1.6
|
|
29
29
|
Requires-Dist: pytimeparse==1.1.8
|
|
@@ -327,7 +327,7 @@ ligoj session get
|
|
|
327
327
|
"digestVersion": "rRXmeWPgn+...==",
|
|
328
328
|
"plugins": ["feature:welcome:data-rbac"]
|
|
329
329
|
},
|
|
330
|
-
"userSettings": {"
|
|
330
|
+
"userSettings": {"security-agreement": "1"},
|
|
331
331
|
"uiAuthorizations": ["^id/container/group.*", "^id/user.*", "^id/delegate.*", "^message.*", "^id$", "^home.*", "^id/container/company.*", "^api.*", "^id/home.*", ".*"],
|
|
332
332
|
"apiAuthorizations": [{"pattern": ".*", "method": "DELETE"}], "roles": ["ADMIN", "USER"], "userName": "ligoj-admin"
|
|
333
333
|
}
|
|
@@ -694,7 +694,7 @@ A [file](https://github.com/ligoj/ligoj/blob/master/DOC.md#hook) is a remote fil
|
|
|
694
694
|
Related path must be authorized by the configuration value `ligoj.file.path`. This check is performed at upload and download times.
|
|
695
695
|
|
|
696
696
|
```bash
|
|
697
|
-
ligoj configuration set --id "ligoj.file.path" --value "^/home/files/.*,^/home/hooks/.*,^/home/ligoj/META-INF/resources/webjars/.*,^/home/ligoj/statics
|
|
697
|
+
ligoj configuration set --id "ligoj.file.path" --value "^/home/files/.*,^/home/hooks/.*,^/home/ligoj/META-INF/resources/webjars/.*,^/home/ligoj/statics/.*"
|
|
698
698
|
```
|
|
699
699
|
|
|
700
700
|
### Create or update file
|
|
@@ -702,11 +702,11 @@ ligoj configuration set --id "ligoj.file.path" --value "^/home/files/.*,^/home/h
|
|
|
702
702
|
Upload a local file to a remote file.
|
|
703
703
|
|
|
704
704
|
```bash
|
|
705
|
-
|
|
706
|
-
ligoj file put --from
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
ligoj file put --from docs/ui/logo.
|
|
705
|
+
# Served by UI container, this file will be available from the URL: '/some/icon.png'
|
|
706
|
+
ligoj file put --from https://path/to/icon.png --path "/home/ligoj/statics/some/icon.png"
|
|
707
|
+
|
|
708
|
+
# Served by API container, this file will be available from the URL: '/home/img/logo.svg'
|
|
709
|
+
ligoj file put --from docs/ui/logo.svg --path "/home/ligoj/META-INF/resources/webjars/home/img/logo.svg"
|
|
710
710
|
```
|
|
711
711
|
|
|
712
712
|
### Delete file
|
|
@@ -1398,7 +1398,7 @@ Create a container scope
|
|
|
1398
1398
|
|
|
1399
1399
|
```bash
|
|
1400
1400
|
ligoj id:scope create --id "Unassigned" --type "group" --dn "ou=groups,dc=example,dc=com"
|
|
1401
|
-
ligoj id:scope create --id "Projects" --type "group" --dn "ou=
|
|
1401
|
+
ligoj id:scope create --id "Projects" --type "group" --dn "ou=project,ou=groups,dc=example,dc=com"
|
|
1402
1402
|
ligoj id:scope create --id "Tools" --type "group" --dn "ou=tools,ou=groups,dc=example,dc=com"
|
|
1403
1403
|
ligoj id:scope create --id "Unassigned" --type "company" --dn "ou=people,dc=example,dc=com"
|
|
1404
1404
|
ligoj id:scope create --id "Internal" --type "company" --dn "ou=internal,ou=people,dc=example,dc=com"
|
|
@@ -1432,7 +1432,7 @@ ligoj id:scope list --type "group"
|
|
|
1432
1432
|
"recordsTotal": 4, "recordsFiltered": 3,
|
|
1433
1433
|
"data": [
|
|
1434
1434
|
{"id": 5, "name": "Unassigned", "dn": "ou=groups,dc=sample,dc=com", "type": "group", "locked": false},
|
|
1435
|
-
{"id": 6, "name": "Project", "dn": "ou=
|
|
1435
|
+
{"id": 6, "name": "Project", "dn": "ou=project,ou=groups,dc=sample,dc=com", "type": "group", "locked": false},
|
|
1436
1436
|
{"id": 7, "name": "Technical", "dn": "ou=tools,ou=groups,dc=sample,dc=com", "type": "group", "locked": false}
|
|
1437
1437
|
]
|
|
1438
1438
|
}
|
|
@@ -1680,7 +1680,7 @@ Hierarchy tree sample for base DN `dc=sample,dc=com`
|
|
|
1680
1680
|
| ` ou=technical-users,ou=people` | `Technical` | `company` |
|
|
1681
1681
|
| ` ou=external,ou=people` | `External` | `company` |
|
|
1682
1682
|
| `ou=groups` | `Unassigned` | `group` |
|
|
1683
|
-
| ` ou=
|
|
1683
|
+
| ` ou=project,ou=groups` | `Project` | `group` |
|
|
1684
1684
|
| ` ou=tools,ou=groups` | `Technical` | `group` |
|
|
1685
1685
|
| ` cn=jenkins-administrators,ou=tools,ou=groups` | (inherited) | `group` |
|
|
1686
1686
|
| ` cn=nexus-administrators,ou=tools,ou=groups` | (inherited) | `group` |
|
|
@@ -1691,7 +1691,7 @@ Hierarchy tree sample for base DN `dc=sample,dc=com`
|
|
|
1691
1691
|
### Via `ligoj bootstrap init`
|
|
1692
1692
|
|
|
1693
1693
|
```bash
|
|
1694
|
-
ligoj bootstrap init --base-dn="dc=sample,dc=com" --users-base-dn "ou=people" --internal-users-base-dn "" --technical-users-base-dn "ou=technical-users" --external-users-base-dn "ou=external" --groups-base-dn "ou=groups" --technical-groups-base-dn "ou=tools" --projects-base-dn "ou=
|
|
1694
|
+
ligoj bootstrap init --base-dn="dc=sample,dc=com" --users-base-dn "ou=people" --internal-users-base-dn "" --technical-users-base-dn "ou=technical-users" --external-users-base-dn "ou=external" --groups-base-dn "ou=groups" --technical-groups-base-dn "ou=tools" --projects-base-dn "ou=project" --technical-groups "sonar-administrators" "jenkins-administrators" "nexus-administrators"
|
|
1695
1695
|
```
|
|
1696
1696
|
|
|
1697
1697
|
### Via `ligoj id` commands
|
|
@@ -1718,7 +1718,7 @@ ligoj id:ou create --name "tools" --parent-dn "ou=groups,dc=sample,dc=com"
|
|
|
1718
1718
|
|
|
1719
1719
|
### Scope functionals for groups
|
|
1720
1720
|
ligoj id:scope create --name "Unassigned" --type "group" --dn "ou=groups,dc=sample,dc=com"
|
|
1721
|
-
ligoj id:scope create --name "Project" --type "group" --dn "ou=
|
|
1721
|
+
ligoj id:scope create --name "Project" --type "group" --dn "ou=project,ou=groups,dc=sample,dc=com"
|
|
1722
1722
|
ligoj id:scope create --name "Technical" --type "group" --dn "ou=tools,ou=groups,dc=sample,dc=com"
|
|
1723
1723
|
|
|
1724
1724
|
### Technical groups and sub-groups
|
|
@@ -16,8 +16,12 @@ alfresco_password: str | None = None
|
|
|
16
16
|
|
|
17
17
|
def configure(subparser_service):
|
|
18
18
|
# alfresco
|
|
19
|
-
subparser_action = subparser_service.add_parser(
|
|
20
|
-
|
|
19
|
+
subparser_action = subparser_service.add_parser(
|
|
20
|
+
"alfresco", help="Alfresco related operations"
|
|
21
|
+
).add_subparsers(title="action", help="Action", dest="action")
|
|
22
|
+
subparser_service2 = subparser_action.add_parser("site", help="Site operations").add_subparsers(
|
|
23
|
+
title="action", help="Action", dest="operation"
|
|
24
|
+
)
|
|
21
25
|
subparser_service2.add_parser("list", help="List sites")
|
|
22
26
|
parser_action = subparser_service2.add_parser("create", help="Create site")
|
|
23
27
|
parser_action.add_argument("--id", "-i", help="Site name")
|
|
@@ -29,15 +33,21 @@ def configure(subparser_service):
|
|
|
29
33
|
parser_action = subparser_service2.add_parser("add-group", help="Add group to site with a role")
|
|
30
34
|
parser_action.add_argument("--id", help="Site name")
|
|
31
35
|
parser_action.add_argument("--group", help="Group name")
|
|
32
|
-
parser_action.add_argument(
|
|
36
|
+
parser_action.add_argument(
|
|
37
|
+
"--role", help="Role name", choices=["SiteCollaborator", "SiteConsumer", "SiteManager"]
|
|
38
|
+
)
|
|
33
39
|
parser_action = subparser_service2.add_parser("remove-group", help="Remove group from site")
|
|
34
40
|
parser_action.add_argument("--id", help="Site name")
|
|
35
41
|
parser_action.add_argument("--group", help="Group name")
|
|
36
|
-
subparser_service2 = subparser_action.add_parser(
|
|
42
|
+
subparser_service2 = subparser_action.add_parser(
|
|
43
|
+
"group", help="Group operations"
|
|
44
|
+
).add_subparsers(title="action", help="Action", dest="operation")
|
|
37
45
|
parser_action = subparser_service2.add_parser("create", help="Create group")
|
|
38
46
|
parser_action.add_argument("--id", "-i", help="Group name")
|
|
39
47
|
parser_action.add_argument("--display-name", help="Group display name")
|
|
40
|
-
parser_action.add_argument(
|
|
48
|
+
parser_action.add_argument(
|
|
49
|
+
"--parents", help="Parent group identifiers", nargs="*", default=["admin"]
|
|
50
|
+
)
|
|
41
51
|
parser_action = subparser_service2.add_parser("delete", help="Delete group")
|
|
42
52
|
parser_action.add_argument("--id", "-i", help="Group name")
|
|
43
53
|
parser_action = subparser_service2.add_parser("get", help="Get group")
|
|
@@ -49,7 +59,9 @@ def execute_action(service, action, operation, args):
|
|
|
49
59
|
parse_remote_args(args)
|
|
50
60
|
|
|
51
61
|
if action == "site" and operation == "create":
|
|
52
|
-
return alfresco_create_site(
|
|
62
|
+
return alfresco_create_site(
|
|
63
|
+
args.get("id"), args.get("title"), args.get("description"), args.get("visibility")
|
|
64
|
+
)
|
|
53
65
|
if action == "site" and operation == "list":
|
|
54
66
|
return alfresco_list_sites()
|
|
55
67
|
if action == "site" and operation == "get":
|
|
@@ -59,7 +71,9 @@ def execute_action(service, action, operation, args):
|
|
|
59
71
|
if action == "site" and operation == "remove-group":
|
|
60
72
|
return alfresco_remove_permissions(args.get("group"), args.get("id"))
|
|
61
73
|
if action == "group" and operation == "create":
|
|
62
|
-
return alfresco_create_group(
|
|
74
|
+
return alfresco_create_group(
|
|
75
|
+
args.get("id"), args.get("display_name"), args.get("parents")
|
|
76
|
+
)
|
|
63
77
|
if action == "group" and operation == "get":
|
|
64
78
|
return alfresco_get_group(args.get("id"))
|
|
65
79
|
if action == "group" and operation == "get":
|
|
@@ -86,13 +100,30 @@ def call_alfresco_api(method, definition, url, **kwargs):
|
|
|
86
100
|
raise ValueError("[alfresco] No ticket and no user/password provided")
|
|
87
101
|
alfresco_ticket = alfresco_login(alfresco_user, alfresco_password)
|
|
88
102
|
return utils.call_rest_api(
|
|
89
|
-
method,
|
|
103
|
+
method,
|
|
104
|
+
"alfresco",
|
|
105
|
+
f"{alfresco_endpoint}/{definition}/versions/1/",
|
|
106
|
+
url,
|
|
107
|
+
None,
|
|
108
|
+
kwargs
|
|
109
|
+
| {
|
|
110
|
+
"headers": {
|
|
111
|
+
"Authorization": f"Basic {base64.b64encode(alfresco_ticket.encode('ascii')).decode()}"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
90
114
|
)
|
|
91
115
|
|
|
92
116
|
|
|
93
117
|
def alfresco_login(user, password):
|
|
94
118
|
utils.info(f"[alfresco] Login of user '{user}' ...")
|
|
95
|
-
return utils.call_rest_api(
|
|
119
|
+
return utils.call_rest_api(
|
|
120
|
+
"POST",
|
|
121
|
+
"alfresco",
|
|
122
|
+
f"{alfresco_endpoint}/authentication/versions/1/",
|
|
123
|
+
"tickets",
|
|
124
|
+
None,
|
|
125
|
+
{"data": {"userId": user, "password": password}},
|
|
126
|
+
).json()["entry"]["id"]
|
|
96
127
|
|
|
97
128
|
|
|
98
129
|
def alfresco_internal_group_name(name):
|
|
@@ -123,7 +154,12 @@ def alfresco_create_group(name: str, display_name: str, parents=None):
|
|
|
123
154
|
if alfresco_get_group(name):
|
|
124
155
|
utils.debug(f"[alfresco] Group {name} already exists ...")
|
|
125
156
|
else:
|
|
126
|
-
call_alfresco_api(
|
|
157
|
+
call_alfresco_api(
|
|
158
|
+
"POST",
|
|
159
|
+
"alfresco",
|
|
160
|
+
"groups",
|
|
161
|
+
data={"id": name, "displayName": display_name, "parentIds": parents or []},
|
|
162
|
+
)
|
|
127
163
|
|
|
128
164
|
|
|
129
165
|
def alfresco_list_sites():
|
|
@@ -146,17 +182,31 @@ def alfresco_create_site(name, title, description, visibility="PRIVATE"):
|
|
|
146
182
|
if not title:
|
|
147
183
|
title = name
|
|
148
184
|
if site_details is None:
|
|
149
|
-
call_alfresco_api(
|
|
185
|
+
call_alfresco_api(
|
|
186
|
+
"POST",
|
|
187
|
+
"alfresco",
|
|
188
|
+
"sites",
|
|
189
|
+
data={"id": name, "title": title, "description": description, "visibility": visibility},
|
|
190
|
+
)
|
|
150
191
|
return
|
|
151
192
|
|
|
152
193
|
utils.info(f"[alfresco] Site {name} already exists")
|
|
153
194
|
current_title = site_details.get("title", "")
|
|
154
195
|
current_description = site_details.get("description", "")
|
|
155
196
|
current_visibility = site_details["visibility"]
|
|
156
|
-
if
|
|
197
|
+
if (
|
|
198
|
+
current_title != (title or "")
|
|
199
|
+
or current_description != (description or "")
|
|
200
|
+
or current_visibility != visibility
|
|
201
|
+
):
|
|
157
202
|
# Update to the new key
|
|
158
203
|
utils.debug(f"[alfresco] Update site '{name}' title, description or visibility ...")
|
|
159
|
-
call_alfresco_api(
|
|
204
|
+
call_alfresco_api(
|
|
205
|
+
"PUT",
|
|
206
|
+
"alfresco",
|
|
207
|
+
f"sites/{name}",
|
|
208
|
+
data={"title": title, "description": description, "visibility": visibility},
|
|
209
|
+
)
|
|
160
210
|
|
|
161
211
|
|
|
162
212
|
def alfresco_delete_site(site_id, site_details, remove_from_trash):
|
|
@@ -167,15 +217,25 @@ def alfresco_delete_site(site_id, site_details, remove_from_trash):
|
|
|
167
217
|
call_alfresco_api("DELETE", "alfresco", f"sites/{site_id}")
|
|
168
218
|
|
|
169
219
|
if remove_from_trash:
|
|
170
|
-
nodes = call_alfresco_api(
|
|
171
|
-
|
|
220
|
+
nodes = call_alfresco_api(
|
|
221
|
+
"GET", "alfresco", "deleted-nodes", data={"maxItems": 100000}
|
|
222
|
+
).json()["list"]["entries"]
|
|
223
|
+
node_entry = next(
|
|
224
|
+
filter(
|
|
225
|
+
lambda x: x["entry"]["nodeType"] == "st:site" and x["entry"]["name"] == site_id,
|
|
226
|
+
nodes,
|
|
227
|
+
),
|
|
228
|
+
None,
|
|
229
|
+
)
|
|
172
230
|
if node_entry:
|
|
173
231
|
# Also remote site from trash
|
|
174
232
|
node_id = node_entry["entry"]["id"]
|
|
175
233
|
utils.info(f"[alfresco] Delete site {site_id} from trash, node_id={node_id} ...")
|
|
176
234
|
call_alfresco_api("DELETE", "alfresco", f"deleted-nodes/{node_id}")
|
|
177
235
|
elif site_details:
|
|
178
|
-
utils.warn(
|
|
236
|
+
utils.warn(
|
|
237
|
+
f"[alfresco] Site {site_id} has been deleted, however it is not found in trash"
|
|
238
|
+
)
|
|
179
239
|
|
|
180
240
|
|
|
181
241
|
def alfresco_create_site_roles(groups_by_name: dict[str, str], definition):
|
|
@@ -192,7 +252,12 @@ def alfresco_create_site_roles(groups_by_name: dict[str, str], definition):
|
|
|
192
252
|
alfresco_site_title = alfresco_site_id
|
|
193
253
|
if alfresco_site_visibility not in ["PUBLIC", "PRIVATE"]:
|
|
194
254
|
raise ValueError("[alfresco] Invalid Alfresco visibility in site '{alfresco_site_id}'")
|
|
195
|
-
alfresco_create_site(
|
|
255
|
+
alfresco_create_site(
|
|
256
|
+
alfresco_site_id,
|
|
257
|
+
alfresco_site_title,
|
|
258
|
+
alfresco_site_description,
|
|
259
|
+
alfresco_site_visibility,
|
|
260
|
+
)
|
|
196
261
|
alfresco_create_roles_scope(groups_by_name, alfresco_site, alfresco_site_id)
|
|
197
262
|
|
|
198
263
|
|
|
@@ -231,16 +296,32 @@ def alfresco_delete_roles_scope(groups_by_name: dict[str, str], definition, site
|
|
|
231
296
|
|
|
232
297
|
def alfresco_set_permissions(group, permissions, site_id):
|
|
233
298
|
for permission in permissions:
|
|
234
|
-
utils.info(
|
|
299
|
+
utils.info(
|
|
300
|
+
f"[alfresco] Set permission '{permission}' to group '{group}' on site '{site_id}' ..."
|
|
301
|
+
)
|
|
235
302
|
group = alfresco_internal_group_name(group)
|
|
236
|
-
member = call_alfresco_api(
|
|
303
|
+
member = call_alfresco_api(
|
|
304
|
+
"GET", "alfresco", f"sites/{site_id}/group-members/{group}", ignore_400=True
|
|
305
|
+
)
|
|
237
306
|
if member:
|
|
238
|
-
call_alfresco_api(
|
|
307
|
+
call_alfresco_api(
|
|
308
|
+
"PUT",
|
|
309
|
+
"alfresco",
|
|
310
|
+
f"sites/{site_id}/group-members/{group}",
|
|
311
|
+
data={"role": permission},
|
|
312
|
+
)
|
|
239
313
|
else:
|
|
240
|
-
call_alfresco_api(
|
|
314
|
+
call_alfresco_api(
|
|
315
|
+
"POST",
|
|
316
|
+
"alfresco",
|
|
317
|
+
f"sites/{site_id}/group-members",
|
|
318
|
+
data={"id": group, "role": permission},
|
|
319
|
+
)
|
|
241
320
|
|
|
242
321
|
|
|
243
322
|
def alfresco_remove_permissions(group, site_id):
|
|
244
323
|
utils.info(f"[alfresco] Remove group '{group}' from site '{site_id}' ...")
|
|
245
324
|
group = alfresco_internal_group_name(group)
|
|
246
|
-
call_alfresco_api(
|
|
325
|
+
call_alfresco_api(
|
|
326
|
+
"DELETE", "alfresco", f"sites/{site_id}/group-members/{group}", ignore_409=True
|
|
327
|
+
)
|