You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "awelless (via GitHub)" <gi...@apache.org> on 2025/03/03 14:04:22 UTC
[PR] NIFI-14308 Make as-user optional in JsonConfigBasedBoxClientService [nifi]
awelless opened a new pull request, #9759:
URL: https://github.com/apache/nifi/pull/9759
<!-- Licensed to the Apache Software Foundation (ASF) under one or more -->
<!-- contributor license agreements. See the NOTICE file distributed with -->
<!-- this work for additional information regarding copyright ownership. -->
<!-- The ASF 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 -->
<!-- http://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. -->
# Summary
[NIFI-14308](https://issues.apache.org/jira/browse/NIFI-14308)
Making usages of `as-user` header optional.
# Tracking
Please complete the following tracking steps prior to pull request creation.
### Issue Tracking
- [x] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
### Pull Request Tracking
- [x] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-14308`
- [x] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-14308`
### Pull Request Formatting
- [x] Pull Request based on current revision of the `main` branch
- [x] Pull Request refers to a feature branch with one commit containing changes
# Verification
Please indicate the verification steps performed prior to pull request creation.
### Build
- [x] Build completed using `mvn clean install -P contrib-check`
- [x] JDK 21
### Licensing
**No new dependencies.**
- [ ] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
- [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
### Documentation
- [ ] Documentation formatting appears as expected in rendered files
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14308 Make as-user optional in JsonConfigBasedBoxClientService [nifi]
Posted by "awelless (via GitHub)" <gi...@apache.org>.
awelless commented on code in PR #9759:
URL: https://github.com/apache/nifi/pull/9759#discussion_r1979153764
##########
nifi-extension-bundles/nifi-box-bundle/nifi-box-services/src/main/java/org/apache/nifi/box/controllerservices/JsonConfigBasedBoxClientService.java:
##########
@@ -60,9 +61,10 @@ public class JsonConfigBasedBoxClientService extends AbstractControllerService i
public static final PropertyDescriptor ACCOUNT_ID = new PropertyDescriptor.Builder()
.name("box-account-id")
.displayName("Account ID")
- .description("The ID of the Box account who owns the accessed resource. Same as 'User Id' under 'App Info' in the App 'General Settings'.")
- .required(true)
- .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .description("The ID of the Box account which the app will act on behalf of. " +
+ "If not set, the app will act as its Service Account. See Additional Details for more information.")
+ .required(false)
+ .addValidator(Validator.VALID)
Review Comment:
The validator has been reverted.
I added a new parameter that's responsible for choosing a proper actor option.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14308 Make as-user optional in JsonConfigBasedBoxClientService [nifi]
Posted by "pvillard31 (via GitHub)" <gi...@apache.org>.
pvillard31 commented on code in PR #9759:
URL: https://github.com/apache/nifi/pull/9759#discussion_r1977847937
##########
nifi-extension-bundles/nifi-box-bundle/nifi-box-services/src/main/java/org/apache/nifi/box/controllerservices/JsonConfigBasedBoxClientService.java:
##########
@@ -60,9 +61,10 @@ public class JsonConfigBasedBoxClientService extends AbstractControllerService i
public static final PropertyDescriptor ACCOUNT_ID = new PropertyDescriptor.Builder()
.name("box-account-id")
.displayName("Account ID")
- .description("The ID of the Box account who owns the accessed resource. Same as 'User Id' under 'App Info' in the App 'General Settings'.")
- .required(true)
- .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .description("The ID of the Box account which the app will act on behalf of. " +
+ "If not set, the app will act as its Service Account. See Additional Details for more information.")
+ .required(false)
+ .addValidator(Validator.VALID)
Review Comment:
I think we don't want to change the validator here as we don't want someone to set the property with "set empty" as it would lead to `api.asUser(accountIdProperty.getValue());` and `accountIdProperty.getValue()` would be empty string. As soon as the property is not required, the validator is executed only if the property is set.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14308 Make as-user optional in JsonConfigBasedBoxClientService [nifi]
Posted by "pvillard31 (via GitHub)" <gi...@apache.org>.
pvillard31 closed pull request #9759: NIFI-14308 Make as-user optional in JsonConfigBasedBoxClientService
URL: https://github.com/apache/nifi/pull/9759
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14308 Make as-user optional in JsonConfigBasedBoxClientService [nifi]
Posted by "sfc-gh-lshcharbaty (via GitHub)" <gi...@apache.org>.
sfc-gh-lshcharbaty commented on code in PR #9759:
URL: https://github.com/apache/nifi/pull/9759#discussion_r1979086479
##########
nifi-extension-bundles/nifi-box-bundle/nifi-box-services/src/main/java/org/apache/nifi/box/controllerservices/JsonConfigBasedBoxClientService.java:
##########
@@ -60,9 +61,10 @@ public class JsonConfigBasedBoxClientService extends AbstractControllerService i
public static final PropertyDescriptor ACCOUNT_ID = new PropertyDescriptor.Builder()
.name("box-account-id")
.displayName("Account ID")
- .description("The ID of the Box account who owns the accessed resource. Same as 'User Id' under 'App Info' in the App 'General Settings'.")
- .required(true)
- .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .description("The ID of the Box account which the app will act on behalf of. " +
+ "If not set, the app will act as its Service Account. See Additional Details for more information.")
+ .required(false)
+ .addValidator(Validator.VALID)
Review Comment:
The validator has been reverted.
I introduced a new property which decided whether user impersonation takes place or not.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14308 Make as-user optional in JsonConfigBasedBoxClientService [nifi]
Posted by "sfc-gh-lshcharbaty (via GitHub)" <gi...@apache.org>.
sfc-gh-lshcharbaty commented on code in PR #9759:
URL: https://github.com/apache/nifi/pull/9759#discussion_r1979086479
##########
nifi-extension-bundles/nifi-box-bundle/nifi-box-services/src/main/java/org/apache/nifi/box/controllerservices/JsonConfigBasedBoxClientService.java:
##########
@@ -60,9 +61,10 @@ public class JsonConfigBasedBoxClientService extends AbstractControllerService i
public static final PropertyDescriptor ACCOUNT_ID = new PropertyDescriptor.Builder()
.name("box-account-id")
.displayName("Account ID")
- .description("The ID of the Box account who owns the accessed resource. Same as 'User Id' under 'App Info' in the App 'General Settings'.")
- .required(true)
- .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .description("The ID of the Box account which the app will act on behalf of. " +
+ "If not set, the app will act as its Service Account. See Additional Details for more information.")
+ .required(false)
+ .addValidator(Validator.VALID)
Review Comment:
The validator has been reverted.
I introduced a new property which decided whether user impersonation takes place or not.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14308 Make as-user optional in JsonConfigBasedBoxClientService [nifi]
Posted by "pvillard31 (via GitHub)" <gi...@apache.org>.
pvillard31 commented on code in PR #9759:
URL: https://github.com/apache/nifi/pull/9759#discussion_r1979244009
##########
nifi-extension-bundles/nifi-box-bundle/nifi-box-services/src/main/java/org/apache/nifi/box/controllerservices/JsonConfigBasedBoxClientService.java:
##########
@@ -57,12 +57,24 @@
@CapabilityDescription("Provides Box client objects through which Box API calls can be used.")
@Tags({"box", "client", "provider"})
public class JsonConfigBasedBoxClientService extends AbstractControllerService implements BoxClientService, VerifiableControllerService {
+
+ public static final PropertyDescriptor APP_ACTOR = new PropertyDescriptor.Builder()
+ .name("app-actor")
+ .displayName("App Actor")
+ .description("Who the app will act on behalf of.")
Review Comment:
```suggestion
.name("App Actor")
.description("Specifies on behalf of whom Box API calls will be made.")
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org