Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F555022
AlmanacManagementUntrustKeyWorkflow.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
AlmanacManagementUntrustKeyWorkflow.php
View Options
<?php
final
class
AlmanacManagementUntrustKeyWorkflow
extends
AlmanacManagementWorkflow
{
protected
function
didConstruct
()
{
$this
->
setName
(
'untrust-key'
)
->
setSynopsis
(
pht
(
'Revoke trust of a public key.'
))
->
setArguments
(
array
(
array
(
'name'
=>
'id'
,
'param'
=>
'id'
,
'help'
=>
pht
(
'ID of the key to revoke trust for.'
),
),
));
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$console
=
PhutilConsole
::
getConsole
();
$id
=
$args
->
getArg
(
'id'
);
if
(!
$id
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Specify a public key to revoke trust for with --id.'
));
}
$key
=
id
(
new
PhabricatorAuthSSHKeyQuery
())
->
setViewer
(
$this
->
getViewer
())
->
withIDs
(
array
(
$id
))
->
executeOne
();
if
(!
$key
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'No public key exists with ID "%s".'
,
$id
));
}
if
(!
$key
->
getIsTrusted
())
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Public key with ID %s is not trusted.'
,
$id
));
}
$key
->
setIsTrusted
(
0
);
$key
->
save
();
PhabricatorAuthSSHKeyQuery
::
deleteSSHKeyCache
();
$console
->
writeOut
(
"**<bg:green> %s </bg>** %s
\n
"
,
pht
(
'TRUST REVOKED'
),
pht
(
'Trust has been revoked for public key %s.'
,
$id
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 6:21 PM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
110778
Default Alt Text
AlmanacManagementUntrustKeyWorkflow.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment