mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-02-26 16:30:50 +01:00
Merge branch 'support/2.46.x' into support/2.48.x
This commit is contained in:
@@ -54,8 +54,8 @@ public class SecurityHeadersFilter extends HttpFilter {
|
||||
response.setHeader("X-Content-Type-Options", "nosniff");
|
||||
response.setHeader("Content-Security-Policy",
|
||||
"form-action 'self'; " +
|
||||
"object-src 'none'; " +
|
||||
"frame-ancestors 'none'; " +
|
||||
"object-src 'self'; " +
|
||||
"frame-ancestors 'self'; " +
|
||||
"block-all-mixed-content"
|
||||
);
|
||||
response.setHeader("Permissions-Policy",
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import sonia.scm.AlreadyExistsException;
|
||||
import sonia.scm.ConfigurationException;
|
||||
import sonia.scm.HandlerEventType;
|
||||
import sonia.scm.ManagerDaoAdapter;
|
||||
@@ -183,7 +184,7 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager {
|
||||
},
|
||||
newRepository -> {
|
||||
if (repositoryDAO.contains(newRepository.getNamespaceAndName())) {
|
||||
throw alreadyExists(entity(newRepository.getClass(), newRepository.getNamespaceAndName().logString()));
|
||||
throw alreadyExists(entity(newRepository.getNamespaceAndName()));
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -292,10 +293,16 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager {
|
||||
|
||||
public Repository rename(Repository repository, String newNamespace, String newName) {
|
||||
|
||||
NamespaceAndName newNamespaceAndName = new NamespaceAndName(newNamespace, newName);
|
||||
|
||||
if (hasNamespaceOrNameNotChanged(repository, newNamespace, newName)) {
|
||||
throw new NoChangesMadeException(repository);
|
||||
}
|
||||
|
||||
if (this.get(newNamespaceAndName) != null){
|
||||
throw AlreadyExistsException.alreadyExists(entity(NamespaceAndName.class, newNamespaceAndName.logString()));
|
||||
}
|
||||
|
||||
Repository changedRepository = repository.clone();
|
||||
if (!Strings.isNullOrEmpty(newName)) {
|
||||
changedRepository.setName(newName);
|
||||
|
||||
@@ -64,9 +64,7 @@ class ApiKeyTokenHandler {
|
||||
return of(OBJECT_MAPPER.readValue(decoder.decode(token), Token.class));
|
||||
} catch (IOException | DecodingException e) {
|
||||
LOG.debug("failed to read api token, perhaps it is a jwt token or a normal password");
|
||||
if (LOG.isTraceEnabled()) {
|
||||
LOG.trace("failed to parse token", e);
|
||||
}
|
||||
// do not print the exception here, because it could reveal password details
|
||||
return empty();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user