Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F958803
PhabricatorOAuthClientSecretController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
PhabricatorOAuthClientSecretController.php
View Options
<?php
final
class
PhabricatorOAuthClientSecretController
extends
PhabricatorOAuthClientController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$request
->
getUser
();
$client
=
id
(
new
PhabricatorOAuthServerClientQuery
())
->
setViewer
(
$viewer
)
->
withPHIDs
(
array
(
$this
->
getClientPHID
()))
->
requireCapabilities
(
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
))
->
executeOne
();
if
(!
$client
)
{
return
new
Aphront404Response
();
}
$view_uri
=
$client
->
getViewURI
();
$token
=
id
(
new
PhabricatorAuthSessionEngine
())->
requireHighSecuritySession
(
$viewer
,
$request
,
$view_uri
);
if
(
$request
->
isFormPost
())
{
$secret
=
$client
->
getSecret
();
$body
=
id
(
new
PHUIFormLayoutView
())
->
appendChild
(
id
(
new
AphrontFormTextAreaControl
())
->
setLabel
(
pht
(
'Plaintext'
))
->
setReadOnly
(
true
)
->
setHeight
(
AphrontFormTextAreaControl
::
HEIGHT_VERY_SHORT
)
->
setValue
(
$secret
));
$dialog
=
id
(
new
AphrontDialogView
())
->
setUser
(
$viewer
)
->
setWidth
(
AphrontDialogView
::
WIDTH_FORM
)
->
setTitle
(
pht
(
'Application Secret'
))
->
appendChild
(
$body
)
->
addCancelButton
(
$view_uri
,
pht
(
'Done'
));
return
id
(
new
AphrontDialogResponse
())->
setDialog
(
$dialog
);
}
$is_serious
=
PhabricatorEnv
::
getEnvConfig
(
'phabricator.serious-business'
);
if
(
$is_serious
)
{
$body
=
pht
(
'The secret associated with this OAuth application will be shown in '
.
'plain text on your screen.'
);
}
else
{
$body
=
pht
(
'The secret associated with this OAuth application will be shown in '
.
'plain text on your screen. Before continuing, wrap your arms around '
.
'your monitor to create a human shield, keeping it safe from prying '
.
'eyes. Protect company secrets!'
);
}
return
$this
->
newDialog
()
->
setUser
(
$viewer
)
->
setTitle
(
pht
(
'Really show application secret?'
))
->
appendChild
(
$body
)
->
addSubmitButton
(
pht
(
'Show Application Secret'
))
->
addCancelButton
(
$view_uri
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jun 17, 9:24 PM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
223789
Default Alt Text
PhabricatorOAuthClientSecretController.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment