canonicalwebteam.store-api 6.6.0__tar.gz → 6.7.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.
- {canonicalwebteam_store_api-6.6.0 → canonicalwebteam_store_api-6.7.0}/PKG-INFO +1 -1
- {canonicalwebteam_store_api-6.6.0 → canonicalwebteam_store_api-6.7.0}/canonicalwebteam/store_api/publishergw.py +23 -3
- {canonicalwebteam_store_api-6.6.0 → canonicalwebteam_store_api-6.7.0}/pyproject.toml +1 -1
- {canonicalwebteam_store_api-6.6.0 → canonicalwebteam_store_api-6.7.0}/LICENSE +0 -0
- {canonicalwebteam_store_api-6.6.0 → canonicalwebteam_store_api-6.7.0}/README.md +0 -0
- {canonicalwebteam_store_api-6.6.0 → canonicalwebteam_store_api-6.7.0}/canonicalwebteam/__init__.py +0 -0
- {canonicalwebteam_store_api-6.6.0 → canonicalwebteam_store_api-6.7.0}/canonicalwebteam/exceptions.py +0 -0
- {canonicalwebteam_store_api-6.6.0 → canonicalwebteam_store_api-6.7.0}/canonicalwebteam/store_api/__init__.py +0 -0
- {canonicalwebteam_store_api-6.6.0 → canonicalwebteam_store_api-6.7.0}/canonicalwebteam/store_api/base.py +0 -0
- {canonicalwebteam_store_api-6.6.0 → canonicalwebteam_store_api-6.7.0}/canonicalwebteam/store_api/dashboard.py +0 -0
- {canonicalwebteam_store_api-6.6.0 → canonicalwebteam_store_api-6.7.0}/canonicalwebteam/store_api/devicegw.py +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from os import getenv
|
|
2
|
-
from typing import Optional
|
|
2
|
+
from typing import Optional, Union
|
|
3
3
|
from requests import Session
|
|
4
4
|
|
|
5
5
|
from canonicalwebteam.store_api.base import Base
|
|
@@ -312,7 +312,7 @@ class PublisherGW(Base):
|
|
|
312
312
|
return self.process_response(response)
|
|
313
313
|
|
|
314
314
|
def unregister_package_name(
|
|
315
|
-
self, publisher_auth: str, package_name: str
|
|
315
|
+
self, publisher_auth: Union[str, dict], package_name: str
|
|
316
316
|
) -> dict:
|
|
317
317
|
"""
|
|
318
318
|
Unregister a package name.
|
|
@@ -328,9 +328,29 @@ class PublisherGW(Base):
|
|
|
328
328
|
Otherwise, returns an error list
|
|
329
329
|
"""
|
|
330
330
|
url = self.get_endpoint_url(package_name, has_name_space=True)
|
|
331
|
+
if self.name_space == "snap":
|
|
332
|
+
# for Snap packages, `unregister_package` uses SCA's API under the
|
|
333
|
+
# hood: this means we must pass the authorization header as if
|
|
334
|
+
# we were calling SCA
|
|
335
|
+
if not isinstance(publisher_auth, dict):
|
|
336
|
+
raise TypeError(
|
|
337
|
+
"Name space 'snap' requires a 'dict' as 'publisher_auth'"
|
|
338
|
+
)
|
|
339
|
+
authorization_header = dashboard_authorization_header(
|
|
340
|
+
publisher_auth
|
|
341
|
+
)
|
|
342
|
+
else:
|
|
343
|
+
if not isinstance(publisher_auth, str):
|
|
344
|
+
raise TypeError(
|
|
345
|
+
f"Name space '{self.name_space}' requires a 'str' as "
|
|
346
|
+
"'publisher_auth'"
|
|
347
|
+
)
|
|
348
|
+
authorization_header = self._get_authorization_header(
|
|
349
|
+
publisher_auth
|
|
350
|
+
)
|
|
331
351
|
response = self.session.delete(
|
|
332
352
|
url=url,
|
|
333
|
-
headers=
|
|
353
|
+
headers=authorization_header,
|
|
334
354
|
)
|
|
335
355
|
return response
|
|
336
356
|
|
|
File without changes
|
|
File without changes
|
{canonicalwebteam_store_api-6.6.0 → canonicalwebteam_store_api-6.7.0}/canonicalwebteam/__init__.py
RENAMED
|
File without changes
|
{canonicalwebteam_store_api-6.6.0 → canonicalwebteam_store_api-6.7.0}/canonicalwebteam/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|