mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-01 19:15:52 +01:00
Add plugin wizard initialization step (#2045)
Adds a new initialization step after setting up the initial administration account that allows administrators to initialize the instance with a selection of plugin sets. Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com> Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com> Co-authored-by: Matthias Thieroff <matthias.thieroff@cloudogu.com>
This commit is contained in:
committed by
Eduard Heimbuch
parent
6216945f0d
commit
1b18191c57
@@ -26,7 +26,11 @@ package sonia.scm.initialization;
|
||||
|
||||
import sonia.scm.plugin.ExtensionPoint;
|
||||
|
||||
/**
|
||||
* @deprecated Limited use for Plugin Development, see as internal
|
||||
*/
|
||||
@ExtensionPoint
|
||||
@Deprecated(since = "2.35.0", forRemoval = true)
|
||||
public interface InitializationStep {
|
||||
|
||||
String name();
|
||||
|
||||
@@ -28,9 +28,22 @@ import de.otto.edison.hal.Embedded;
|
||||
import de.otto.edison.hal.Links;
|
||||
import sonia.scm.plugin.ExtensionPoint;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* @deprecated Limited use for Plugin Development, see as internal
|
||||
*/
|
||||
@ExtensionPoint
|
||||
@Deprecated(since = "2.35.0", forRemoval = true)
|
||||
public interface InitializationStepResource {
|
||||
String name();
|
||||
|
||||
/**
|
||||
* @since 2.35.0
|
||||
*/
|
||||
default void setupIndex(Links.Builder builder, Embedded.Builder embeddedBuilder, Locale locale) {
|
||||
setupIndex(builder, embeddedBuilder);
|
||||
}
|
||||
|
||||
void setupIndex(Links.Builder builder, Embedded.Builder embeddedBuilder);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ package sonia.scm.plugin;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* The plugin manager is responsible for plugin related tasks, such as install, uninstall or updating.
|
||||
@@ -64,6 +65,23 @@ public interface PluginManager {
|
||||
*/
|
||||
List<AvailablePlugin> getAvailable();
|
||||
|
||||
/**
|
||||
* Returns all available plugin sets from the plugin center.
|
||||
*
|
||||
* @return a list of available plugin sets
|
||||
* @since 2.35.0
|
||||
*/
|
||||
Set<PluginSet> getPluginSets();
|
||||
|
||||
/**
|
||||
* Collects and installs all plugins and their dependencies for the given plugin sets.
|
||||
*
|
||||
* @param pluginSets Ids of plugin sets to install
|
||||
* @param restartAfterInstallation restart context after all plugins have been installed
|
||||
* @since 2.35.0
|
||||
*/
|
||||
void installPluginSets(Set<String> pluginSets, boolean restartAfterInstallation);
|
||||
|
||||
/**
|
||||
* Returns all updatable plugins.
|
||||
*
|
||||
|
||||
55
scm-core/src/main/java/sonia/scm/plugin/PluginSet.java
Normal file
55
scm-core/src/main/java/sonia/scm/plugin/PluginSet.java
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package sonia.scm.plugin;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
public class PluginSet {
|
||||
private String id;
|
||||
private int sequence;
|
||||
private Set<String> plugins;
|
||||
private Map<String, Description> descriptions;
|
||||
private Map<String, String> images;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
public static class Description {
|
||||
private String name;
|
||||
private List<String> features;
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.security;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -43,6 +43,7 @@ public interface AccessTokenCookieIssuer {
|
||||
* @param accessToken access token
|
||||
*/
|
||||
void authenticate(HttpServletRequest request, HttpServletResponse response, AccessToken accessToken);
|
||||
|
||||
/**
|
||||
* Invalidates the authentication cookie.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user