Page MenuHomePhabricator

D7628.id17236.diff
No OneTemporary

D7628.id17236.diff

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

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)

Event Timeline