Page MenuHomePhabricator

Support Conduit tokens in ConduitClient
ClosedPublic

Authored by epriestley on Dec 12 2014, 11:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 25, 10:16 AM
Unknown Object (File)
Sat, Nov 25, 9:59 AM
Unknown Object (File)
Sat, Nov 25, 12:01 AM
Unknown Object (File)
Wed, Nov 15, 11:53 AM
Unknown Object (File)
Oct 29 2023, 11:58 PM
Unknown Object (File)
Oct 24 2023, 2:25 AM
Unknown Object (File)
Oct 22 2023, 9:54 AM
Unknown Object (File)
Oct 21 2023, 3:42 AM
Subscribers

Details

Summary

Ref T5955. Allow ConduitClient to use simple token-based authentication.

Test Plan
$ cat conduit.php 
<?php

require_once 'scripts/__init_script__.php';

$args = new PhutilArgumentParser($argv);
$args->parseStandardArguments();

$result = id(new ConduitClient('http://local.phacility.com'))
  ->setConduitToken('api-6br7udiaydzjxorsr4ooggtzissh')
  ->callMethodSynchronous('user.whoami', array());

var_dump($result);
$ php -f conduit.php -- --trace
>>> [0] <conduit> user.whoami() <bytes = 117>
>>> [1] <http> http://local.phacility.com/api/user.whoami
<<< [1] <http> 216,804 us
<<< [0] <conduit> 217,307 us
array(6) {
  ["phid"]=>
  string(30) "PHID-USER-cvfydnwadpdj7vdon36z"
  ["userName"]=>
  string(5) "admin"
  ["realName"]=>
  string(4) "asdf"
  ["image"]=>
  string(85) "http://local.phacility.com/res/1410737307T/phabricator/3eb28cd9/rsrc/image/avatar.png"
  ["uri"]=>
  string(35) "http://local.phacility.com/p/admin/"
  ["roles"]=>
  array(4) {
    [0]=>
    string(5) "admin"
    [1]=>
    string(8) "verified"
    [2]=>
    string(8) "approved"
    [3]=>
    string(9) "activated"
  }
}

Diff Detail

Repository
rPHU libphutil
Branch
cond
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 3255
Build 3261: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

epriestley retitled this revision from to Support Conduit tokens in ConduitClient.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
btrahan edited edge metadata.
This revision is now accepted and ready to land.Dec 15 2014, 6:43 PM
This revision was automatically updated to reflect the committed changes.