Skip to content
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

Feature/field restrictions #3041

Merged
merged 4 commits into from
May 11, 2020
Merged

Conversation

furkansenharputlu
Copy link
Contributor

@furkansenharputlu furkansenharputlu commented Apr 22, 2020

Fixes #3017

@furkansenharputlu furkansenharputlu self-assigned this Apr 22, 2020
@furkansenharputlu furkansenharputlu force-pushed the feature/field-restrictions branch 4 times, most recently from f53f9c1 to c1d760c Compare April 27, 2020 09:45
@furkansenharputlu furkansenharputlu changed the title [WIP]Feature/field restrictions Feature/field restrictions Apr 27, 2020
@furkansenharputlu furkansenharputlu marked this pull request as ready for review April 27, 2020 09:47
@furkansenharputlu furkansenharputlu force-pushed the feature/field-restrictions branch 2 times, most recently from ddfc0df to 0a9ec86 Compare April 27, 2020 15:57
@@ -17,6 +17,8 @@ import (
"text/template"
"time"

"github.com/jensneuse/graphql-go-tools/pkg/graphql"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we group imports?
like

import (
  std_imports
 
  third party

  tyk
)

@@ -403,6 +403,20 @@ func (t BaseMiddleware) ApplyPolicies(session *user.SessionState) error {
}
}

for _, t := range v.RestrictedTypes {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we support partitioning of restricted types?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it is unrelated to this PR but could we make iteration variables names more meaningful?

like v -> accessRight and k -> apiID

Copy link
Contributor Author

@furkansenharputlu furkansenharputlu May 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, it is very unclear but better to make it in another PR as it will change a lot of unrelated lines


return nil, http.StatusOK

} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else branch is not required here as you already have returns in if

Copy link
Contributor

@devsergiy devsergiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will have to cover ACL merging with tests

@devsergiy devsergiy merged commit eda0cb5 into feature/graphql May 11, 2020
@devsergiy devsergiy deleted the feature/field-restrictions branch May 11, 2020 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants