midpoint-cli 1.1.0__tar.gz → 1.3.0__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.
- midpoint-cli-1.3.0/PKG-INFO +228 -0
- midpoint-cli-1.3.0/README.md +211 -0
- midpoint-cli-1.3.0/midpoint_cli.egg-info/PKG-INFO +228 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/midpoint_cli.egg-info/SOURCES.txt +3 -0
- midpoint-cli-1.3.0/midpoint_cli.egg-info/requires.txt +6 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/setup.py +16 -1
- midpoint-cli-1.3.0/src/midpoint-cli +67 -0
- midpoint-cli-1.3.0/src/midpoint_cli/__init__.py +1 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/src/midpoint_cli/client/__init__.py +62 -57
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/src/midpoint_cli/client/objects.py +97 -3
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/src/midpoint_cli/prompt/__init__.py +16 -0
- midpoint-cli-1.3.0/src/midpoint_cli/prompt/base.py +5 -0
- midpoint-cli-1.3.0/src/midpoint_cli/prompt/configuration.py +49 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/src/midpoint_cli/prompt/org.py +6 -2
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/src/midpoint_cli/prompt/resource.py +16 -3
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/src/midpoint_cli/prompt/script.py +6 -2
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/src/midpoint_cli/prompt/task.py +40 -8
- midpoint-cli-1.3.0/src/midpoint_cli/prompt/user.py +87 -0
- midpoint-cli-1.3.0/test/test_client_api.py +43 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/test/test_client_model.py +8 -4
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/test/test_client_put.py +5 -4
- midpoint-cli-1.3.0/test/test_environment.py +54 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/test/test_parser.py +2 -2
- midpoint-cli-1.1.0/PKG-INFO +0 -15
- midpoint-cli-1.1.0/midpoint_cli.egg-info/PKG-INFO +0 -15
- midpoint-cli-1.1.0/midpoint_cli.egg-info/requires.txt +0 -3
- midpoint-cli-1.1.0/src/midpoint-cli +0 -52
- midpoint-cli-1.1.0/src/midpoint_cli/__init__.py +0 -1
- midpoint-cli-1.1.0/src/midpoint_cli/prompt/base.py +0 -3
- midpoint-cli-1.1.0/src/midpoint_cli/prompt/user.py +0 -56
- midpoint-cli-1.1.0/test/test_client_api.py +0 -47
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/LICENSE +0 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/midpoint_cli.egg-info/dependency_links.txt +0 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/midpoint_cli.egg-info/top_level.txt +0 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/setup.cfg +0 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/src/midpoint_cli/client/observer.py +0 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/src/midpoint_cli/client/patch.py +0 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/src/midpoint_cli/client/progress.py +0 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/src/midpoint_cli/client/session.py +0 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/src/midpoint_cli/prompt/complete.py +0 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/src/midpoint_cli/prompt/console.py +0 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/src/midpoint_cli/prompt/delete.py +0 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/src/midpoint_cli/prompt/get.py +0 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/src/midpoint_cli/prompt/put.py +0 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/test/test_patch.py +0 -0
- {midpoint-cli-1.1.0 → midpoint-cli-1.3.0}/test/test_script.py +0 -0
@@ -0,0 +1,228 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: midpoint-cli
|
3
|
+
Version: 1.3.0
|
4
|
+
Summary: A command line client to Midpoint Identity Management system.
|
5
|
+
Home-page: https://gitlab.com/alcibiade/midpoint-cli
|
6
|
+
Author: Yannick Kirschhoffer
|
7
|
+
Author-email: alcibiade@alcibiade.org
|
8
|
+
License: MIT
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
10
|
+
Classifier: Intended Audience :: Developers
|
11
|
+
Classifier: Intended Audience :: System Administrators
|
12
|
+
Classifier: Topic :: System :: Systems Administration
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
15
|
+
Description-Content-Type: text/markdown
|
16
|
+
License-File: LICENSE
|
17
|
+
|
18
|
+
## Midpoint CLI
|
19
|
+
|
20
|
+
This project is a command line client interface used to drive an Evolveum Midpoint identity management server.
|
21
|
+
|
22
|
+
The objectives of this tool are to enable:
|
23
|
+
|
24
|
+
* Administrator access to run tasks and review data
|
25
|
+
* Scripting for remote controlled automation
|
26
|
+
* Test scenarios implementation
|
27
|
+
|
28
|
+
The client currently supports:
|
29
|
+
|
30
|
+
* Users and Organizational units display
|
31
|
+
* User search
|
32
|
+
* Running tasks synchronously
|
33
|
+
* Retrieving object definitions of any kind
|
34
|
+
* Uploading objects from local files and applying patches
|
35
|
+
|
36
|
+
Features currently under development:
|
37
|
+
|
38
|
+
* Auto completion to search of IDs or task names
|
39
|
+
* Improved task results display: retrieve and display a human readable status output
|
40
|
+
* Any other tasks that would be sumbitted in the issue tracker of this project on Gitlab
|
41
|
+
|
42
|
+
The strong points of this project are:
|
43
|
+
|
44
|
+
* All commands can be run directly or using an interactive prompt session
|
45
|
+
* Colorful output
|
46
|
+
* A user-friendly bash compatible command line history management
|
47
|
+
* Full interactive help system
|
48
|
+
* A classical midpoint-cli [command] [command options] syntax
|
49
|
+
|
50
|
+
## Usage
|
51
|
+
|
52
|
+
### General syntax
|
53
|
+
|
54
|
+
```bash
|
55
|
+
usage: midpoint-cli [-h] [-v] [-u USERNAME] [-p PASSWORD] [-U URL]
|
56
|
+
[command] [arg [arg ...]]
|
57
|
+
|
58
|
+
An interactive Midpoint command line client.
|
59
|
+
|
60
|
+
positional arguments:
|
61
|
+
command Optional command to be executed immediately.
|
62
|
+
arg Optional command arguments.
|
63
|
+
|
64
|
+
optional arguments:
|
65
|
+
-h, --help show this help message and exit
|
66
|
+
-v, --version Set the username to authenticate this session.
|
67
|
+
-u USERNAME, --username USERNAME
|
68
|
+
Set the username to authenticate this session.
|
69
|
+
-p PASSWORD, --password PASSWORD
|
70
|
+
Set the password to authenticate this session.
|
71
|
+
-U URL, --url URL Midpoint base URL
|
72
|
+
|
73
|
+
Available commands:
|
74
|
+
get Get an XML definition from the server from an existing OID reference.
|
75
|
+
put Create/Update a server object based on an XML structure.
|
76
|
+
delete Delete a server object based on its type and OID.
|
77
|
+
|
78
|
+
task Manage server tasks.
|
79
|
+
resource Manage resources on the server.
|
80
|
+
|
81
|
+
org Manage organizations.
|
82
|
+
user Manage users.
|
83
|
+
|
84
|
+
Midpoint-cli version 0.7.0, created and maintained by Yannick Kirschhoffer alcibiade@alcibiade.org
|
85
|
+
```
|
86
|
+
|
87
|
+
### Exernal configuration files (since v1.2)
|
88
|
+
|
89
|
+
Settings can be provided from an external configuration file. It can be either:
|
90
|
+
|
91
|
+
* .midpoint-cli.cfg in the home directory of the current user
|
92
|
+
* midpoint-cli.cfg in the current working directory
|
93
|
+
|
94
|
+
The syntax is as follows:
|
95
|
+
|
96
|
+
```
|
97
|
+
[Midpoint]
|
98
|
+
url = https://localhost:8080/midpoint/
|
99
|
+
username = administrator
|
100
|
+
password = ...
|
101
|
+
```
|
102
|
+
|
103
|
+
### Environment variables (since v1.2)
|
104
|
+
|
105
|
+
The script will scan environment variables to read input parameters. This is
|
106
|
+
particularily useful for injection of password or in-container execution.
|
107
|
+
|
108
|
+
The variables are:
|
109
|
+
|
110
|
+
* MIDPOINT_URL
|
111
|
+
* MIDPOINT_USERNAME
|
112
|
+
* MIDPOINT_PASSWORD
|
113
|
+
|
114
|
+
## Requirements
|
115
|
+
|
116
|
+
This program is compatible with Python version 3.7 or above.
|
117
|
+
|
118
|
+
## Installation
|
119
|
+
|
120
|
+
### Through PyPI
|
121
|
+
|
122
|
+
The most common way to install midpoint-cli on your own computer is to use the PyPI repository:
|
123
|
+
|
124
|
+
```bash
|
125
|
+
yk@lunar:~$ pip3 install midpoint-cli
|
126
|
+
Collecting midpoint-cli
|
127
|
+
Downloading https://files.pythonhosted.org/packages/91/03/eaebde078e3560dfa919924d0a7c395f07a2e3fc9740223ea53db3afad05/midpoint-cli-0.7.0.tar.gz
|
128
|
+
|
129
|
+
[...]
|
130
|
+
|
131
|
+
Successfully built midpoint-cli clint tabulate args
|
132
|
+
Installing collected packages: args, clint, idna, urllib3, chardet, certifi, requests, tabulate, midpoint-cli
|
133
|
+
Successfully installed args-0.1.0 certifi-2019.9.11 chardet-3.0.4 clint-0.5.1 idna-2.8 midpoint-cli-0.7.0 requests-2.22.0 tabulate-0.8.5 urllib3-1.25.6
|
134
|
+
|
135
|
+
```
|
136
|
+
|
137
|
+
### Development build
|
138
|
+
|
139
|
+
To install the current development version from GIT:
|
140
|
+
|
141
|
+
```bash
|
142
|
+
yk@lunar:~/dev$ git clone https://gitlab.com/alcibiade/midpoint-cli.git
|
143
|
+
Cloning into 'midpoint-cli'...
|
144
|
+
remote: Enumerating objects: 374, done.
|
145
|
+
remote: Counting objects: 100% (374/374), done.
|
146
|
+
remote: Compressing objects: 100% (176/176), done.
|
147
|
+
remote: Total 374 (delta 229), reused 299 (delta 175)
|
148
|
+
Receiving objects: 100% (374/374), 62.84 KiB | 0 bytes/s, done.
|
149
|
+
Resolving deltas: 100% (229/229), done.
|
150
|
+
|
151
|
+
yk@lunar:~/dev$ pip3 install midpoint-cli/
|
152
|
+
Processing ./midpoint-cli
|
153
|
+
Collecting clint (from midpoint-cli===0.8-snapshot)
|
154
|
+
Collecting requests (from midpoint-cli===0.8-snapshot)
|
155
|
+
Using cached https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl
|
156
|
+
Collecting tabulate (from midpoint-cli===0.8-snapshot)
|
157
|
+
Collecting args (from clint->midpoint-cli===0.8-snapshot)
|
158
|
+
Collecting chardet<3.1.0,>=3.0.2 (from requests->midpoint-cli===0.8-snapshot)
|
159
|
+
Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
|
160
|
+
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests->midpoint-cli===0.8-snapshot)
|
161
|
+
Using cached https://files.pythonhosted.org/packages/e0/da/55f51ea951e1b7c63a579c09dd7db825bb730ec1fe9c0180fc77bfb31448/urllib3-1.25.6-py2.py3-none-any.whl
|
162
|
+
Collecting certifi>=2017.4.17 (from requests->midpoint-cli===0.8-snapshot)
|
163
|
+
Using cached https://files.pythonhosted.org/packages/18/b0/8146a4f8dd402f60744fa380bc73ca47303cccf8b9190fd16a827281eac2/certifi-2019.9.11-py2.py3-none-any.whl
|
164
|
+
Collecting idna<2.9,>=2.5 (from requests->midpoint-cli===0.8-snapshot)
|
165
|
+
Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
|
166
|
+
Building wheels for collected packages: midpoint-cli
|
167
|
+
Running setup.py bdist_wheel for midpoint-cli ... done
|
168
|
+
Stored in directory: /home/yk/.cache/pip/wheels/2a/5a/d6/54312f2db19e2a44cea90e4e1c186e7c1beb7192b4974db759
|
169
|
+
Successfully built midpoint-cli
|
170
|
+
Installing collected packages: args, clint, chardet, urllib3, certifi, idna, requests, tabulate, midpoint-cli
|
171
|
+
Successfully installed args-0.1.0 certifi-2019.9.11 chardet-3.0.4 clint-0.5.1 idna-2.8 midpoint-cli-0.7.0 requests-2.22.0 tabulate-0.8.5 urllib3-1.25.6
|
172
|
+
|
173
|
+
yk@lunar:~/dev$ midpoint-cli -v
|
174
|
+
Midpoint CLI Version 0.8-snapshot
|
175
|
+
```
|
176
|
+
|
177
|
+
### Anaconda
|
178
|
+
|
179
|
+
Anaconda packages are not available yet.
|
180
|
+
|
181
|
+
## Setting up a sanbox environment
|
182
|
+
|
183
|
+
If you wish to test this project locally and don’t have a midpoint server available, you can use the
|
184
|
+
following instructions.
|
185
|
+
|
186
|
+
### Using the Evolveum managed Docker image
|
187
|
+
|
188
|
+
Pull the image locally:
|
189
|
+
|
190
|
+
```bash
|
191
|
+
yk@lunar:~$ docker pull evolveum/midpoint
|
192
|
+
Using default tag: latest
|
193
|
+
latest: Pulling from evolveum/midpoint
|
194
|
+
|
195
|
+
[...]
|
196
|
+
|
197
|
+
Digest: sha256:1e29b7e891d17bf7b1cf1853c84609e414c3a71d5c420aa38927200b2bdecc8e
|
198
|
+
Status: Downloaded newer image for evolveum/midpoint:latest
|
199
|
+
docker.io/evolveum/midpoint:latest
|
200
|
+
|
201
|
+
|
202
|
+
```
|
203
|
+
|
204
|
+
Then run the server and bind the port 8080:
|
205
|
+
|
206
|
+
```bash
|
207
|
+
yk@lunar:~$ docker run -d --name midpoint-1 -p8080:8080 evolveum/midpoint
|
208
|
+
c048d519395ca48c8e94e361a2239b1c35c5e5305a29600895056e030d6a576f
|
209
|
+
|
210
|
+
yk@lunar:~$ midpoint-cli
|
211
|
+
Welcome to Midpoint client ! Type ? for a list of commands
|
212
|
+
midpoint> users
|
213
|
+
OID Name Title FullName Status EmpNo Email OU
|
214
|
+
------------------------------------ ------------- ------- ---------------------- -------- ------- ------- ----
|
215
|
+
00000000-0000-0000-0000-000000000002 administrator midPoint Administrator enabled
|
216
|
+
midpoint>
|
217
|
+
|
218
|
+
yk@lunar:~$ docker stop midpoint-1
|
219
|
+
midpoint-1
|
220
|
+
```
|
221
|
+
|
222
|
+
## Deployment of a new version
|
223
|
+
|
224
|
+
* Update revision in src/midpoint_cli/__init__.py
|
225
|
+
* Commit and tag with corresponding version number
|
226
|
+
* Generate markdown documentation: downdoc README.adoc
|
227
|
+
* Build distribution: python setup.py sdist
|
228
|
+
* Upload distribution to PyPI: twine upload dist/*
|
@@ -0,0 +1,211 @@
|
|
1
|
+
## Midpoint CLI
|
2
|
+
|
3
|
+
This project is a command line client interface used to drive an Evolveum Midpoint identity management server.
|
4
|
+
|
5
|
+
The objectives of this tool are to enable:
|
6
|
+
|
7
|
+
* Administrator access to run tasks and review data
|
8
|
+
* Scripting for remote controlled automation
|
9
|
+
* Test scenarios implementation
|
10
|
+
|
11
|
+
The client currently supports:
|
12
|
+
|
13
|
+
* Users and Organizational units display
|
14
|
+
* User search
|
15
|
+
* Running tasks synchronously
|
16
|
+
* Retrieving object definitions of any kind
|
17
|
+
* Uploading objects from local files and applying patches
|
18
|
+
|
19
|
+
Features currently under development:
|
20
|
+
|
21
|
+
* Auto completion to search of IDs or task names
|
22
|
+
* Improved task results display: retrieve and display a human readable status output
|
23
|
+
* Any other tasks that would be sumbitted in the issue tracker of this project on Gitlab
|
24
|
+
|
25
|
+
The strong points of this project are:
|
26
|
+
|
27
|
+
* All commands can be run directly or using an interactive prompt session
|
28
|
+
* Colorful output
|
29
|
+
* A user-friendly bash compatible command line history management
|
30
|
+
* Full interactive help system
|
31
|
+
* A classical midpoint-cli [command] [command options] syntax
|
32
|
+
|
33
|
+
## Usage
|
34
|
+
|
35
|
+
### General syntax
|
36
|
+
|
37
|
+
```bash
|
38
|
+
usage: midpoint-cli [-h] [-v] [-u USERNAME] [-p PASSWORD] [-U URL]
|
39
|
+
[command] [arg [arg ...]]
|
40
|
+
|
41
|
+
An interactive Midpoint command line client.
|
42
|
+
|
43
|
+
positional arguments:
|
44
|
+
command Optional command to be executed immediately.
|
45
|
+
arg Optional command arguments.
|
46
|
+
|
47
|
+
optional arguments:
|
48
|
+
-h, --help show this help message and exit
|
49
|
+
-v, --version Set the username to authenticate this session.
|
50
|
+
-u USERNAME, --username USERNAME
|
51
|
+
Set the username to authenticate this session.
|
52
|
+
-p PASSWORD, --password PASSWORD
|
53
|
+
Set the password to authenticate this session.
|
54
|
+
-U URL, --url URL Midpoint base URL
|
55
|
+
|
56
|
+
Available commands:
|
57
|
+
get Get an XML definition from the server from an existing OID reference.
|
58
|
+
put Create/Update a server object based on an XML structure.
|
59
|
+
delete Delete a server object based on its type and OID.
|
60
|
+
|
61
|
+
task Manage server tasks.
|
62
|
+
resource Manage resources on the server.
|
63
|
+
|
64
|
+
org Manage organizations.
|
65
|
+
user Manage users.
|
66
|
+
|
67
|
+
Midpoint-cli version 0.7.0, created and maintained by Yannick Kirschhoffer alcibiade@alcibiade.org
|
68
|
+
```
|
69
|
+
|
70
|
+
### Exernal configuration files (since v1.2)
|
71
|
+
|
72
|
+
Settings can be provided from an external configuration file. It can be either:
|
73
|
+
|
74
|
+
* .midpoint-cli.cfg in the home directory of the current user
|
75
|
+
* midpoint-cli.cfg in the current working directory
|
76
|
+
|
77
|
+
The syntax is as follows:
|
78
|
+
|
79
|
+
```
|
80
|
+
[Midpoint]
|
81
|
+
url = https://localhost:8080/midpoint/
|
82
|
+
username = administrator
|
83
|
+
password = ...
|
84
|
+
```
|
85
|
+
|
86
|
+
### Environment variables (since v1.2)
|
87
|
+
|
88
|
+
The script will scan environment variables to read input parameters. This is
|
89
|
+
particularily useful for injection of password or in-container execution.
|
90
|
+
|
91
|
+
The variables are:
|
92
|
+
|
93
|
+
* MIDPOINT_URL
|
94
|
+
* MIDPOINT_USERNAME
|
95
|
+
* MIDPOINT_PASSWORD
|
96
|
+
|
97
|
+
## Requirements
|
98
|
+
|
99
|
+
This program is compatible with Python version 3.7 or above.
|
100
|
+
|
101
|
+
## Installation
|
102
|
+
|
103
|
+
### Through PyPI
|
104
|
+
|
105
|
+
The most common way to install midpoint-cli on your own computer is to use the PyPI repository:
|
106
|
+
|
107
|
+
```bash
|
108
|
+
yk@lunar:~$ pip3 install midpoint-cli
|
109
|
+
Collecting midpoint-cli
|
110
|
+
Downloading https://files.pythonhosted.org/packages/91/03/eaebde078e3560dfa919924d0a7c395f07a2e3fc9740223ea53db3afad05/midpoint-cli-0.7.0.tar.gz
|
111
|
+
|
112
|
+
[...]
|
113
|
+
|
114
|
+
Successfully built midpoint-cli clint tabulate args
|
115
|
+
Installing collected packages: args, clint, idna, urllib3, chardet, certifi, requests, tabulate, midpoint-cli
|
116
|
+
Successfully installed args-0.1.0 certifi-2019.9.11 chardet-3.0.4 clint-0.5.1 idna-2.8 midpoint-cli-0.7.0 requests-2.22.0 tabulate-0.8.5 urllib3-1.25.6
|
117
|
+
|
118
|
+
```
|
119
|
+
|
120
|
+
### Development build
|
121
|
+
|
122
|
+
To install the current development version from GIT:
|
123
|
+
|
124
|
+
```bash
|
125
|
+
yk@lunar:~/dev$ git clone https://gitlab.com/alcibiade/midpoint-cli.git
|
126
|
+
Cloning into 'midpoint-cli'...
|
127
|
+
remote: Enumerating objects: 374, done.
|
128
|
+
remote: Counting objects: 100% (374/374), done.
|
129
|
+
remote: Compressing objects: 100% (176/176), done.
|
130
|
+
remote: Total 374 (delta 229), reused 299 (delta 175)
|
131
|
+
Receiving objects: 100% (374/374), 62.84 KiB | 0 bytes/s, done.
|
132
|
+
Resolving deltas: 100% (229/229), done.
|
133
|
+
|
134
|
+
yk@lunar:~/dev$ pip3 install midpoint-cli/
|
135
|
+
Processing ./midpoint-cli
|
136
|
+
Collecting clint (from midpoint-cli===0.8-snapshot)
|
137
|
+
Collecting requests (from midpoint-cli===0.8-snapshot)
|
138
|
+
Using cached https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl
|
139
|
+
Collecting tabulate (from midpoint-cli===0.8-snapshot)
|
140
|
+
Collecting args (from clint->midpoint-cli===0.8-snapshot)
|
141
|
+
Collecting chardet<3.1.0,>=3.0.2 (from requests->midpoint-cli===0.8-snapshot)
|
142
|
+
Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
|
143
|
+
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests->midpoint-cli===0.8-snapshot)
|
144
|
+
Using cached https://files.pythonhosted.org/packages/e0/da/55f51ea951e1b7c63a579c09dd7db825bb730ec1fe9c0180fc77bfb31448/urllib3-1.25.6-py2.py3-none-any.whl
|
145
|
+
Collecting certifi>=2017.4.17 (from requests->midpoint-cli===0.8-snapshot)
|
146
|
+
Using cached https://files.pythonhosted.org/packages/18/b0/8146a4f8dd402f60744fa380bc73ca47303cccf8b9190fd16a827281eac2/certifi-2019.9.11-py2.py3-none-any.whl
|
147
|
+
Collecting idna<2.9,>=2.5 (from requests->midpoint-cli===0.8-snapshot)
|
148
|
+
Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
|
149
|
+
Building wheels for collected packages: midpoint-cli
|
150
|
+
Running setup.py bdist_wheel for midpoint-cli ... done
|
151
|
+
Stored in directory: /home/yk/.cache/pip/wheels/2a/5a/d6/54312f2db19e2a44cea90e4e1c186e7c1beb7192b4974db759
|
152
|
+
Successfully built midpoint-cli
|
153
|
+
Installing collected packages: args, clint, chardet, urllib3, certifi, idna, requests, tabulate, midpoint-cli
|
154
|
+
Successfully installed args-0.1.0 certifi-2019.9.11 chardet-3.0.4 clint-0.5.1 idna-2.8 midpoint-cli-0.7.0 requests-2.22.0 tabulate-0.8.5 urllib3-1.25.6
|
155
|
+
|
156
|
+
yk@lunar:~/dev$ midpoint-cli -v
|
157
|
+
Midpoint CLI Version 0.8-snapshot
|
158
|
+
```
|
159
|
+
|
160
|
+
### Anaconda
|
161
|
+
|
162
|
+
Anaconda packages are not available yet.
|
163
|
+
|
164
|
+
## Setting up a sanbox environment
|
165
|
+
|
166
|
+
If you wish to test this project locally and don’t have a midpoint server available, you can use the
|
167
|
+
following instructions.
|
168
|
+
|
169
|
+
### Using the Evolveum managed Docker image
|
170
|
+
|
171
|
+
Pull the image locally:
|
172
|
+
|
173
|
+
```bash
|
174
|
+
yk@lunar:~$ docker pull evolveum/midpoint
|
175
|
+
Using default tag: latest
|
176
|
+
latest: Pulling from evolveum/midpoint
|
177
|
+
|
178
|
+
[...]
|
179
|
+
|
180
|
+
Digest: sha256:1e29b7e891d17bf7b1cf1853c84609e414c3a71d5c420aa38927200b2bdecc8e
|
181
|
+
Status: Downloaded newer image for evolveum/midpoint:latest
|
182
|
+
docker.io/evolveum/midpoint:latest
|
183
|
+
|
184
|
+
|
185
|
+
```
|
186
|
+
|
187
|
+
Then run the server and bind the port 8080:
|
188
|
+
|
189
|
+
```bash
|
190
|
+
yk@lunar:~$ docker run -d --name midpoint-1 -p8080:8080 evolveum/midpoint
|
191
|
+
c048d519395ca48c8e94e361a2239b1c35c5e5305a29600895056e030d6a576f
|
192
|
+
|
193
|
+
yk@lunar:~$ midpoint-cli
|
194
|
+
Welcome to Midpoint client ! Type ? for a list of commands
|
195
|
+
midpoint> users
|
196
|
+
OID Name Title FullName Status EmpNo Email OU
|
197
|
+
------------------------------------ ------------- ------- ---------------------- -------- ------- ------- ----
|
198
|
+
00000000-0000-0000-0000-000000000002 administrator midPoint Administrator enabled
|
199
|
+
midpoint>
|
200
|
+
|
201
|
+
yk@lunar:~$ docker stop midpoint-1
|
202
|
+
midpoint-1
|
203
|
+
```
|
204
|
+
|
205
|
+
## Deployment of a new version
|
206
|
+
|
207
|
+
* Update revision in src/midpoint_cli/__init__.py
|
208
|
+
* Commit and tag with corresponding version number
|
209
|
+
* Generate markdown documentation: downdoc README.adoc
|
210
|
+
* Build distribution: python setup.py sdist
|
211
|
+
* Upload distribution to PyPI: twine upload dist/*
|
@@ -0,0 +1,228 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: midpoint-cli
|
3
|
+
Version: 1.3.0
|
4
|
+
Summary: A command line client to Midpoint Identity Management system.
|
5
|
+
Home-page: https://gitlab.com/alcibiade/midpoint-cli
|
6
|
+
Author: Yannick Kirschhoffer
|
7
|
+
Author-email: alcibiade@alcibiade.org
|
8
|
+
License: MIT
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
10
|
+
Classifier: Intended Audience :: Developers
|
11
|
+
Classifier: Intended Audience :: System Administrators
|
12
|
+
Classifier: Topic :: System :: Systems Administration
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
15
|
+
Description-Content-Type: text/markdown
|
16
|
+
License-File: LICENSE
|
17
|
+
|
18
|
+
## Midpoint CLI
|
19
|
+
|
20
|
+
This project is a command line client interface used to drive an Evolveum Midpoint identity management server.
|
21
|
+
|
22
|
+
The objectives of this tool are to enable:
|
23
|
+
|
24
|
+
* Administrator access to run tasks and review data
|
25
|
+
* Scripting for remote controlled automation
|
26
|
+
* Test scenarios implementation
|
27
|
+
|
28
|
+
The client currently supports:
|
29
|
+
|
30
|
+
* Users and Organizational units display
|
31
|
+
* User search
|
32
|
+
* Running tasks synchronously
|
33
|
+
* Retrieving object definitions of any kind
|
34
|
+
* Uploading objects from local files and applying patches
|
35
|
+
|
36
|
+
Features currently under development:
|
37
|
+
|
38
|
+
* Auto completion to search of IDs or task names
|
39
|
+
* Improved task results display: retrieve and display a human readable status output
|
40
|
+
* Any other tasks that would be sumbitted in the issue tracker of this project on Gitlab
|
41
|
+
|
42
|
+
The strong points of this project are:
|
43
|
+
|
44
|
+
* All commands can be run directly or using an interactive prompt session
|
45
|
+
* Colorful output
|
46
|
+
* A user-friendly bash compatible command line history management
|
47
|
+
* Full interactive help system
|
48
|
+
* A classical midpoint-cli [command] [command options] syntax
|
49
|
+
|
50
|
+
## Usage
|
51
|
+
|
52
|
+
### General syntax
|
53
|
+
|
54
|
+
```bash
|
55
|
+
usage: midpoint-cli [-h] [-v] [-u USERNAME] [-p PASSWORD] [-U URL]
|
56
|
+
[command] [arg [arg ...]]
|
57
|
+
|
58
|
+
An interactive Midpoint command line client.
|
59
|
+
|
60
|
+
positional arguments:
|
61
|
+
command Optional command to be executed immediately.
|
62
|
+
arg Optional command arguments.
|
63
|
+
|
64
|
+
optional arguments:
|
65
|
+
-h, --help show this help message and exit
|
66
|
+
-v, --version Set the username to authenticate this session.
|
67
|
+
-u USERNAME, --username USERNAME
|
68
|
+
Set the username to authenticate this session.
|
69
|
+
-p PASSWORD, --password PASSWORD
|
70
|
+
Set the password to authenticate this session.
|
71
|
+
-U URL, --url URL Midpoint base URL
|
72
|
+
|
73
|
+
Available commands:
|
74
|
+
get Get an XML definition from the server from an existing OID reference.
|
75
|
+
put Create/Update a server object based on an XML structure.
|
76
|
+
delete Delete a server object based on its type and OID.
|
77
|
+
|
78
|
+
task Manage server tasks.
|
79
|
+
resource Manage resources on the server.
|
80
|
+
|
81
|
+
org Manage organizations.
|
82
|
+
user Manage users.
|
83
|
+
|
84
|
+
Midpoint-cli version 0.7.0, created and maintained by Yannick Kirschhoffer alcibiade@alcibiade.org
|
85
|
+
```
|
86
|
+
|
87
|
+
### Exernal configuration files (since v1.2)
|
88
|
+
|
89
|
+
Settings can be provided from an external configuration file. It can be either:
|
90
|
+
|
91
|
+
* .midpoint-cli.cfg in the home directory of the current user
|
92
|
+
* midpoint-cli.cfg in the current working directory
|
93
|
+
|
94
|
+
The syntax is as follows:
|
95
|
+
|
96
|
+
```
|
97
|
+
[Midpoint]
|
98
|
+
url = https://localhost:8080/midpoint/
|
99
|
+
username = administrator
|
100
|
+
password = ...
|
101
|
+
```
|
102
|
+
|
103
|
+
### Environment variables (since v1.2)
|
104
|
+
|
105
|
+
The script will scan environment variables to read input parameters. This is
|
106
|
+
particularily useful for injection of password or in-container execution.
|
107
|
+
|
108
|
+
The variables are:
|
109
|
+
|
110
|
+
* MIDPOINT_URL
|
111
|
+
* MIDPOINT_USERNAME
|
112
|
+
* MIDPOINT_PASSWORD
|
113
|
+
|
114
|
+
## Requirements
|
115
|
+
|
116
|
+
This program is compatible with Python version 3.7 or above.
|
117
|
+
|
118
|
+
## Installation
|
119
|
+
|
120
|
+
### Through PyPI
|
121
|
+
|
122
|
+
The most common way to install midpoint-cli on your own computer is to use the PyPI repository:
|
123
|
+
|
124
|
+
```bash
|
125
|
+
yk@lunar:~$ pip3 install midpoint-cli
|
126
|
+
Collecting midpoint-cli
|
127
|
+
Downloading https://files.pythonhosted.org/packages/91/03/eaebde078e3560dfa919924d0a7c395f07a2e3fc9740223ea53db3afad05/midpoint-cli-0.7.0.tar.gz
|
128
|
+
|
129
|
+
[...]
|
130
|
+
|
131
|
+
Successfully built midpoint-cli clint tabulate args
|
132
|
+
Installing collected packages: args, clint, idna, urllib3, chardet, certifi, requests, tabulate, midpoint-cli
|
133
|
+
Successfully installed args-0.1.0 certifi-2019.9.11 chardet-3.0.4 clint-0.5.1 idna-2.8 midpoint-cli-0.7.0 requests-2.22.0 tabulate-0.8.5 urllib3-1.25.6
|
134
|
+
|
135
|
+
```
|
136
|
+
|
137
|
+
### Development build
|
138
|
+
|
139
|
+
To install the current development version from GIT:
|
140
|
+
|
141
|
+
```bash
|
142
|
+
yk@lunar:~/dev$ git clone https://gitlab.com/alcibiade/midpoint-cli.git
|
143
|
+
Cloning into 'midpoint-cli'...
|
144
|
+
remote: Enumerating objects: 374, done.
|
145
|
+
remote: Counting objects: 100% (374/374), done.
|
146
|
+
remote: Compressing objects: 100% (176/176), done.
|
147
|
+
remote: Total 374 (delta 229), reused 299 (delta 175)
|
148
|
+
Receiving objects: 100% (374/374), 62.84 KiB | 0 bytes/s, done.
|
149
|
+
Resolving deltas: 100% (229/229), done.
|
150
|
+
|
151
|
+
yk@lunar:~/dev$ pip3 install midpoint-cli/
|
152
|
+
Processing ./midpoint-cli
|
153
|
+
Collecting clint (from midpoint-cli===0.8-snapshot)
|
154
|
+
Collecting requests (from midpoint-cli===0.8-snapshot)
|
155
|
+
Using cached https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl
|
156
|
+
Collecting tabulate (from midpoint-cli===0.8-snapshot)
|
157
|
+
Collecting args (from clint->midpoint-cli===0.8-snapshot)
|
158
|
+
Collecting chardet<3.1.0,>=3.0.2 (from requests->midpoint-cli===0.8-snapshot)
|
159
|
+
Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
|
160
|
+
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests->midpoint-cli===0.8-snapshot)
|
161
|
+
Using cached https://files.pythonhosted.org/packages/e0/da/55f51ea951e1b7c63a579c09dd7db825bb730ec1fe9c0180fc77bfb31448/urllib3-1.25.6-py2.py3-none-any.whl
|
162
|
+
Collecting certifi>=2017.4.17 (from requests->midpoint-cli===0.8-snapshot)
|
163
|
+
Using cached https://files.pythonhosted.org/packages/18/b0/8146a4f8dd402f60744fa380bc73ca47303cccf8b9190fd16a827281eac2/certifi-2019.9.11-py2.py3-none-any.whl
|
164
|
+
Collecting idna<2.9,>=2.5 (from requests->midpoint-cli===0.8-snapshot)
|
165
|
+
Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
|
166
|
+
Building wheels for collected packages: midpoint-cli
|
167
|
+
Running setup.py bdist_wheel for midpoint-cli ... done
|
168
|
+
Stored in directory: /home/yk/.cache/pip/wheels/2a/5a/d6/54312f2db19e2a44cea90e4e1c186e7c1beb7192b4974db759
|
169
|
+
Successfully built midpoint-cli
|
170
|
+
Installing collected packages: args, clint, chardet, urllib3, certifi, idna, requests, tabulate, midpoint-cli
|
171
|
+
Successfully installed args-0.1.0 certifi-2019.9.11 chardet-3.0.4 clint-0.5.1 idna-2.8 midpoint-cli-0.7.0 requests-2.22.0 tabulate-0.8.5 urllib3-1.25.6
|
172
|
+
|
173
|
+
yk@lunar:~/dev$ midpoint-cli -v
|
174
|
+
Midpoint CLI Version 0.8-snapshot
|
175
|
+
```
|
176
|
+
|
177
|
+
### Anaconda
|
178
|
+
|
179
|
+
Anaconda packages are not available yet.
|
180
|
+
|
181
|
+
## Setting up a sanbox environment
|
182
|
+
|
183
|
+
If you wish to test this project locally and don’t have a midpoint server available, you can use the
|
184
|
+
following instructions.
|
185
|
+
|
186
|
+
### Using the Evolveum managed Docker image
|
187
|
+
|
188
|
+
Pull the image locally:
|
189
|
+
|
190
|
+
```bash
|
191
|
+
yk@lunar:~$ docker pull evolveum/midpoint
|
192
|
+
Using default tag: latest
|
193
|
+
latest: Pulling from evolveum/midpoint
|
194
|
+
|
195
|
+
[...]
|
196
|
+
|
197
|
+
Digest: sha256:1e29b7e891d17bf7b1cf1853c84609e414c3a71d5c420aa38927200b2bdecc8e
|
198
|
+
Status: Downloaded newer image for evolveum/midpoint:latest
|
199
|
+
docker.io/evolveum/midpoint:latest
|
200
|
+
|
201
|
+
|
202
|
+
```
|
203
|
+
|
204
|
+
Then run the server and bind the port 8080:
|
205
|
+
|
206
|
+
```bash
|
207
|
+
yk@lunar:~$ docker run -d --name midpoint-1 -p8080:8080 evolveum/midpoint
|
208
|
+
c048d519395ca48c8e94e361a2239b1c35c5e5305a29600895056e030d6a576f
|
209
|
+
|
210
|
+
yk@lunar:~$ midpoint-cli
|
211
|
+
Welcome to Midpoint client ! Type ? for a list of commands
|
212
|
+
midpoint> users
|
213
|
+
OID Name Title FullName Status EmpNo Email OU
|
214
|
+
------------------------------------ ------------- ------- ---------------------- -------- ------- ------- ----
|
215
|
+
00000000-0000-0000-0000-000000000002 administrator midPoint Administrator enabled
|
216
|
+
midpoint>
|
217
|
+
|
218
|
+
yk@lunar:~$ docker stop midpoint-1
|
219
|
+
midpoint-1
|
220
|
+
```
|
221
|
+
|
222
|
+
## Deployment of a new version
|
223
|
+
|
224
|
+
* Update revision in src/midpoint_cli/__init__.py
|
225
|
+
* Commit and tag with corresponding version number
|
226
|
+
* Generate markdown documentation: downdoc README.adoc
|
227
|
+
* Build distribution: python setup.py sdist
|
228
|
+
* Upload distribution to PyPI: twine upload dist/*
|
@@ -1,4 +1,5 @@
|
|
1
1
|
LICENSE
|
2
|
+
README.md
|
2
3
|
setup.cfg
|
3
4
|
setup.py
|
4
5
|
midpoint_cli.egg-info/PKG-INFO
|
@@ -17,6 +18,7 @@ src/midpoint_cli/client/session.py
|
|
17
18
|
src/midpoint_cli/prompt/__init__.py
|
18
19
|
src/midpoint_cli/prompt/base.py
|
19
20
|
src/midpoint_cli/prompt/complete.py
|
21
|
+
src/midpoint_cli/prompt/configuration.py
|
20
22
|
src/midpoint_cli/prompt/console.py
|
21
23
|
src/midpoint_cli/prompt/delete.py
|
22
24
|
src/midpoint_cli/prompt/get.py
|
@@ -29,6 +31,7 @@ src/midpoint_cli/prompt/user.py
|
|
29
31
|
test/test_client_api.py
|
30
32
|
test/test_client_model.py
|
31
33
|
test/test_client_put.py
|
34
|
+
test/test_environment.py
|
32
35
|
test/test_parser.py
|
33
36
|
test/test_patch.py
|
34
37
|
test/test_script.py
|