fineract-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iamrupok <...@git.apache.org>
Subject [GitHub] fineract issue #370: adhoc query
Date Sat, 17 Jun 2017 05:18:53 GMT
Github user iamrupok commented on the issue:

    https://github.com/apache/fineract/pull/370
  
    planning to add
    final String sqlQuery = this.fromApiJsonHelper.extractStringNamed("query",
    element);
    
    if(sqlQuery.toLowerCase().contains("drop")||sqlQuery.toLowerCase().contains("delete")){
                final ApiParameterError error =
    ApiParameterError.parameterError("validation.msg.unsupported.sql", "Delete
    and Drop Not Supported",
                          "query", sqlQuery);
                dataValidationErrors.add(error);
            }
    in AdHocDataValidator class for create and update do you think this would
    be suffiient
    On Fri, Jun 16, 2017 at 9:11 PM, Shaik Nazeer Hussain <
    notifications@github.com> wrote:
    
    > *@nazeer1100126* commented on this pull request.
    > ------------------------------
    >
    > In fineract-provider/src/main/java/org/apache/fineract/
    > adhocquery/domain/AdHoc.java
    > <https://github.com/apache/fineract/pull/370#discussion_r122465169>:
    >
    > > +
    > +	@Column(name = "IsActive", nullable = false)
    > +    private boolean isActive = false;
    > +   	
    > +    private AdHoc(final String name, final String query,final String tableName,final
String tableFields ,final String email,final boolean isActive) {
    > +        this.name = StringUtils.defaultIfEmpty(name, null);
    > +        this.query=StringUtils.defaultIfEmpty(query,null);
    > +        this.tableName=StringUtils.defaultIfEmpty(tableName,null);
    > +        this.tableFields=StringUtils.defaultIfEmpty(tableFields,null);
    > +        this.email=StringUtils.defaultIfEmpty(email,null);
    > +        this.isActive = BooleanUtils.toBooleanDefaultIfNull(isActive, false);
    > +
    > +    }
    > +    public static AdHoc fromJson(final JsonCommand command) {
    > +        final String name = command.stringValueOfParameterNamed(AdHocJsonInputParams.NAME.getValue());
    > +        final String query = command.stringValueOfParameterNamed(AdHocJsonInputParams.QUERY.getValue());
    >
    > Do we need to validate this query string not to have cases where
    > authorized users sending malicious SQL statements?
    >
    > —
    > You are receiving this because you authored the thread.
    > Reply to this email directly, view it on GitHub
    > <https://github.com/apache/fineract/pull/370#pullrequestreview-44586872>,
    > or mute the thread
    > <https://github.com/notifications/unsubscribe-auth/ALCNB6KOo7VMncz9_O8P1TJIbX8LcwMRks5sEpsqgaJpZM4N6_MX>
    > .
    >



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message