diaspora-event-sdk 0.2.1__py3-none-any.whl → 0.2.2__py3-none-any.whl

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.
@@ -37,7 +37,7 @@ class Client:
37
37
  @requires_login
38
38
  def create_key(self):
39
39
  """
40
- Invalidate previous keys (if any) and generate a new one
40
+ Revokes existing keys, generates a new key, and updates the token storage with the newly created key and the Diaspora endpoint.
41
41
  """
42
42
  resp = self.web_client.create_key(self.subject_openid)
43
43
  if resp["status"] == "error":
@@ -70,7 +70,7 @@ class Client:
70
70
  @requires_login
71
71
  def retrieve_key(self):
72
72
  """
73
- Attempt to retrieve the key from local token storage, and call create_key if local key is not found
73
+ Retrieves the key from local token storage, and calls create_key() if the local key is not found.
74
74
  """
75
75
  tokens = self.login_manager._token_storage.get_token_data(
76
76
  DIASPORA_RESOURCE_SERVER
@@ -114,85 +114,85 @@ class Client:
114
114
  @requires_login
115
115
  def list_topics(self):
116
116
  """
117
- Retrieves the list of topics associated with the user's OpenID.
117
+ Returns a list of topics currently registered under the user's account.
118
118
  """
119
119
  return self.web_client.list_topics(self.subject_openid)
120
120
 
121
121
  @requires_login
122
122
  def register_topic(self, topic):
123
123
  """
124
- Registers a new topic under the user's OpenID.
124
+ Registers a new topic the user's account with permissions to read, write, and describe the topic.
125
125
  """
126
126
  return self.web_client.register_topic(self.subject_openid, topic, "register")
127
127
 
128
128
  @requires_login
129
129
  def unregister_topic(self, topic):
130
130
  """
131
- Unregisters a topic from the user's OpenID.
131
+ Unregisters a topic from a user's account, but all existing events within the topic are unaffected.
132
132
  """
133
133
  return self.web_client.register_topic(self.subject_openid, topic, "unregister")
134
134
 
135
135
  @requires_login
136
136
  def get_topic_configs(self, topic):
137
137
  """
138
- Get topic configurations.
138
+ Retrieves the current configurations for a registered topic.
139
139
  """
140
140
  return self.web_client.get_topic_configs(self.subject_openid, topic)
141
141
 
142
142
  @requires_login
143
143
  def update_topic_configs(self, topic, configs):
144
144
  """
145
- Set topic configurations.
145
+ Updates the configurations for a registered topic.
146
146
  """
147
147
  return self.web_client.update_topic_configs(self.subject_openid, topic, configs)
148
148
 
149
149
  @requires_login
150
150
  def update_topic_partitions(self, topic, new_partitions):
151
151
  """
152
- Adjust topic number of partitions
152
+ Increases the number of partitions for a given topic to the specified new partition count.
153
153
  """
154
154
  return self.web_client.update_topic_partitions(self.subject_openid, topic, new_partitions)
155
155
 
156
156
  @requires_login
157
157
  def grant_user_access(self, topic, user):
158
158
  """
159
- Registers a new topic under the user's OpenID.
159
+ Authorizes another user to access a registered topic under the invoker's account.
160
160
  """
161
161
  return self.web_client.grant_user_access(self.subject_openid, topic, user, "grant")
162
162
 
163
163
  @requires_login
164
164
  def revoke_user_access(self, topic, user):
165
165
  """
166
- Unregisters a topic from the user's OpenID.
166
+ Removes access permissions for another user from a registered topic under the invoker's account.
167
167
  """
168
168
  return self.web_client.grant_user_access(self.subject_openid, topic, user, "revoke")
169
169
 
170
170
  @requires_login
171
171
  def list_triggers(self):
172
172
  """
173
- Retrieves the list of functions associated with the user's OpenID.
173
+ Retrieves a list of triggers associated created under the user's account, showing each trigger's configurations and UUID.
174
174
  """
175
175
  return self.web_client.list_triggers(self.subject_openid)
176
176
 
177
177
  @requires_login
178
178
  def create_trigger(self, topic, function, function_configs, trigger_configs):
179
179
  """
180
- Registers a new functions under the user's OpenID.
180
+ Creates a new trigger under the user's account with specific function and invocation configurations.
181
181
  """
182
- return self.web_client.create_trigger(self.subject_openid, topic, function, "create",
183
- function_configs, trigger_configs)
182
+ return self.web_client.create_trigger(
183
+ self.subject_openid, topic, function, "create", function_configs, trigger_configs)
184
184
 
185
185
  @requires_login
186
186
  def delete_trigger(self, topic, function):
187
187
  """
188
- Unregisters a functions from the user's OpenID.
188
+ Deletes a trigger and related AWS resources, while the associated topic remains unaffected.
189
189
  """
190
- return self.web_client.create_trigger(self.subject_openid, topic, function, "delete",
191
- {}, {})
190
+ return self.web_client.create_trigger(
191
+ self.subject_openid, topic, function, "delete", {}, {})
192
192
 
193
193
  @requires_login
194
194
  def update_trigger(self, trigger_uuid, trigger_configs):
195
195
  """
196
- Update a functions's trigger'.
196
+ Updates invocation configurations of an existing trigger, identified by its unique trigger UUID.
197
197
  """
198
198
  return self.web_client.update_trigger(self.subject_openid, trigger_uuid, trigger_configs)
@@ -33,7 +33,8 @@ class WebClient(globus_sdk.BaseClient):
33
33
  self, subject: UUID_LIKE_T, topic: str, action: str
34
34
  ) -> globus_sdk.GlobusHTTPResponse:
35
35
  return self.put(
36
- f"/api/v2/topic/{topic}", headers={"Subject": str(subject), "Action": action}
36
+ f"/api/v2/topic/{topic}",
37
+ headers={"Subject": str(subject), "Action": action}
37
38
  )
38
39
 
39
40
  def get_topic_configs(
@@ -41,8 +42,7 @@ class WebClient(globus_sdk.BaseClient):
41
42
  ) -> globus_sdk.GlobusHTTPResponse:
42
43
  return self.get(
43
44
  f"/api/v2/topic/{topic}",
44
- headers={"Subject": str(subject), "Topic": topic},
45
- # data=json.dumps(configs).encode("utf-8")
45
+ headers={"Subject": str(subject), "Topic": topic}
46
46
  )
47
47
 
48
48
  def update_topic_configs(
@@ -61,7 +61,7 @@ class WebClient(globus_sdk.BaseClient):
61
61
  return self.post(
62
62
  f"/api/v2/topic/{topic}/partitions",
63
63
  headers={"Subject": str(subject), "Topic": topic,
64
- "NewPartitions": str(new_partitions)},
64
+ "NewPartitions": str(new_partitions)}
65
65
  )
66
66
 
67
67
  def grant_user_access(
@@ -1 +1 @@
1
- __version__ = "0.2.1"
1
+ __version__ = "0.2.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: diaspora-event-sdk
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: SDK of Diaspora Event Fabric: Resilience-enabling services for science from HPC to edge
5
5
  Home-page: https://github.com/globus-labs/diaspora-event-sdk
6
6
  License: LICENSE
@@ -1,11 +1,11 @@
1
1
  diaspora_event_sdk/__init__.py,sha256=v8IN3-WFpliakQKru8TAcmQ4IRdvRe_m9-abSDnGIFM,457
2
- diaspora_event_sdk/version.py,sha256=HfjVOrpTnmZ-xVFCYSVmX50EXaBQeJteUHG-PD6iQs8,22
2
+ diaspora_event_sdk/version.py,sha256=m6kyaNpwBcP1XYcqrelX2oS3PJuOnElOcRdBa9pEb8c,22
3
3
  diaspora_event_sdk/sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  diaspora_event_sdk/sdk/_environments.py,sha256=QyQA7dV4goUKUoxAoaes8OGv0xKxz2qiFBHNGr-vQNA,204
5
- diaspora_event_sdk/sdk/client.py,sha256=z3GT9k3gJUkoT3b2LactWnSIBIJQ6zfp6gOL7z9bIuw,6964
5
+ diaspora_event_sdk/sdk/client.py,sha256=hsnlG8dheTSLhWgfrsvnw3xw8QQKQXuqnBoTEXOm218,7503
6
6
  diaspora_event_sdk/sdk/decorators.py,sha256=Gel8AyhIjbf4-FNintTNcOqvC9hHH_YwbOH257Nfmf0,884
7
7
  diaspora_event_sdk/sdk/kafka_client.py,sha256=G1kQQz2TWlahdd2TDdpvaQW7HD7gsuQCnr0tks54ISw,4361
8
- diaspora_event_sdk/sdk/web_client.py,sha256=gU7XflHXkNwz017qqhX9Dc-Z-EDNTgmLO30KG8pPCkw,3724
8
+ diaspora_event_sdk/sdk/web_client.py,sha256=5GWp9vjM79MJdfeP-JnMGgIJfQEalDN2J4qEK4LIkJg,3679
9
9
  diaspora_event_sdk/sdk/login_manager/__init__.py,sha256=yeqVgjeHLMX0WZJu2feJmq-fbeXvSxWghVV81ygfY-w,239
10
10
  diaspora_event_sdk/sdk/login_manager/client_login.py,sha256=8ild28_cgPSrLtg3Jhmzpg3EymAvH2UdAhKY52oOB_c,1835
11
11
  diaspora_event_sdk/sdk/login_manager/decorators.py,sha256=EFEp71d0oJ7vo2H8W7DJ2gPrDfGzeNXUNxri1C0l8h0,1047
@@ -18,8 +18,8 @@ diaspora_event_sdk/sdk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
18
18
  diaspora_event_sdk/sdk/utils/uuid_like.py,sha256=xbxf0YXpDhdii16lwPLWRN21qFekHrNrqODSToMPtCg,470
19
19
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  tests/unit/test_client.py,sha256=sJUtPmnNGnohnP38RQrwcJ4D5j3-g1WFQ6gaKf520AQ,3019
21
- diaspora_event_sdk-0.2.1.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
22
- diaspora_event_sdk-0.2.1.dist-info/METADATA,sha256=nnSC7OK1sDESBpFe177-b5O_DK3qz-HRuBpeFNraAgg,2505
23
- diaspora_event_sdk-0.2.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
24
- diaspora_event_sdk-0.2.1.dist-info/top_level.txt,sha256=OVun-67t3fkLFEIwvJuNINgFFvAc--bClYhXjLhMmvs,25
25
- diaspora_event_sdk-0.2.1.dist-info/RECORD,,
21
+ diaspora_event_sdk-0.2.2.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
22
+ diaspora_event_sdk-0.2.2.dist-info/METADATA,sha256=OkO4eq9tmvIM_0W0sqG7zrL-lpRlrrkON6brr2D4LCc,2505
23
+ diaspora_event_sdk-0.2.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
24
+ diaspora_event_sdk-0.2.2.dist-info/top_level.txt,sha256=OVun-67t3fkLFEIwvJuNINgFFvAc--bClYhXjLhMmvs,25
25
+ diaspora_event_sdk-0.2.2.dist-info/RECORD,,