Skip to content

Commit c1c8c0e

Browse files
authored
feat(webhosting): use password in base64 (#974)
1 parent 9e488b6 commit c1c8c0e

File tree

4 files changed

+54
-10
lines changed

4 files changed

+54
-10
lines changed

scaleway-async/scaleway_async/webhosting/v1/marshalling.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,12 @@ def unmarshal_HostingUser(data: Any) -> HostingUser:
450450
else:
451451
args["one_time_password"] = None
452452

453+
field = data.get("one_time_password_b64", None)
454+
if field is not None:
455+
args["one_time_password_b64"] = field
456+
else:
457+
args["one_time_password_b64"] = None
458+
453459
return HostingUser(**args)
454460

455461

@@ -913,9 +919,15 @@ def unmarshal_ResetHostingPasswordResponse(data: Any) -> ResetHostingPasswordRes
913919

914920
args: Dict[str, Any] = {}
915921

922+
field = data.get("one_time_password_b64", None)
923+
if field is not None:
924+
args["one_time_password_b64"] = field
925+
916926
field = data.get("one_time_password", None)
917927
if field is not None:
918928
args["one_time_password"] = field
929+
else:
930+
args["one_time_password"] = None
919931

920932
return ResetHostingPasswordResponse(**args)
921933

scaleway-async/scaleway_async/webhosting/v1/types.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ class PlatformControlPanel:
296296

297297
urls: Optional[PlatformControlPanelUrls]
298298
"""
299-
URL to connect to cPanel dashboard and to Webmail interface.
299+
URL to connect to control panel dashboard and to Webmail interface.
300300
"""
301301

302302

@@ -426,7 +426,7 @@ class Nameserver:
426426
class HostingUser:
427427
username: str
428428
"""
429-
Main Web Hosting cPanel username.
429+
Main Web Hosting control panel username.
430430
"""
431431

432432
contact_email: str
@@ -436,7 +436,12 @@ class HostingUser:
436436

437437
one_time_password: Optional[str]
438438
"""
439-
One-time-password used for the first login or reset password, empty after first use.
439+
One-time-password used for the first login to the control panel, cleared after first use (deprecated, use password_b64 instead).
440+
"""
441+
442+
one_time_password_b64: Optional[str]
443+
"""
444+
One-time-password used for the first login to the control panel, cleared after first use, encoded in base64.
440445
"""
441446

442447

@@ -1789,9 +1794,14 @@ class OfferApiListOffersRequest:
17891794

17901795
@dataclass
17911796
class ResetHostingPasswordResponse:
1792-
one_time_password: str
1797+
one_time_password_b64: str
1798+
"""
1799+
New temporary password, encoded in base64.
1800+
"""
1801+
1802+
one_time_password: Optional[str]
17931803
"""
1794-
New temporary password.
1804+
New temporary password (deprecated, use password_b64 instead).
17951805
"""
17961806

17971807

scaleway/scaleway/webhosting/v1/marshalling.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,12 @@ def unmarshal_HostingUser(data: Any) -> HostingUser:
450450
else:
451451
args["one_time_password"] = None
452452

453+
field = data.get("one_time_password_b64", None)
454+
if field is not None:
455+
args["one_time_password_b64"] = field
456+
else:
457+
args["one_time_password_b64"] = None
458+
453459
return HostingUser(**args)
454460

455461

@@ -913,9 +919,15 @@ def unmarshal_ResetHostingPasswordResponse(data: Any) -> ResetHostingPasswordRes
913919

914920
args: Dict[str, Any] = {}
915921

922+
field = data.get("one_time_password_b64", None)
923+
if field is not None:
924+
args["one_time_password_b64"] = field
925+
916926
field = data.get("one_time_password", None)
917927
if field is not None:
918928
args["one_time_password"] = field
929+
else:
930+
args["one_time_password"] = None
919931

920932
return ResetHostingPasswordResponse(**args)
921933

scaleway/scaleway/webhosting/v1/types.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ class PlatformControlPanel:
296296

297297
urls: Optional[PlatformControlPanelUrls]
298298
"""
299-
URL to connect to cPanel dashboard and to Webmail interface.
299+
URL to connect to control panel dashboard and to Webmail interface.
300300
"""
301301

302302

@@ -426,7 +426,7 @@ class Nameserver:
426426
class HostingUser:
427427
username: str
428428
"""
429-
Main Web Hosting cPanel username.
429+
Main Web Hosting control panel username.
430430
"""
431431

432432
contact_email: str
@@ -436,7 +436,12 @@ class HostingUser:
436436

437437
one_time_password: Optional[str]
438438
"""
439-
One-time-password used for the first login or reset password, empty after first use.
439+
One-time-password used for the first login to the control panel, cleared after first use (deprecated, use password_b64 instead).
440+
"""
441+
442+
one_time_password_b64: Optional[str]
443+
"""
444+
One-time-password used for the first login to the control panel, cleared after first use, encoded in base64.
440445
"""
441446

442447

@@ -1789,9 +1794,14 @@ class OfferApiListOffersRequest:
17891794

17901795
@dataclass
17911796
class ResetHostingPasswordResponse:
1792-
one_time_password: str
1797+
one_time_password_b64: str
1798+
"""
1799+
New temporary password, encoded in base64.
1800+
"""
1801+
1802+
one_time_password: Optional[str]
17931803
"""
1794-
New temporary password.
1804+
New temporary password (deprecated, use password_b64 instead).
17951805
"""
17961806

17971807

0 commit comments

Comments
 (0)