-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implement DataPlaneAccessControlService #3909
Merged
paullatzelsperger
merged 1 commit into
eclipse-edc:main
from
paullatzelsperger:feat/3894_implement_dataplaneaccesscontrolservice
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
48 changes: 48 additions & 0 deletions
48
.../main/java/org/eclipse/edc/connector/dataplane/spi/iam/DataPlaneAccessControlService.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,48 @@ | ||
/* | ||
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation | ||
* | ||
*/ | ||
|
||
package org.eclipse.edc.connector.dataplane.spi.iam; | ||
|
||
import org.eclipse.edc.runtime.metamodel.annotation.ExtensionPoint; | ||
import org.eclipse.edc.spi.iam.ClaimToken; | ||
import org.eclipse.edc.spi.result.Result; | ||
import org.eclipse.edc.spi.types.domain.DataAddress; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* This service is used to grant or deny a request for data based on the token attached to the request, and some request data. | ||
* For example, an implementation could make that decision based on the URL pattern of the data request. | ||
* <p> | ||
* The default implementation provided by EDC always returns {@link Result#success()}. | ||
*/ | ||
@ExtensionPoint | ||
@FunctionalInterface | ||
public interface DataPlaneAccessControlService { | ||
|
||
/** | ||
* Grants or denies access to a particular resource (DataAddress) based on the supplied credential (ClaimToken) and | ||
* additional request information (requestData). | ||
* <p> | ||
* Note that if access is denied ({@link Result#failed()}), it is advised <strong>not</strong> to forward the failure | ||
* detail to the requestor for security reasons. | ||
* <p> | ||
* | ||
* @param claimToken The credential that was attached to the data request received by the data plane | ||
* @param address The resource address of the data that is being requested | ||
* @param requestData Additional information about the request, e.g. URL pattern, additional headers, query params, etc. | ||
* @return success if access to the resource is granted, a failure otherwise. | ||
*/ | ||
Result<Void> checkAccess(ClaimToken claimToken, DataAddress address, Map<String, Object> requestData); | ||
Check notice Code scanning / CodeQL Useless parameter Note
The parameter 'address' is never used.
Check notice Code scanning / CodeQL Useless parameter Note
The parameter 'requestData' is never used.
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / CodeQL
Useless parameter Note