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

[Service Utils] Feature: Accept Request in authorizeNode #5724

Conversation

gregfromstl
Copy link
Member

@gregfromstl gregfromstl commented Dec 13, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR focuses on enhancing the authorizeNode function in the service-utils package by improving type handling for request headers and refactoring header retrieval logic.

Detailed summary

  • Updated req type in AuthInput to allow Request.
  • Added isNodeHeaders type guard to distinguish between IncomingHttpHeaders and Headers.
  • Refactored getHeader function to utilize isNodeHeaders.
  • Modified extractAuthorizationData to use getHeader for host retrieval.
  • Updated logHttpRequest to use getHeader for various header fields.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

linear bot commented Dec 13, 2024

Copy link

changeset-bot bot commented Dec 13, 2024

🦋 Changeset detected

Latest commit: 90a16da

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@thirdweb-dev/service-utils Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

vercel bot commented Dec 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 5:51am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 5:51am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 5:51am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 5:51am

Copy link

graphite-app bot commented Dec 13, 2024

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.85%. Comparing base (e8b1f49) to head (90a16da).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5724   +/-   ##
=======================================
  Coverage   52.85%   52.85%           
=======================================
  Files        1098     1098           
  Lines       58976    58976           
  Branches     4788     4788           
=======================================
  Hits        31173    31173           
  Misses      27087    27087           
  Partials      716      716           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from e8b1f49
packages 49.95% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

Copy link
Contributor

github-actions bot commented Dec 13, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 44.94 KB (0%) 899 ms (0%) 2.8 s (-6.78% 🔽) 3.7 s
thirdweb (cjs) 110.78 KB (0%) 2.3 s (0%) 7.2 s (+5.12% 🔺) 9.4 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 345 ms (-13.47% 🔽) 457 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 151 ms (+185.39% 🔺) 161 ms
thirdweb/react (minimal + tree-shaking) 19.03 KB (0%) 381 ms (0%) 500 ms (-10.28% 🔽) 880 ms

@gregfromstl gregfromstl added the merge-queue Adds the pull request to Graphite's merge queue. label Dec 13, 2024
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground December 13, 2024 05:35 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 December 13, 2024 05:35 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui December 13, 2024 05:35 Inactive
Copy link

graphite-app bot commented Dec 13, 2024

Merge activity

## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing the `authorizeNode` function by improving type handling for request headers and refactoring how headers are accessed. It introduces a type guard for distinguishing between header types and updates the way headers are retrieved in various functions.

### Detailed summary
- Updated `req` type in `AuthInput` to allow `Request`.
- Added `isNodeHeaders` function to differentiate between `IncomingHttpHeaders` and `Headers`.
- Refactored `getHeader` function to use `isNodeHeaders` for retrieving headers.
- Modified `extractAuthorizationData` to use `getHeader` for constructing the URL.
- Updated `logHttpRequest` to use `getHeader` for SDK-related headers.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-queue Adds the pull request to Graphite's merge queue. packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants