-
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: Sometimes you need to restrict access to specific repositories without allowing mirroring for all repositories. These repositories may contain sensitive information or code that is only available to a select group of members. Modifications: - Add `MirrorAccessController` that can allow or disallow access to the remote repositories for mirroring. - It is used to check a scheduled mirroring task or a task triggered by UI is allowed to access. - `MirrorListener.onCreate()` and `MirrorListener.onUpdate()` events are newly added. The events could be used as an extension point to detect a new remote URL pattern and integrate external systems such as a workflow or a email notification. - Add CRUD REST API for administrators - GET `/api/v1/mirror/access` to retrieve all mirror access controls. - POST `/api/v1/mirror/access` to create a mirror access controls. - and so on... - In addition to the REST API, a mirror access control can be added with `MirrorAccessController.allow(...)` API which is exposed by `PluginContext.mirrorAccessController()`. - Add `CrudRepository` abstraction to easily create and update a collection of entities in a directory. - This API would be useful especially when we implement UI-based CRUD operations. - Add mirror access control UI for administrators - CRUD are supported. Result: - Administrators can restrict access to remote repositories when mirroring. - You can receive notifications when a new mirror is created or an existing mirror is updated through `MirrorListener`.
- Loading branch information
Showing
87 changed files
with
3,573 additions
and
440 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
31 changes: 31 additions & 0 deletions
31
common/src/main/java/com/linecorp/centraldogma/common/MirrorAccessException.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,31 @@ | ||
/* | ||
* Copyright 2025 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.common; | ||
|
||
/** | ||
* A {@link MirrorException} raised when failed to access to the remote repository for mirroring. | ||
*/ | ||
public final class MirrorAccessException extends MirrorException { | ||
private static final long serialVersionUID = 6673537965128335081L; | ||
|
||
/** | ||
* Creates a new instance. | ||
*/ | ||
public MirrorAccessException(String message) { | ||
super(message); | ||
} | ||
} |
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.