Skip to content

register_opentdf_config async

register_opentdf_config(
    network_id: NetworkId,
    client_id: GenericString,
    client_secret: SensitiveString,
    domain: GenericString,
    provider: GenericString,
    *,
    config_overrides: Optional[AsyncWickrClientConfig] = None,
    dry_run: Optional[bool] = None,
) -> RegisterOpentdfConfigResponse

Registers and saves OpenTDF configuration for a Wickr network, enabling attribute-based access control for Wickr through an OpenTDF provider.

Parameters:

  • network_id (NetworkId) –

    The ID of the Wickr network for which OpenTDF integration will be configured.

  • client_id (GenericString) –

    The OIDC client ID used for authenticating with the OpenTDF provider.

  • client_secret (SensitiveString) –

    The OIDC client secret used for authenticating with the OpenTDF provider

  • domain (GenericString) –

    The domain of the OpenTDF server.

  • provider (GenericString) –

    The provider of the OpenTDF platform.

    Currently only Virtru is supported as the OpenTDF provider.

  • dry_run (Optional[bool], default: None ) –

    Perform dry-run test connection of OpenTDF configuration (optional).

Raises:

  • BadRequestError –

    The request was invalid or malformed. This error occurs when the request parameters do not meet the API requirements, such as invalid field values, missing required parameters, or improperly formatted data.

  • ForbiddenError –

    Access to the requested resource is forbidden. This error occurs when the authenticated user does not have the necessary permissions to perform the requested operation, even though they are authenticated.

  • InternalServerError –

    An unexpected error occurred on the server while processing the request. This indicates a problem with the Wickr service itself rather than with the request. If this error persists, contact Amazon Web Services Support.

  • RateLimitError –

    The request was throttled because too many requests were sent in a short period of time. Wait a moment and retry the request. Consider implementing exponential backoff in your application.

  • ResourceNotFoundError –

    The requested resource could not be found. This error occurs when you try to access or modify a network, user, bot, security group, or other resource that doesn't exist or has been deleted.

  • UnauthorizedError –

    The request was not authenticated or the authentication credentials were invalid. This error occurs when the request lacks valid authentication credentials or the credentials have expired.

  • ValidationError –

    One or more fields in the request failed validation. This error provides detailed information about which fields were invalid and why, allowing you to correct the request and retry.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Save OpenTDF config successfully

>>> await client.register_opentdf_config(network_id='12345678', client_id='client123', client_secret='secret456', domain='https://api.sample.com', provider='virtru')
Dry run saving OpenTDF config
>>> await client.register_opentdf_config(network_id='12345678', client_id='client123', client_secret='secret456', domain='https://api.sample.com', provider='virtru', dry_run=True)
Dry run saving OpenTDF config - failed test
>>> await client.register_opentdf_config(network_id='12345678', client_id='client123', client_secret='secret456', domain='https://api.sample.com', provider='virtru', dry_run=True)
Save OpenTDF config - invalid provider
>>> await client.register_opentdf_config(network_id='12345678', client_id='client123', client_secret='secret456', domain='https://api.sample.com', provider='invalid provider')
Save OpenTDF config - network not found
>>> await client.register_opentdf_config(network_id='99999999', client_id='client123', client_secret='secret456', domain='https://api.sample.com', provider='virtru')
Source code in docs_src/capo_wickr/_services/async_wickr.py
async def register_opentdf_config(
    self,
    network_id: "capo_wickr.types.network_id.NetworkId",
    client_id: "capo_wickr.types.generic_string.GenericString",
    client_secret: "capo_wickr.types.sensitive_string.SensitiveString",
    domain: "capo_wickr.types.generic_string.GenericString",
    provider: "capo_wickr.types.generic_string.GenericString",
    *,
    config_overrides: Optional[AsyncWickrClientConfig] = None,
    dry_run: Optional[bool] = None,
) -> "capo_wickr.types.register_opentdf_config_response.RegisterOpentdfConfigResponse":
    """<p>Registers and saves OpenTDF configuration for a Wickr network, enabling attribute-based access control for Wickr through an OpenTDF provider.</p>

    Args:
        network_id: <p>The ID of the Wickr network for which OpenTDF integration will be configured.</p>
        client_id: <p>The OIDC client ID used for authenticating with the OpenTDF provider.</p>
        client_secret: <p>The OIDC client secret used for authenticating with the OpenTDF provider</p>
        domain: <p>The domain of the OpenTDF server.</p>
        provider: <p>The provider of the OpenTDF platform.</p> <note> <p>Currently only Virtru is supported as the OpenTDF provider.</p> </note>
        dry_run: <p>Perform dry-run test connection of OpenTDF configuration (optional).</p>

    Raises:
        capo_wickr.errors.bad_request_error.BadRequestError: <p>The request was invalid or malformed. This error occurs when the request parameters do not meet the API requirements, such as invalid field values, missing required parameters, or improperly formatted data.</p>
        capo_wickr.errors.forbidden_error.ForbiddenError: <p>Access to the requested resource is forbidden. This error occurs when the authenticated user does not have the necessary permissions to perform the requested operation, even though they are authenticated.</p>
        capo_wickr.errors.internal_server_error.InternalServerError: <p>An unexpected error occurred on the server while processing the request. This indicates a problem with the Wickr service itself rather than with the request. If this error persists, contact Amazon Web Services Support.</p>
        capo_wickr.errors.rate_limit_error.RateLimitError: <p>The request was throttled because too many requests were sent in a short period of time. Wait a moment and retry the request. Consider implementing exponential backoff in your application.</p>
        capo_wickr.errors.resource_not_found_error.ResourceNotFoundError: <p>The requested resource could not be found. This error occurs when you try to access or modify a network, user, bot, security group, or other resource that doesn't exist or has been deleted.</p>
        capo_wickr.errors.unauthorized_error.UnauthorizedError: <p>The request was not authenticated or the authentication credentials were invalid. This error occurs when the request lacks valid authentication credentials or the credentials have expired.</p>
        capo_wickr.errors.validation_error.ValidationError: <p>One or more fields in the request failed validation. This error provides detailed information about which fields were invalid and why, allowing you to correct the request and retry.</p>
        capo_wickr.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Save OpenTDF config successfully

        >>> await client.register_opentdf_config(network_id='12345678', client_id='client123', client_secret='secret456', domain='https://api.sample.com', provider='virtru')
        Dry run saving OpenTDF config

        >>> await client.register_opentdf_config(network_id='12345678', client_id='client123', client_secret='secret456', domain='https://api.sample.com', provider='virtru', dry_run=True)
        Dry run saving OpenTDF config - failed test

        >>> await client.register_opentdf_config(network_id='12345678', client_id='client123', client_secret='secret456', domain='https://api.sample.com', provider='virtru', dry_run=True)
        Save OpenTDF config - invalid provider

        >>> await client.register_opentdf_config(network_id='12345678', client_id='client123', client_secret='secret456', domain='https://api.sample.com', provider='invalid provider')
        Save OpenTDF config - network not found

        >>> await client.register_opentdf_config(network_id='99999999', client_id='client123', client_secret='secret456', domain='https://api.sample.com', provider='virtru')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_wickr.types.register_opentdf_config_request.RegisterOpentdfConfigRequest]",
    ) -> AsyncOperationResponse[
        "capo_wickr.types.register_opentdf_config_response.RegisterOpentdfConfigResponse"
    ]:
        import capo_wickr._operations.wickr_admin_api.register_opentdf_config

        (
            output,
            http_response,
        ) = await capo_wickr._operations.wickr_admin_api.register_opentdf_config.async_register_opentdf_config(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_wickr.types.register_opentdf_config_request.RegisterOpentdfConfigRequest",
    ) -> dict[str, Any]:
        import capo_wickr.types.register_opentdf_config_request

        return capo_wickr.types.register_opentdf_config_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_wickr.types.register_opentdf_config_response.RegisterOpentdfConfigResponse",
    ) -> dict[str, Any]:
        import capo_wickr.types.register_opentdf_config_response

        return capo_wickr.types.register_opentdf_config_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "RegisterOpentdfConfig",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_wickr.types.register_opentdf_config_request.RegisterOpentdfConfigRequest = {
        "network_id": network_id,
        "client_id": client_id,
        "client_secret": client_secret,
        "domain": domain,
        "provider": provider,
    }
    if dry_run is not None:
        input_["dry_run"] = dry_run

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output