Secret Views
Secret API views.
Their responses are built from smarter.apps.secret.contract.models.SecretApiSecret, a
Secret’s metadata without its value, which the Smarter api’s OpenAPI document publishes.
- class smarter.apps.secret.api.v1.views.SecretListView(*args, **kwargs)[source]
Bases:
ContractListMixin,SmarterAdminListAPIViewClass for secret list views.
- contract_model
alias of
SecretApiSecret
- dispatch(request, *args, **kwargs)[source]
Dispatch the request, and log it.
- Parameters:
request (
HttpRequest) – The request.- Returns:
The response, or
403when the request has no user, which makes an admin decorator raise AttributeError.
- serializer_class
alias of
SecretSerializer
- class smarter.apps.secret.api.v1.views.SecretView(*args, **kwargs)[source]
Bases:
SmarterAdminAPIViewClass for secret views.
- get(request, secret_id, *args, **kwargs)[source]
Return the Secret, without its value.
- Parameters:
request (
Request) – The request.secret_id (
int) – The Secret’s id, from the url.
- Returns:
The Secret, as a
SecretApiSecret.- Raises:
Http404 – when no Secret of the user’s accounts has this id.
- post(request, secret_id, *args, **kwargs)[source]
Same as get().
Smarter detail views are also served by POST.
- serializer_class
alias of
SecretSerializer