summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2011-06-01 20:47:05 -0400
committerJames Moger <james.moger@gitblit.com>2011-06-01 20:47:05 -0400
commita3bde69e9b3f3cc6212b0cd5fd7310b6a3301d8c (patch)
treeb6852da4e7256bad356de93d6444d4bd96356178
parenta1ea877042b93949ef244b96e8affd65cc3f89c1 (diff)
downloadgitblit-a3bde69e9b3f3cc6212b0cd5fd7310b6a3301d8c.tar.gz
gitblit-a3bde69e9b3f3cc6212b0cd5fd7310b6a3301d8c.zip
Documentation. Enforce ".git" suffix for created repositories.
-rw-r--r--docs/00_setup.mkd6
-rw-r--r--src/com/gitblit/GitBlit.java4
-rw-r--r--src/com/gitblit/wicket/GitBlitWebApp.properties4
-rw-r--r--src/com/gitblit/wicket/pages/EditRepositoryPage.html4
4 files changed, 14 insertions, 4 deletions
diff --git a/docs/00_setup.mkd b/docs/00_setup.mkd
index 2eddd44f..48e02b7a 100644
--- a/docs/00_setup.mkd
+++ b/docs/00_setup.mkd
@@ -32,9 +32,13 @@ All repository settings are stored within the repository `.git/config` file unde
showReadme = false
#### Repository Names
-Repository names must be unique and are case-insensitive. The name must be composed of letters, digits, or `/ _ - .`<br/>
+Repository names must be unique and are CASE-SENSITIVE ON CASE-SENSITIVE FILESYSTEMS. The name must be composed of letters, digits, or `/ _ - .`<br/>
Whitespace is illegal.
+Repositories can be grouped by folders. e.g. *libraries/mycoollib.git* and *libraries/myotherlib.git*
+
+Repository names will automatically have *.git* appended to the name at creation time, if not already specified.
+
#### Repository Owner
The *Repository Owner* has the special permission of being able to edit a repository through the web UI. The Repository Owner is not permitted to rename the repository, delete the repository, or reassign ownership to another user.
diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java
index c6eb613d..7182d9b7 100644
--- a/src/com/gitblit/GitBlit.java
+++ b/src/com/gitblit/GitBlit.java
@@ -225,6 +225,10 @@ public class GitBlit implements ServletContextListener {
boolean isCreate) throws GitBlitException {
Repository r = null;
if (isCreate) {
+ // ensure created repository name ends with .git
+ if (!repository.name.endsWith(org.eclipse.jgit.lib.Constants.DOT_GIT_EXT)) {
+ repository.name += org.eclipse.jgit.lib.Constants.DOT_GIT_EXT;
+ }
if (new File(repositoriesFolder, repository.name).exists()) {
throw new GitBlitException(MessageFormat.format(
"Can not create repository ''{0}'' because it already exists.",
diff --git a/src/com/gitblit/wicket/GitBlitWebApp.properties b/src/com/gitblit/wicket/GitBlitWebApp.properties
index 16f2aa0a..2ba03e6e 100644
--- a/src/com/gitblit/wicket/GitBlitWebApp.properties
+++ b/src/com/gitblit/wicket/GitBlitWebApp.properties
@@ -91,4 +91,6 @@ gb.isFrozen = is frozen
gb.isFrozenDescription = deny push operations
gb.zip = zip
gb.showReadme = show readme
-gb.showReadmeDescription = show a \"readme\" markdown file on the summary page \ No newline at end of file
+gb.showReadmeDescription = show a \"readme\" markdown file on the summary page
+gb.nameDescription = use '/' to group repositories. e.g. libraries/mycoollib.git
+gb.ownerDescription = the owner may edit repository settings \ No newline at end of file
diff --git a/src/com/gitblit/wicket/pages/EditRepositoryPage.html b/src/com/gitblit/wicket/pages/EditRepositoryPage.html
index 775a5d22..1a3a657f 100644
--- a/src/com/gitblit/wicket/pages/EditRepositoryPage.html
+++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.html
@@ -15,9 +15,9 @@
<form wicket:id="editForm">
<table class="plain">
<tbody>
- <tr><th><wicket:message key="gb.name"></wicket:message></th><td class="edit"><input type="text" wicket:id="name" id="name" size="40" tabindex="1" /></td></tr>
+ <tr><th><wicket:message key="gb.name"></wicket:message></th><td class="edit"><input type="text" wicket:id="name" id="name" size="40" tabindex="1" /> &nbsp;<i><wicket:message key="gb.nameDescription"></wicket:message></i></td></tr>
<tr><th><wicket:message key="gb.description"></wicket:message></th><td class="edit"><input type="text" wicket:id="description" size="40" tabindex="2" /></td></tr>
- <tr><th><wicket:message key="gb.owner"></wicket:message></th><td class="edit"><select wicket:id="owner" tabindex="3" /></td></tr>
+ <tr><th><wicket:message key="gb.owner"></wicket:message></th><td class="edit"><select wicket:id="owner" tabindex="3" /> &nbsp;<i><wicket:message key="gb.ownerDescription"></wicket:message></i></td></tr>
<tr><th><wicket:message key="gb.enableTickets"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="useTickets" tabindex="4" /> &nbsp;<i><wicket:message key="gb.useTicketsDescription"></wicket:message></i></td></tr>
<tr><th><wicket:message key="gb.enableDocs"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="useDocs" tabindex="5" /> &nbsp;<i><wicket:message key="gb.useDocsDescription"></wicket:message></i></td></tr>
<tr><th><wicket:message key="gb.showRemoteBranches"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="showRemoteBranches" tabindex="6" /> &nbsp;<i><wicket:message key="gb.showRemoteBranchesDescription"></wicket:message></i></td></tr>
>automated/noid/stable31-update-code-signing-crl Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Authentication/WebAuthn/Db/PublicKeyCredentialMapper.php
blob: fa7304157c8b6156660bc1c4a7107291ec37c796 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php

declare(strict_types=1);

/**
 * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */
namespace OC\Authentication\WebAuthn\Db;

use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\QBMapper;
use OCP\IDBConnection;

/**
 * @template-extends QBMapper<PublicKeyCredentialEntity>
 */
class PublicKeyCredentialMapper extends QBMapper {
	public function __construct(IDBConnection $db) {
		parent::__construct($db, 'webauthn', PublicKeyCredentialEntity::class);
	}

	public function findOneByCredentialId(string $publicKeyCredentialId): PublicKeyCredentialEntity {
		$qb = $this->db->getQueryBuilder();

		$qb->select('*')
			->from($this->getTableName())
			->where(
				$qb->expr()->eq('public_key_credential_id', $qb->createNamedParameter(base64_encode($publicKeyCredentialId)))
			);

		return $this->findEntity($qb);
	}

	/**
	 * @return PublicKeyCredentialEntity[]
	 */
	public function findAllForUid(string $uid): array {
		$qb = $this->db->getQueryBuilder();

		$qb->select('*')
			->from($this->getTableName())
			->where(
				$qb->expr()->eq('uid', $qb->createNamedParameter($uid))
			);

		return $this->findEntities($qb);
	}

	/**
	 * @param string $uid
	 * @param int $id
	 *
	 * @return PublicKeyCredentialEntity
	 * @throws DoesNotExistException
	 */
	public function findById(string $uid, int $id): PublicKeyCredentialEntity {
		$qb = $this->db->getQueryBuilder();

		$qb->select('*')
			->from($this->getTableName())
			->where($qb->expr()->andX(
				$qb->expr()->eq('id', $qb->createNamedParameter($id)),
				$qb->expr()->eq('uid', $qb->createNamedParameter($uid))
			));

		return $this->findEntity($qb);
	}

	/**
	 * @throws \OCP\DB\Exception
	 */
	public function deleteByUid(string $uid) {
		$qb = $this->db->getQueryBuilder();

		$qb->delete($this->getTableName())
			->where(
				$qb->expr()->eq('uid', $qb->createNamedParameter($uid))
			);
		$qb->executeStatement();
	}
}