Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions sdk-endpoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ DELETE /api/v1/auth/session # dashboard-only
# flow. An SDK authenticates with the master key or an API key and never holds
# a password, so there is nothing here for one to wrap.
PUT /api/v1/auth/password # dashboard-only
# The name the signed-in identity goes by: the account page's own write, beside
# the credential ones. An SDK authenticates as a key rather than as a person and
# has no account page to render, so there is nothing here for one to wrap.
PATCH /api/v1/auth/profile # dashboard-only
# Signup, email verification, and password reset (otari#650): claiming a
# roster identity's dashboard login and recovering it, the same browser-only
# credential flow PUT /api/v1/auth/password is. No SDK caller holds a password.
Expand Down
2 changes: 2 additions & 0 deletions src/otari/_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@
"UpdateKeyRequest",
"UpdateMaintenanceModeRequest",
"UpdateOwnKeyRequest",
"UpdateProfileRequest",
"UpdateScopedBudgetRequest",
"UpdateSearchToolRequest",
"UpdateSettingsRequest",
Expand Down Expand Up @@ -1116,6 +1117,7 @@
from otari._client.models.update_key_request import UpdateKeyRequest as UpdateKeyRequest
from otari._client.models.update_maintenance_mode_request import UpdateMaintenanceModeRequest as UpdateMaintenanceModeRequest
from otari._client.models.update_own_key_request import UpdateOwnKeyRequest as UpdateOwnKeyRequest
from otari._client.models.update_profile_request import UpdateProfileRequest as UpdateProfileRequest
from otari._client.models.update_scoped_budget_request import UpdateScopedBudgetRequest as UpdateScopedBudgetRequest
from otari._client.models.update_search_tool_request import UpdateSearchToolRequest as UpdateSearchToolRequest
from otari._client.models.update_settings_request import UpdateSettingsRequest as UpdateSettingsRequest
Expand Down
280 changes: 280 additions & 0 deletions src/otari/_client/api/auth_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from uuid import UUID
from otari._client.models.authenticate_passkey_request import AuthenticatePasskeyRequest
from otari._client.models.authorize_response import AuthorizeResponse
from otari._client.models.caller_identity_public import CallerIdentityPublic
from otari._client.models.create_session_request import CreateSessionRequest
from otari._client.models.o_auth_callback_request import OAuthCallbackRequest
from otari._client.models.o_auth_session_response import OAuthSessionResponse
Expand All @@ -36,6 +37,7 @@
from otari._client.models.set_password_request import SetPasswordRequest
from otari._client.models.signup_request import SignupRequest
from otari._client.models.signup_response import SignupResponse
from otari._client.models.update_profile_request import UpdateProfileRequest
from otari._client.models.verify_email_request import VerifyEmailRequest
from otari._client.models.verify_email_response import VerifyEmailResponse
from otari._client.models.web_authn_credential_public import WebAuthnCredentialPublic
Expand Down Expand Up @@ -4361,6 +4363,284 @@ def _auth_signup_serialize(



@validate_call
def auth_update_own_profile(
self,
update_profile_request: UpdateProfileRequest,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> CallerIdentityPublic:
"""Update Own Profile

Change the name the caller is known by on this deployment. Always the caller's own identity. The same shape ``GET /api/v1/organizations/me`` carries as ``caller`` comes back, so a client can seat the answer where it read the old value rather than refetch the whole membership context.

:param update_profile_request: (required)
:type update_profile_request: UpdateProfileRequest
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._auth_update_own_profile_serialize(
update_profile_request=update_profile_request,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "CallerIdentityPublic",
'422': "HTTPValidationError",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data


@validate_call
def auth_update_own_profile_with_http_info(
self,
update_profile_request: UpdateProfileRequest,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[CallerIdentityPublic]:
"""Update Own Profile

Change the name the caller is known by on this deployment. Always the caller's own identity. The same shape ``GET /api/v1/organizations/me`` carries as ``caller`` comes back, so a client can seat the answer where it read the old value rather than refetch the whole membership context.

:param update_profile_request: (required)
:type update_profile_request: UpdateProfileRequest
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._auth_update_own_profile_serialize(
update_profile_request=update_profile_request,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "CallerIdentityPublic",
'422': "HTTPValidationError",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)


@validate_call
def auth_update_own_profile_without_preload_content(
self,
update_profile_request: UpdateProfileRequest,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Update Own Profile

Change the name the caller is known by on this deployment. Always the caller's own identity. The same shape ``GET /api/v1/organizations/me`` carries as ``caller`` comes back, so a client can seat the answer where it read the old value rather than refetch the whole membership context.

:param update_profile_request: (required)
:type update_profile_request: UpdateProfileRequest
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._auth_update_own_profile_serialize(
update_profile_request=update_profile_request,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "CallerIdentityPublic",
'422': "HTTPValidationError",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response


def _auth_update_own_profile_serialize(
self,
update_profile_request,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:

_host = None

_collection_formats: Dict[str, str] = {
}

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None

# process the path parameters
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
if update_profile_request is not None:
_body_params = update_profile_request


# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json'
]
)

# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
[
'application/json'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type

# authentication setting
_auth_settings: List[str] = [
'XApiKeyAuth',
'ApiKeyAuth'
]

return self.api_client.param_serialize(
method='PATCH',
resource_path='/api/v1/auth/profile',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)




@validate_call
def auth_verify_email_route(
self,
Expand Down
1 change: 1 addition & 0 deletions src/otari/_client/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@
from otari._client.models.update_key_request import UpdateKeyRequest
from otari._client.models.update_maintenance_mode_request import UpdateMaintenanceModeRequest
from otari._client.models.update_own_key_request import UpdateOwnKeyRequest
from otari._client.models.update_profile_request import UpdateProfileRequest
from otari._client.models.update_scoped_budget_request import UpdateScopedBudgetRequest
from otari._client.models.update_search_tool_request import UpdateSearchToolRequest
from otari._client.models.update_settings_request import UpdateSettingsRequest
Expand Down
Loading
Loading