python4cpm 1.0.23__tar.gz → 1.0.25__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python4cpm
3
- Version: 1.0.23
3
+ Version: 1.0.25
4
4
  Summary: Python for CPM
5
5
  Author-email: Gonzalo Atienza Rela <gonatienza@gmail.com>
6
6
  License-Expression: MIT
@@ -68,8 +68,9 @@ class MyRotator(Python4CPMHandler): # create a subclass for the Handler
68
68
  These are the usable properties and methods from Python4CPMHandler:
69
69
 
70
70
  self.args.action # action requested from CPM/SRS
71
- self.args.address # address from the account address field
72
71
  self.args.username # username from the account username field
72
+ self.args.address # address from the account address field
73
+ self.args.port # port from the account port field
73
74
  self.args.reconcile_username # reconcile username from the linked reconcile account
74
75
  self.args.logon_username # logon username from the linked logon account
75
76
  self.args.logging # used to carry the platform logging settings for python
@@ -131,7 +132,7 @@ class MyRotator(Python4CPMHandler): # create a subclass for the Handler
131
132
  def _verify(self, from_reconcile=False):
132
133
  if from_reconcile is False:
133
134
  pass
134
- # TODO: use self.args.address, self.args.username, self.secrets.password.get()
135
+ # TODO: use self.args.username, self.args.address, self.args.port, self.secrets.password.get()
135
136
  # for your logic in a verification
136
137
  else:
137
138
  pass
@@ -147,11 +148,11 @@ class MyRotator(Python4CPMHandler): # create a subclass for the Handler
147
148
  def _change(self, from_reconcile=False):
148
149
  if from_reconcile is False:
149
150
  pass
150
- # TODO: use self.args.address, self.args.username, self.secrets.password.get()
151
+ # TODO: use self.args.username, self.args.address, self.args.port, self.secrets.password.get()
151
152
  # and self.secrets.new_password.get() for your logic in a rotation
152
153
  else:
153
154
  pass
154
- # TODO: use self.args.address, self.args.username, self.args.reconcile_username,
155
+ # TODO: use self.args.username, self.args.address, self.args.port, self.args.reconcile_username,
155
156
  # self.secrets.reconcile_password.get() and self.secrets.new_password.get() for your logic in a reconciliation
156
157
  result = True
157
158
  if result is True:
@@ -187,8 +188,9 @@ p4cpm = Python4CPM("MyApp") # this instantiates the object and grabs all argumen
187
188
 
188
189
  # These are the usable properties and related methods from the object:
189
190
  p4cpm.args.action # action requested from CPM/SRS
190
- p4cpm.args.address # address from the account address field
191
191
  p4cpm.args.username # username from the account username field
192
+ p4cpm.args.address # address from the account address field
193
+ p4cpm.args.port # port from the account port field
192
194
  p4cpm.args.reconcile_username # reconcile username from the linked reconcile account
193
195
  p4cpm.args.logon_username # logon username from the linked logon account
194
196
  p4cpm.args.logging # used to carry the platform logging settings for python
@@ -215,11 +217,11 @@ p4cpm.log_debug("this is an debug message") # logs info into Logs/ThirdParty/MyA
215
217
  def verify(from_reconcile=False):
216
218
  if from_reconcile is False:
217
219
  pass
218
- # TODO: use p4cpm.args.address, p4cpm.args.username, p4cpm.secrets.password.get()
220
+ # TODO: use p4cpm.args.username, p4cpm.args.address, p4cpm.args.port, p4cpm.secrets.password.get()
219
221
  # for your logic in a verification
220
222
  else:
221
223
  pass
222
- # TODO: use p4cpm.args.address, p4cpm.args.reconcile_username, p4cpm.secrets.reconcile_password.get()
224
+ # TODO: use p4cpm.args.address, p4cpm.args.port, p4cpm.args.reconcile_username, p4cpm.secrets.reconcile_password.get()
223
225
  # for your logic in a verification
224
226
  result = True
225
227
  if result is True:
@@ -233,11 +235,11 @@ def verify(from_reconcile=False):
233
235
  def change(from_reconcile=False):
234
236
  if from_reconcile is False:
235
237
  pass
236
- # TODO: use p4cpm.args.address, p4cpm.args.username, p4cpm.secrets.password.get()
238
+ # TODO: use p4cpm.args.username, p4cpm.args.address, p4cpm.args.port, p4cpm.secrets.password.get()
237
239
  # and p4cpm.secrets.new_password.get() for your logic in a rotation
238
240
  else:
239
241
  pass
240
- # TODO: use p4cpm.args.address, p4cpm.args.username, p4cpm.args.reconcile_username,
242
+ # TODO: use p4cpm.args.username, p4cpm.args.address, p4cpm.args.port, p4cpm.args.reconcile_username,
241
243
  # p4cpm.secrets.reconcile_password.get() and p4cpm.secrets.new_password.get() for your logic in a reconciliation
242
244
  result = True
243
245
  if result is True:
@@ -323,8 +325,9 @@ new_password = getpass("new_password: ") # new password for the rotation
323
325
 
324
326
  NETHelper.set(
325
327
  action=Python4CPM.ACTION_LOGON, # use actions from Python4CPM.ACTION_*
326
- address="myapp.corp.local", # populate with the address from your account properties
327
328
  username="jdoe", # populate with the username from your account properties
329
+ address="myapp.corp.local", # populate with the address from your account properties
330
+ port="8443", # populate with the port from your account properties
328
331
  logon_username="ldoe", # populate with the logon account username from your linked logon account
329
332
  reconcile_username="rdoe", # ppopulate with the reconcile account username from your linked logon account
330
333
  logging="yes", # populate with the PythonLogging parameter from the platform: "yes" or "no"
@@ -57,8 +57,9 @@ class MyRotator(Python4CPMHandler): # create a subclass for the Handler
57
57
  These are the usable properties and methods from Python4CPMHandler:
58
58
 
59
59
  self.args.action # action requested from CPM/SRS
60
- self.args.address # address from the account address field
61
60
  self.args.username # username from the account username field
61
+ self.args.address # address from the account address field
62
+ self.args.port # port from the account port field
62
63
  self.args.reconcile_username # reconcile username from the linked reconcile account
63
64
  self.args.logon_username # logon username from the linked logon account
64
65
  self.args.logging # used to carry the platform logging settings for python
@@ -120,7 +121,7 @@ class MyRotator(Python4CPMHandler): # create a subclass for the Handler
120
121
  def _verify(self, from_reconcile=False):
121
122
  if from_reconcile is False:
122
123
  pass
123
- # TODO: use self.args.address, self.args.username, self.secrets.password.get()
124
+ # TODO: use self.args.username, self.args.address, self.args.port, self.secrets.password.get()
124
125
  # for your logic in a verification
125
126
  else:
126
127
  pass
@@ -136,11 +137,11 @@ class MyRotator(Python4CPMHandler): # create a subclass for the Handler
136
137
  def _change(self, from_reconcile=False):
137
138
  if from_reconcile is False:
138
139
  pass
139
- # TODO: use self.args.address, self.args.username, self.secrets.password.get()
140
+ # TODO: use self.args.username, self.args.address, self.args.port, self.secrets.password.get()
140
141
  # and self.secrets.new_password.get() for your logic in a rotation
141
142
  else:
142
143
  pass
143
- # TODO: use self.args.address, self.args.username, self.args.reconcile_username,
144
+ # TODO: use self.args.username, self.args.address, self.args.port, self.args.reconcile_username,
144
145
  # self.secrets.reconcile_password.get() and self.secrets.new_password.get() for your logic in a reconciliation
145
146
  result = True
146
147
  if result is True:
@@ -176,8 +177,9 @@ p4cpm = Python4CPM("MyApp") # this instantiates the object and grabs all argumen
176
177
 
177
178
  # These are the usable properties and related methods from the object:
178
179
  p4cpm.args.action # action requested from CPM/SRS
179
- p4cpm.args.address # address from the account address field
180
180
  p4cpm.args.username # username from the account username field
181
+ p4cpm.args.address # address from the account address field
182
+ p4cpm.args.port # port from the account port field
181
183
  p4cpm.args.reconcile_username # reconcile username from the linked reconcile account
182
184
  p4cpm.args.logon_username # logon username from the linked logon account
183
185
  p4cpm.args.logging # used to carry the platform logging settings for python
@@ -204,11 +206,11 @@ p4cpm.log_debug("this is an debug message") # logs info into Logs/ThirdParty/MyA
204
206
  def verify(from_reconcile=False):
205
207
  if from_reconcile is False:
206
208
  pass
207
- # TODO: use p4cpm.args.address, p4cpm.args.username, p4cpm.secrets.password.get()
209
+ # TODO: use p4cpm.args.username, p4cpm.args.address, p4cpm.args.port, p4cpm.secrets.password.get()
208
210
  # for your logic in a verification
209
211
  else:
210
212
  pass
211
- # TODO: use p4cpm.args.address, p4cpm.args.reconcile_username, p4cpm.secrets.reconcile_password.get()
213
+ # TODO: use p4cpm.args.address, p4cpm.args.port, p4cpm.args.reconcile_username, p4cpm.secrets.reconcile_password.get()
212
214
  # for your logic in a verification
213
215
  result = True
214
216
  if result is True:
@@ -222,11 +224,11 @@ def verify(from_reconcile=False):
222
224
  def change(from_reconcile=False):
223
225
  if from_reconcile is False:
224
226
  pass
225
- # TODO: use p4cpm.args.address, p4cpm.args.username, p4cpm.secrets.password.get()
227
+ # TODO: use p4cpm.args.username, p4cpm.args.address, p4cpm.args.port, p4cpm.secrets.password.get()
226
228
  # and p4cpm.secrets.new_password.get() for your logic in a rotation
227
229
  else:
228
230
  pass
229
- # TODO: use p4cpm.args.address, p4cpm.args.username, p4cpm.args.reconcile_username,
231
+ # TODO: use p4cpm.args.username, p4cpm.args.address, p4cpm.args.port, p4cpm.args.reconcile_username,
230
232
  # p4cpm.secrets.reconcile_password.get() and p4cpm.secrets.new_password.get() for your logic in a reconciliation
231
233
  result = True
232
234
  if result is True:
@@ -312,8 +314,9 @@ new_password = getpass("new_password: ") # new password for the rotation
312
314
 
313
315
  NETHelper.set(
314
316
  action=Python4CPM.ACTION_LOGON, # use actions from Python4CPM.ACTION_*
315
- address="myapp.corp.local", # populate with the address from your account properties
316
317
  username="jdoe", # populate with the username from your account properties
318
+ address="myapp.corp.local", # populate with the address from your account properties
319
+ port="8443", # populate with the port from your account properties
317
320
  logon_username="ldoe", # populate with the logon account username from your linked logon account
318
321
  reconcile_username="rdoe", # ppopulate with the reconcile account username from your linked logon account
319
322
  logging="yes", # populate with the PythonLogging parameter from the platform: "yes" or "no"
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python4cpm"
7
- version = "1.0.23"
7
+ version = "1.0.25"
8
8
  description = "Python for CPM"
9
9
  authors = [
10
10
  { name = "Gonzalo Atienza Rela", email = "gonatienza@gmail.com" }
@@ -1,8 +1,9 @@
1
1
  class Args:
2
2
  ARGS = (
3
3
  "action",
4
- "address",
5
4
  "username",
5
+ "address",
6
+ "port",
6
7
  "logon_username",
7
8
  "reconcile_username",
8
9
  "logging",
@@ -12,16 +13,18 @@ class Args:
12
13
  def __init__(
13
14
  self: str,
14
15
  action: str,
15
- address: str,
16
16
  username: str,
17
+ address: str,
18
+ port: str,
17
19
  reconcile_username: str,
18
20
  logon_username: str,
19
21
  logging: str,
20
22
  logging_level: str
21
23
  ) -> None:
22
24
  self._action = action
23
- self._address = address
24
25
  self._username = username
26
+ self._address = address
27
+ self._port = port
25
28
  self._reconcile_username = reconcile_username
26
29
  self._logon_username = logon_username
27
30
  self._logging = logging
@@ -31,13 +34,17 @@ class Args:
31
34
  def action(self) -> str:
32
35
  return self._action
33
36
 
37
+ @property
38
+ def username(self) -> str:
39
+ return self._username
40
+
34
41
  @property
35
42
  def address(self) -> str:
36
43
  return self._address
37
44
 
38
45
  @property
39
- def username(self) -> str:
40
- return self._username
46
+ def port(self) -> str:
47
+ return self._port
41
48
 
42
49
  @property
43
50
  def reconcile_username(self) -> str:
@@ -10,8 +10,9 @@ class NETHelper:
10
10
  def set(
11
11
  cls,
12
12
  action: str = "",
13
- address: str = "",
14
13
  username: str = "",
14
+ address: str = "",
15
+ port: str = "",
15
16
  logon_username: str = "",
16
17
  reconcile_username: str = "",
17
18
  logging: str = "",
@@ -23,8 +24,9 @@ class NETHelper:
23
24
  ) -> None:
24
25
  _args = [
25
26
  action,
26
- address,
27
27
  username,
28
+ address,
29
+ port,
28
30
  logon_username,
29
31
  reconcile_username,
30
32
  logging,
@@ -5,6 +5,9 @@ class Secret:
5
5
  def __init__(self, secret: str) -> None:
6
6
  self._secret = secret
7
7
 
8
+ def __bool__(self) -> bool:
9
+ return bool(self._secret)
10
+
8
11
  def get(self) -> str:
9
12
  if Crypto.ENABLED and self._secret:
10
13
  return Crypto.decrypt(self._secret)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python4cpm
3
- Version: 1.0.23
3
+ Version: 1.0.25
4
4
  Summary: Python for CPM
5
5
  Author-email: Gonzalo Atienza Rela <gonatienza@gmail.com>
6
6
  License-Expression: MIT
@@ -68,8 +68,9 @@ class MyRotator(Python4CPMHandler): # create a subclass for the Handler
68
68
  These are the usable properties and methods from Python4CPMHandler:
69
69
 
70
70
  self.args.action # action requested from CPM/SRS
71
- self.args.address # address from the account address field
72
71
  self.args.username # username from the account username field
72
+ self.args.address # address from the account address field
73
+ self.args.port # port from the account port field
73
74
  self.args.reconcile_username # reconcile username from the linked reconcile account
74
75
  self.args.logon_username # logon username from the linked logon account
75
76
  self.args.logging # used to carry the platform logging settings for python
@@ -131,7 +132,7 @@ class MyRotator(Python4CPMHandler): # create a subclass for the Handler
131
132
  def _verify(self, from_reconcile=False):
132
133
  if from_reconcile is False:
133
134
  pass
134
- # TODO: use self.args.address, self.args.username, self.secrets.password.get()
135
+ # TODO: use self.args.username, self.args.address, self.args.port, self.secrets.password.get()
135
136
  # for your logic in a verification
136
137
  else:
137
138
  pass
@@ -147,11 +148,11 @@ class MyRotator(Python4CPMHandler): # create a subclass for the Handler
147
148
  def _change(self, from_reconcile=False):
148
149
  if from_reconcile is False:
149
150
  pass
150
- # TODO: use self.args.address, self.args.username, self.secrets.password.get()
151
+ # TODO: use self.args.username, self.args.address, self.args.port, self.secrets.password.get()
151
152
  # and self.secrets.new_password.get() for your logic in a rotation
152
153
  else:
153
154
  pass
154
- # TODO: use self.args.address, self.args.username, self.args.reconcile_username,
155
+ # TODO: use self.args.username, self.args.address, self.args.port, self.args.reconcile_username,
155
156
  # self.secrets.reconcile_password.get() and self.secrets.new_password.get() for your logic in a reconciliation
156
157
  result = True
157
158
  if result is True:
@@ -187,8 +188,9 @@ p4cpm = Python4CPM("MyApp") # this instantiates the object and grabs all argumen
187
188
 
188
189
  # These are the usable properties and related methods from the object:
189
190
  p4cpm.args.action # action requested from CPM/SRS
190
- p4cpm.args.address # address from the account address field
191
191
  p4cpm.args.username # username from the account username field
192
+ p4cpm.args.address # address from the account address field
193
+ p4cpm.args.port # port from the account port field
192
194
  p4cpm.args.reconcile_username # reconcile username from the linked reconcile account
193
195
  p4cpm.args.logon_username # logon username from the linked logon account
194
196
  p4cpm.args.logging # used to carry the platform logging settings for python
@@ -215,11 +217,11 @@ p4cpm.log_debug("this is an debug message") # logs info into Logs/ThirdParty/MyA
215
217
  def verify(from_reconcile=False):
216
218
  if from_reconcile is False:
217
219
  pass
218
- # TODO: use p4cpm.args.address, p4cpm.args.username, p4cpm.secrets.password.get()
220
+ # TODO: use p4cpm.args.username, p4cpm.args.address, p4cpm.args.port, p4cpm.secrets.password.get()
219
221
  # for your logic in a verification
220
222
  else:
221
223
  pass
222
- # TODO: use p4cpm.args.address, p4cpm.args.reconcile_username, p4cpm.secrets.reconcile_password.get()
224
+ # TODO: use p4cpm.args.address, p4cpm.args.port, p4cpm.args.reconcile_username, p4cpm.secrets.reconcile_password.get()
223
225
  # for your logic in a verification
224
226
  result = True
225
227
  if result is True:
@@ -233,11 +235,11 @@ def verify(from_reconcile=False):
233
235
  def change(from_reconcile=False):
234
236
  if from_reconcile is False:
235
237
  pass
236
- # TODO: use p4cpm.args.address, p4cpm.args.username, p4cpm.secrets.password.get()
238
+ # TODO: use p4cpm.args.username, p4cpm.args.address, p4cpm.args.port, p4cpm.secrets.password.get()
237
239
  # and p4cpm.secrets.new_password.get() for your logic in a rotation
238
240
  else:
239
241
  pass
240
- # TODO: use p4cpm.args.address, p4cpm.args.username, p4cpm.args.reconcile_username,
242
+ # TODO: use p4cpm.args.username, p4cpm.args.address, p4cpm.args.port, p4cpm.args.reconcile_username,
241
243
  # p4cpm.secrets.reconcile_password.get() and p4cpm.secrets.new_password.get() for your logic in a reconciliation
242
244
  result = True
243
245
  if result is True:
@@ -323,8 +325,9 @@ new_password = getpass("new_password: ") # new password for the rotation
323
325
 
324
326
  NETHelper.set(
325
327
  action=Python4CPM.ACTION_LOGON, # use actions from Python4CPM.ACTION_*
326
- address="myapp.corp.local", # populate with the address from your account properties
327
328
  username="jdoe", # populate with the username from your account properties
329
+ address="myapp.corp.local", # populate with the address from your account properties
330
+ port="8443", # populate with the port from your account properties
328
331
  logon_username="ldoe", # populate with the logon account username from your linked logon account
329
332
  reconcile_username="rdoe", # ppopulate with the reconcile account username from your linked logon account
330
333
  logging="yes", # populate with the PythonLogging parameter from the platform: "yes" or "no"
File without changes
File without changes