crypt = $crypt;
$this->keyManager = $keyManager;
}
/**
* @param string $uid user id
* @param string $password user password
* @return bool
*/
public function setupUser($uid, $password) {
if (!$this->keyManager->userHasKeys($uid)) {
$keyPair = $this->crypt->createKeyPair();
return is_array($keyPair) ? $this->keyManager->storeKeyPair($uid, $password, $keyPair) : false;
}
return true;
}
/**
* make sure that all system keys exists
*/
public function setupSystem() {
$this->keyManager->validateShareKey();
$this->keyManager->validateMasterKey();
}
}
/v1.12'>release/v1.12
Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD: https://github.com/go-gitea/gitea