anchor.diff:      ]).
   
   
  --type token() ::
  -    oauth1_credentials:id(token).
  +-type client() ::
  +    oauth1_credentials:id(client).
   
   -type realm() ::
       binary().
   
   -record(t,
  -    { token  :: token()
  +    { client :: client()
       , realms :: [realm()]
       }).
   
  
positive.code: -define(STORAGE_BUCKET, oauth1_config:get(storage_bucket_authorization)).
  
  
  -spec cons(token()) ->
      t().
  cons({token, <<_/binary>>}=Token) ->
      #t
      { token  = Token
      , realms = ordsets:new()
      }.
  
  
negative.code: -spec store(t()) ->
      hope_result:t(ok, oauth1_storage:error()).
  store(#t
      { client = {client, <<Client/binary>>}
      , realms = Realms
      }
  ) ->
      Key   = Client,
      Value = jsx:encode(Realms),
      oauth1_storage:put(?STORAGE_BUCKET, Key, Value).
  
  -spec fetch(client()) ->
      hope_result:t(t(), Error)
      when Error :: oauth1_storage:error()
                  | {data_format_invalid, Data :: binary()}
         .
  fetch({client, <<ClientID/binary>>}=Client) ->
      Key = ClientID,
      case oauth1_storage:get(?STORAGE_BUCKET, Key)
      of  {error, _}=Error ->
              Error
  