Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93924357
PhabricatorAuthConduitTokenRevoker.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Dec 2, 13:31
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Dec 4, 13:31 (2 d)
Engine
blob
Format
Raw Data
Handle
22723566
Attached To
rPH Phabricator
PhabricatorAuthConduitTokenRevoker.php
View Options
<?php
final
class
PhabricatorAuthConduitTokenRevoker
extends
PhabricatorAuthRevoker
{
const
REVOKERKEY
=
'conduit'
;
public
function
getRevokerName
()
{
return
pht
(
'Conduit API Tokens'
);
}
public
function
getRevokerDescription
()
{
return
pht
(
"Revokes all Conduit API tokens used to access the API.
\n\n
"
.
"Users will need to use `arc install-certificate` to install new "
.
"API tokens before `arc` commands will work. Bots and scripts which "
.
"access the API will need to have new tokens generated and "
.
"installed."
);
}
public
function
revokeAllCredentials
()
{
$table
=
id
(
new
PhabricatorConduitToken
());
$conn
=
$table
->
establishConnection
(
'w'
);
queryfx
(
$conn
,
'DELETE FROM %T'
,
$table
->
getTableName
());
return
$conn
->
getAffectedRows
();
}
public
function
revokeCredentialsFrom
(
$object
)
{
$table
=
id
(
new
PhabricatorConduitToken
());
$conn
=
$table
->
establishConnection
(
'w'
);
queryfx
(
$conn
,
'DELETE FROM %T WHERE objectPHID = %s'
,
$table
->
getTableName
(),
$object
->
getPHID
());
return
$conn
->
getAffectedRows
();
}
}
Event Timeline
Log In to Comment