-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Motivation: A user might want to manage her own xDS resources with a group of people who have permission to create and update these resources. By creating an xDS group (a Central Dogma repository), she can easily manage these xDS resources and grant write permissions to specific people, allowing them to manage the resources under Central Dogma's authorization system. Modifications: - Added `XdsGroupService` to create a group, which is a Central Dogma repository. - With this group, a user can easily manage privileged people under the Central Dogma authorization system. - `xds_group.proto` file is also added. - All proto files might be published in a separate module later for other clients such as LEGY. - Removed `MetadataServiceInjector`. - `MetadataService` is injected when a decorator is created using a `DependencyInjector`. Result: - You can now create xDS groups to manage your xDS resources under the Central Dogma authorization system.
- Loading branch information
Showing
15 changed files
with
493 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...er/src/main/java/com/linecorp/centraldogma/server/internal/api/RepositoryServiceUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright 2024 LINE Corporation | ||
* | ||
* LINE Corporation licenses this file to you under the Apache License, | ||
* version 2.0 (the "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at: | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package com.linecorp.centraldogma.server.internal.api; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
|
||
import com.linecorp.centraldogma.common.Author; | ||
import com.linecorp.centraldogma.common.Revision; | ||
import com.linecorp.centraldogma.server.command.Command; | ||
import com.linecorp.centraldogma.server.command.CommandExecutor; | ||
import com.linecorp.centraldogma.server.metadata.MetadataService; | ||
|
||
public final class RepositoryServiceUtil { | ||
|
||
public static CompletableFuture<Revision> createRepository( | ||
CommandExecutor commandExecutor, MetadataService mds, | ||
Author author, String projectName, String repoName) { | ||
return commandExecutor.execute(Command.createRepository(author, projectName, repoName)) | ||
.thenCompose(unused -> mds.addRepo(author, projectName, repoName)); | ||
} | ||
|
||
public static CompletableFuture<Revision> removeRepository( | ||
CommandExecutor commandExecutor, MetadataService mds, Author author, | ||
String projectName, String repoName) { | ||
return commandExecutor.execute(Command.removeRepository(author, projectName, repoName)) | ||
.thenCompose(unused -> mds.removeRepo(author, projectName, repoName)); | ||
} | ||
|
||
private RepositoryServiceUtil() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.