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

fix(deps): update dependency @envelop/generic-auth to v8 #3420

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Aug 26, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@envelop/generic-auth (source) 7.0.0 -> 8.0.0 age adoption passing confidence

Release Notes

n1ru4l/envelop (@​envelop/generic-auth)

v8.0.0

Compare Source

Major Changes
  • #​2281
    70d4d7a
    Thanks @​UserType;! - Refactor Generic Auth plugin;

    • [BREAKING] - Now @auth directive is renamed to @authenticated. If you want to keep the old
      name you can configure the plugin to use the old name.
    useGenericAuth({
      // ...
      authDirectiveName: 'auth'
    })
    • [BREAKING] - Now directiveOrExtensionFieldName is renamed to authDirectiveName.
    useGenericAuth({
      // ...
    - directiveOrExtensionFieldName: 'auth',
    + authDirectiveName: 'auth',
    });
    • Now auth directives support OBJECT and INTERFACE locations, so you can use the auth
      directive on types as well.
    directive @​authenticated on OBJECT | INTERFACE
    
    type User @​authenticated {
      id: ID!
      name: String!
    }
    • validateUser function does not receive fieldAuthDirectiveNode and fieldAuthExtension
      anymore. Instead, it takes fieldAuthArgs which is an object that contains the arguments of the
      auth directive or extension. So you don't need to parse the arguments manually anymore.
    const validateUser: ValidateUserFn = params => {
      if (!params.fieldAuthArgs.roles.includes('admin')) {
        return createUnauthorizedError(params)
      }
    }
    • validateUser's objectType parameter is now renamed to parentType. And it takes the
      original composite type instead of the GraphQLObjectType instance. Now it can be
      GraphQLInterfaceType as well.
    • validateUser's current parameters are now;
    export type ValidateUserFnParams<UserType> = {
      /** The user object. */
    
      /** The field node from the operation that is being validated. */
      fieldNode: FieldNode
      /** The parent type which has the field that is being validated. */
      parentType: GraphQLObjectType | GraphQLInterfaceType
      /** The auth directive arguments for the type */
      typeAuthArgs?: Record<string, any>
      /** The directives for the type */
      typeDirectives?: ReturnType<typeof getDirectiveExtensions>
      /** Scopes that type requires */
      typeScopes?: string[][]
      /** Policies that type requires */
      typePolicies?: string[][]
      /** The object field */
      field: GraphQLField<any, any>
      /** The auth directive arguments for the field */
      fieldAuthArgs?: Record<string, any>
      /** The directives for the field */
      fieldDirectives?: ReturnType<typeof getDirectiveExtensions>
      /** Scopes that field requires */
      fieldScopes?: string[][]
      /** Policies that field requires */
      fieldPolicies?: string[][]
      /** Extracted scopes from the user object */
      userScopes: string[]
      /** Policies for the user */
      userPolicies: string[]
      /** The args passed to the execution function (including operation context and variables) **/
      executionArgs: ExecutionArgs
      /** Resolve path */
      path: ReadonlyArray<string | number>
    }
    • New directives for role-based auth are added @requiresScopes and @policy for more granular
      control over the auth logic.
    directive @&#8203;requiresScopes(scopes: [String!]!) on OBJECT | INTERFACE | FIELD_DEFINITION
    
    directive @&#8203;policy(policy: String!) on OBJECT | INTERFACE | FIELD_DEFINITION

    Check README for more information.

Patch Changes

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Aug 26, 2024
@renovate renovate bot requested review from EmrysMyrddin and n1ru4l August 26, 2024 12:49
Copy link

changeset-bot bot commented Aug 26, 2024

⚠️ No Changeset found

Latest commit: 78aa6f6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Aug 26, 2024

Apollo Federation Subgraph Compatibility Results

Federation 1 Support Federation 2 Support
_service🟢
@key (single)🟢
@key (multi)🟢
@key (composite)🟢
repeatable @key🟢
@requires🟢
@provides🟢
federated tracing🟢
@link🟢
@shareable🟢
@tag🟢
@override🟢
@inaccessible🟢
@composeDirective🟢
@interfaceObject🟢

Learn more:

Copy link
Contributor

github-actions bot commented Aug 26, 2024

✅ Benchmark Results

     ✓ no_errors{mode:graphql}
     ✓ expected_result{mode:graphql}
     ✓ no_errors{mode:graphql-jit}
     ✓ expected_result{mode:graphql-jit}
     ✓ no_errors{mode:graphql-response-cache}
     ✓ expected_result{mode:graphql-response-cache}
     ✓ no_errors{mode:graphql-no-parse-validate-cache}
     ✓ expected_result{mode:graphql-no-parse-validate-cache}
     ✓ no_errors{mode:uws}
     ✓ expected_result{mode:uws}

     checks.......................................: 100.00% ✓ 524204      ✗ 0     
     data_received................................: 2.1 GB  14 MB/s
     data_sent....................................: 105 MB  702 kB/s
     http_req_blocked.............................: avg=1.45µs   min=942ns    med=1.29µs   max=248.85µs p(90)=1.93µs   p(95)=2.12µs  
     http_req_connecting..........................: avg=2ns      min=0s       med=0s       max=160.05µs p(90)=0s       p(95)=0s      
     http_req_duration............................: avg=358.87µs min=219.1µs  med=323.17µs max=15.42ms  p(90)=459.07µs p(95)=480.44µs
       { expected_response:true }.................: avg=358.87µs min=219.1µs  med=323.17µs max=15.42ms  p(90)=459.07µs p(95)=480.44µs
     ✓ { mode:graphql-jit }.......................: avg=289.17µs min=219.1µs  med=266.81µs max=15.42ms  p(90)=297.23µs p(95)=312.56µs
     ✓ { mode:graphql-no-parse-validate-cache }...: avg=488.39µs min=398.79µs med=460.3µs  max=14.12ms  p(90)=500.67µs p(95)=531.11µs
     ✓ { mode:graphql-response-cache }............: avg=341.44µs min=267.24µs med=322.46µs max=6.77ms   p(90)=351.47µs p(95)=362.66µs
     ✓ { mode:graphql }...........................: avg=366.13µs min=273.16µs med=330.43µs max=13.78ms  p(90)=389.19µs p(95)=443.36µs
     ✓ { mode:uws }...............................: avg=344.75µs min=271.45µs med=323.62µs max=11.24ms  p(90)=356.08µs p(95)=373.36µs
     http_req_failed..............................: 0.00%   ✓ 0           ✗ 262102
     http_req_receiving...........................: avg=33.05µs  min=16.81µs  med=33.16µs  max=4.81ms   p(90)=38.59µs  p(95)=40.65µs 
     http_req_sending.............................: avg=8.4µs    min=5.94µs   med=7.38µs   max=758.94µs p(90)=10.94µs  p(95)=11.8µs  
     http_req_tls_handshaking.....................: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting.............................: avg=317.4µs  min=184.05µs med=282.6µs  max=15.3ms   p(90)=416.84µs p(95)=435.95µs
     http_reqs....................................: 262102  1747.328566/s
     iteration_duration...........................: avg=567.46µs min=391.2µs  med=528.83µs max=15.99ms  p(90)=671.88µs p(95)=697.3µs 
     iterations...................................: 262102  1747.328566/s
     vus..........................................: 1       min=1         max=1   
     vus_max......................................: 2       min=2         max=2   

Copy link
Contributor

github-actions bot commented Oct 21, 2024

💻 Website Preview

The latest changes are available as preview in: https://f7ffdfdd.graphql-yoga.pages.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants