Class: Spree::Api::V3::Admin::ApiKeySerializer
- Inherits:
-
BaseSerializer
- Object
- BaseSerializer
- Spree::Api::V3::Admin::ApiKeySerializer
- Defined in:
- app/serializers/spree/api/v3/admin/api_key_serializer.rb
Overview
Admin API serializer for Spree::ApiKey.
Never exposes ‘token` or `token_digest` — only the 12-char `token_prefix` (e.g. `sk_abc123def`) so existing keys can be identified in the UI without leaking material that would let an attacker make requests. The full plaintext token is delivered exactly once, as the response body of `POST /api/v3/admin/api_keys`, via #plaintext_token below — it is `nil` everywhere else.
Method Summary
Methods inherited from BaseSerializer
#current_currency, #current_locale, #current_store, #current_user, #expand?, #expands, #nested_expands_for, #nested_params