tyk icon indicating copy to clipboard operation
tyk copied to clipboard

[TT-12153]: Fix/complexity checker and granular access checker v3-preview

Open kofoworola opened this issue 9 months ago • 5 comments

User description

Description

TT-12153

Related Issue

Motivation and Context

How This Has Been Tested

Screenshots (if appropriate)

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality)

Checklist

  • [ ] I ensured that the documentation is up to date
  • [ ] I explained why this PR updates go.mod in detail with reasoning why it's required
  • [ ] I would like a code coverage CI quality gate exception and have explained why

PR Type

Enhancement


Description

  • Integrated complexityCheckerV2 and granularAccessCheckerV2 into EngineV3.
  • Implemented complexity and granular access processing in the reverse proxy.
  • Added new checker classes with methods for depth limit and field allowance validation.

Changes walkthrough 📝

Relevant files
Enhancement
engine_v3.go
Integrate new complexity and granular access checkers in EngineV3

internal/graphengine/engine_v3.go

  • Added complexityCheckerV2 and granularAccessCheckerV2 initialization.
  • Integrated new checkers into the EngineV3 structure.
  • Removed commented-out code for previous checker versions.
  • +14/-12 
    engine_v3_reverse_proxy.go
    Implement complexity and granular access processing in reverse proxy

    internal/graphengine/engine_v3_reverse_proxy.go

  • Implemented ProcessGraphQLComplexity using complexityCheckerV2.
  • Implemented ProcessGraphQLGranularAccess using
    granularAccessCheckerV2.
  • Removed error logging for unsupported features.
  • +3/-4     
    graphql_go_tools_v2.go
    Add complexity and granular access checkers with validation methods

    internal/graphengine/graphql_go_tools_v2.go

  • Added complexityCheckerV2 with depth limit checking.
  • Added granularAccessCheckerV2 with field allowance checking.
  • Implemented methods for complexity and granular access validation.
  • +193/-0 

    💡 PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    kofoworola avatar May 20 '24 14:05 kofoworola