1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-03 04:02:43 +01:00
phorge-phorge/src/applications/settings/storage/PhabricatorUserSSHKey.php

46 lines
1 KiB
PHP
Raw Normal View History

<?php
final class PhabricatorUserSSHKey extends PhabricatorUserDAO {
protected $userPHID;
protected $name;
protected $keyType;
protected $keyBody;
protected $keyHash;
protected $keyComment;
public function getConfiguration() {
return array(
self::CONFIG_COLUMN_SCHEMA => array(
'keyHash' => 'bytes32',
'keyComment' => 'text255?',
// T6203/NULLABILITY
// These seem like they should not be nullable.
'name' => 'text255?',
'keyType' => 'text255?',
'keyBody' => 'text?',
),
self::CONFIG_KEY_SCHEMA => array(
'userPHID' => array(
'columns' => array('userPHID'),
),
'keyHash' => array(
'columns' => array('keyHash'),
'unique' => true,
),
),
) + parent::getConfiguration();
}
public function getEntireKey() {
$parts = array(
$this->getKeyType(),
$this->getKeyBody(),
$this->getKeyComment(),
);
return trim(implode(' ', $parts));
}
}