Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13960383
D7628.id17236.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D7628.id17236.diff
View Options
Index: resources/sql/patches/20131121.passphraseedge.sql
===================================================================
--- /dev/null
+++ resources/sql/patches/20131121.passphraseedge.sql
@@ -0,0 +1,15 @@
+CREATE TABLE {$NAMESPACE}_passphrase.edge (
+ src VARCHAR(64) NOT NULL COLLATE utf8_bin,
+ type VARCHAR(64) NOT NULL COLLATE utf8_bin,
+ dst VARCHAR(64) NOT NULL COLLATE utf8_bin,
+ dateCreated INT UNSIGNED NOT NULL,
+ seq INT UNSIGNED NOT NULL,
+ dataID INT UNSIGNED,
+ PRIMARY KEY (src, type, dst),
+ KEY (src, type, dateCreated, seq)
+) ENGINE=InnoDB, COLLATE utf8_general_ci;
+
+CREATE TABLE {$NAMESPACE}_passphrase.edgedata (
+ id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ data LONGTEXT NOT NULL COLLATE utf8_bin
+) ENGINE=InnoDB, COLLATE utf8_general_ci;
Index: src/applications/passphrase/controller/PassphraseCredentialViewController.php
===================================================================
--- src/applications/passphrase/controller/PassphraseCredentialViewController.php
+++ src/applications/passphrase/controller/PassphraseCredentialViewController.php
@@ -151,6 +151,17 @@
pht('Username'),
$credential->getUsername());
+ $used_by_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
+ $credential->getPHID(),
+ PhabricatorEdgeConfig::TYPE_CREDENTIAL_USED_BY_OBJECT);
+
+ if ($used_by_phids) {
+ $this->loadHandles($used_by_phids);
+ $properties->addProperty(
+ pht('Used By'),
+ $this->renderHandlesForPHIDs($used_by_phids));
+ }
+
$description = $credential->getDescription();
if (strlen($description)) {
$properties->addSectionHeader(
Index: src/applications/passphrase/storage/PassphraseCredential.php
===================================================================
--- src/applications/passphrase/storage/PassphraseCredential.php
+++ src/applications/passphrase/storage/PassphraseCredential.php
@@ -19,6 +19,7 @@
return id(new PassphraseCredential())
->setName('')
->setUsername('')
+ ->setDescription('')
->setIsDestroyed(0)
->setViewPolicy($actor->getPHID())
->setEditPolicy($actor->getPHID());
Index: src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
===================================================================
--- src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
+++ src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
@@ -60,6 +60,9 @@
const TYPE_MOCK_HAS_TASK = 37;
const TYPE_TASK_HAS_MOCK = 38;
+ const TYPE_OBJECT_USES_CREDENTIAL = 39;
+ const TYPE_CREDENTIAL_USED_BY_OBJECT = 40;
+
const TYPE_TEST_NO_CYCLE = 9000;
const TYPE_PHOB_HAS_ASANATASK = 80001;
@@ -71,6 +74,7 @@
const TYPE_PHOB_HAS_JIRAISSUE = 80004;
const TYPE_JIRAISSUE_HAS_PHOB = 80005;
+
public static function getInverse($edge_type) {
static $map = array(
self::TYPE_TASK_HAS_COMMIT => self::TYPE_COMMIT_HAS_TASK,
@@ -134,7 +138,10 @@
self::TYPE_REVIEWER_FOR_DREV => self::TYPE_DREV_HAS_REVIEWER,
self::TYPE_PHOB_HAS_JIRAISSUE => self::TYPE_JIRAISSUE_HAS_PHOB,
- self:: TYPE_JIRAISSUE_HAS_PHOB => self::TYPE_PHOB_HAS_JIRAISSUE
+ self::TYPE_JIRAISSUE_HAS_PHOB => self::TYPE_PHOB_HAS_JIRAISSUE,
+
+ self::TYPE_OBJECT_USES_CREDENTIAL => self::TYPE_CREDENTIAL_USED_BY_OBJECT,
+ self::TYPE_CREDENTIAL_USED_BY_OBJECT => self::TYPE_OBJECT_USES_CREDENTIAL,
);
return idx($map, $edge_type);
Index: src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
===================================================================
--- src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
+++ src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
@@ -1772,6 +1772,10 @@
'type' => 'sql',
'name' => $this->getPatchPath('20131120.nuancesourcetype.sql'),
),
+ '20131121.passphraseedge.sql' => array(
+ 'type' => 'sql',
+ 'name' => $this->getPatchPath('20131121.passphraseedge.sql'),
+ ),
);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 15, 11:09 PM (4 w, 47 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6714834
Default Alt Text
D7628.id17236.diff (4 KB)
Attached To
Mode
D7628: Add an edge between Passphrase credentials and objects which use them
Attached
Detach File
Event Timeline
Log In to Comment