@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhabricatorPassphraseApplication extends PhabricatorApplication {
4
5 public function getName() {
6 return pht('Passphrase');
7 }
8
9 public function getBaseURI() {
10 return '/passphrase/';
11 }
12
13 public function getShortDescription() {
14 return pht('Credential Store');
15 }
16
17 public function getIcon() {
18 return 'fa-user-secret';
19 }
20
21 public function getTitleGlyph() {
22 return "\xE2\x97\x88";
23 }
24
25 public function getFlavorText() {
26 return pht('Put your secrets in a lockbox.');
27 }
28
29 public function getApplicationGroup() {
30 return self::GROUP_UTILITIES;
31 }
32
33 public function canUninstall() {
34 return false;
35 }
36
37 public function getMonograms() {
38 return array('K');
39 }
40
41 public function getRoutes() {
42 return array(
43 '/K(?P<id>\d+)' => 'PassphraseCredentialViewController',
44 '/passphrase/' => array(
45 '(?:query/(?P<queryKey>[^/]+)/)?'
46 => 'PassphraseCredentialListController',
47 'create/' => 'PassphraseCredentialCreateController',
48 'edit/(?:(?P<id>\d+)/)?' => 'PassphraseCredentialEditController',
49 'destroy/(?P<id>\d+)/' => 'PassphraseCredentialDestroyController',
50 'reveal/(?P<id>\d+)/' => 'PassphraseCredentialRevealController',
51 'public/(?P<id>\d+)/' => 'PassphraseCredentialPublicController',
52 'lock/(?P<id>\d+)/' => 'PassphraseCredentialLockController',
53 'conduit/(?P<id>\d+)/' => 'PassphraseCredentialConduitController',
54 ),
55 );
56 }
57
58 public function getRemarkupRules() {
59 return array(
60 new PassphraseRemarkupRule(),
61 );
62 }
63
64 public function getApplicationSearchDocumentTypes() {
65 return array(
66 PassphraseCredentialPHIDType::TYPECONST,
67 );
68 }
69
70 protected function getCustomCapabilities() {
71 $policy_key = id(new PassphraseCredentialAuthorPolicyRule())
72 ->getObjectPolicyFullKey();
73
74 return array(
75 PassphraseDefaultViewCapability::CAPABILITY => array(
76 'caption' => pht('Default view policy for newly created credentials.'),
77 'template' => PassphraseCredentialPHIDType::TYPECONST,
78 'capability' => PhabricatorPolicyCapability::CAN_VIEW,
79 'default' => $policy_key,
80 ),
81 PassphraseDefaultEditCapability::CAPABILITY => array(
82 'caption' => pht('Default edit policy for newly created credentials.'),
83 'template' => PassphraseCredentialPHIDType::TYPECONST,
84 'capability' => PhabricatorPolicyCapability::CAN_EDIT,
85 'default' => $policy_key,
86 ),
87 );
88 }
89
90}