From 6eb5c39d62223fcdc585a21ebf844146b4770404 Mon Sep 17 00:00:00 2001 From: Thomas Schauer-Koeckeis Date: Wed, 27 Nov 2024 07:53:33 +0100 Subject: [PATCH] Team Creation has no more the option to create apiKey Signed-off-by: Thomas Schauer-Koeckeis --- .../alpine/persistence/AlpineQueryManager.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/alpine-infra/src/main/java/alpine/persistence/AlpineQueryManager.java b/alpine-infra/src/main/java/alpine/persistence/AlpineQueryManager.java index 93b0026b..9df5cef5 100644 --- a/alpine-infra/src/main/java/alpine/persistence/AlpineQueryManager.java +++ b/alpine-infra/src/main/java/alpine/persistence/AlpineQueryManager.java @@ -566,20 +566,30 @@ public UserPrincipal getUserPrincipal(String username) { * Creates a new Team with the specified name. If createApiKey is true, * then {@link #createApiKey} is invoked and a cryptographically secure * API key is generated. - * @param name The name of th team + * @param name The name of the team * @param createApiKey whether to create an API key for the team + * @deprecated `createApiKey` is deprecated and will be removed in future versions * @return a Team * @since 1.0.0 */ public Team createTeam(final String name, final boolean createApiKey) { + return createTeam(name); + } + + /** + * Creates a new Team with the specified name. If createApiKey is true, + * then {@link #createApiKey} is invoked and a cryptographically secure + * API key is generated. + * @param name The name of the team + * @return a Team + * @since 1.0.0 + */ + public Team createTeam(final String name) { return callInTransaction(() -> { final var team = new Team(); team.setName(name); //todo assign permissions pm.makePersistent(team); - if (createApiKey) { - createApiKey(team); - } return team; }); }