anchor.diff:      catch
           error:_ -> error
       end.
  +
  +
  +%%%===================================================================
  +%%% Helpers
  +%%%===================================================================
  +
  +
  +%% @private
  +-spec create_session(od_user:id(), tokens:serialized()) -> binary().
  +create_session(UserId, AccessToken) ->
  +    Nonce = crypto:strong_rand_bytes(10),
  +    Identity = ?SUB(user, UserId),
  +    TokenCredentials = build_token_credentials(AccessToken, undefined, local_ip_v4(), oneclient, allow_data_access_caveats),
  +    {ok, SessionId} = create_fuse_session(Nonce, Identity, TokenCredentials),
  +    SessionId.
  +
  +
  +%% @private
  +-spec local_ip_v4() -> inet:ip_address().
  +local_ip_v4() ->
  +    {ok, Addrs} = inet:getifaddrs(),
  +    hd([
  +        Addr || {_, Opts} <- Addrs, {addr, Addr} <- Opts,
  +        size(Addr) == 4, Addr =/= {127, 0, 0, 1}
  +    ]).
  
positive.code:     get_cert_chain_ders/0,
      gs_protocol_supported_versions/0,
  
      perform_io_test/2
  ]).
  
  
  
negative.code:     rpc_api:storage_is_imported_storage(StorageId).
  
  
  -spec get_user_space_by_name(od_user:id(), od_space:name(), tokens:serialized()) ->
      {true, od_space:id()} | false.
  get_user_space_by_name(UserId, SpaceName, AccessToken) ->
      SessionId = create_session(UserId, AccessToken),
      user_logic:get_space_by_name(SessionId, UserId, SpaceName).
  
  
  -spec get_spaces() -> {ok, [od_space:id()]} | errors:error().
  