-
Notifications
You must be signed in to change notification settings - Fork 29
Stability fixes, Laravel compatibility updates, EPO OPS improvements & initial implementation of USPTO ODP #180
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
Open
srdco
wants to merge
23
commits into
jjdejong:master
Choose a base branch
from
srdco:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+677
−37
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
afc7aa0
Fix OPS family import when applicants/inventors are missing
srdco 280eac9
Merge pull request #16 from srdco/codex/fix-error-when-creating-matte…
srdco cbab030
Fix MySQL SSL option constant for PHP compatibility
srdco 0ed826f
Merge pull request #17 from srdco/codex/fix-error-when-creating-matte…
srdco 5da49a0
Replace Auth::routes macro with explicit auth routes
srdco bc4199d
Merge pull request #18 from srdco/codex/fix-error-when-creating-matte…
srdco e0db37e
Add USPTO ODP setup and usage manual
srdco e34c4a9
Clarify ODP manual scope and remove PDO troubleshooting
srdco 0f79768
Refocus USPTO guide on end-user usage only
srdco 9aa9000
Merge pull request #19 from srdco/codex/fix-error-when-creating-matte…
srdco c671652
Merge branch 'jjdejong:master' into master
srdco 7fb0096
Default USPTO ODP endpoints and remove mandatory endpoint setup
srdco 4540049
Merge branch 'master' into codex/fix-error-when-creating-matter-from-…
srdco f50ddcf
Merge pull request #20 from srdco/codex/fix-error-when-creating-matte…
srdco 05b0f3a
Make login controller version-agnostic across Laravel releases
srdco 0db3e67
Merge pull request #21 from srdco/codex/fix-login-error-in-logincontr…
srdco 64b54fe
Handle duplicate matter-actor links when adding actors
srdco 85fce5f
Merge pull request #22 from srdco/codex/fix-unique-constraint-violati…
srdco e04d802
Merge pull request #23 from jjdejong/master
srdco ef160d9
Add GitHub Actions workflow for OpenCode
srdco 594d72c
Delete .github directory
srdco e2e8702
Document USPTO ODP beta status
srdco 71a4319
Merge pull request #24 from srdco/codex/update-readme-and-wiki-for-ne…
srdco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| <?php | ||
|
|
||
| namespace App\Services; | ||
|
|
||
| /** | ||
| * Family data orchestrator with dynamic provider selection. | ||
| * | ||
| * Default behavior uses OPS for full family retrieval, then enriches US members | ||
| * from USPTO ODP when enabled/configured. | ||
| */ | ||
| class FamilyDataService | ||
| { | ||
| public function __construct( | ||
| private OPSService $opsService, | ||
| private USPTOService $usptoService | ||
| ) { | ||
| } | ||
|
|
||
| /** | ||
| * Get family members with OPS primary source and USPTO fallback/enrichment. | ||
| * | ||
| * @param string $docnum | ||
| * @return array | ||
| */ | ||
| public function getFamilyMembers(string $docnum): array | ||
| { | ||
| $apps = $this->opsService->getFamilyMembers($docnum); | ||
| if (array_key_exists('errors', $apps) || array_key_exists('exception', $apps)) { | ||
| // If the requested number looks US, return a synthetic single-member family | ||
| // from USPTO ODP when possible. | ||
| if ($this->isUSDocument($docnum)) { | ||
| $member = $this->buildUSMemberFromODP($docnum); | ||
| if (!empty($member)) { | ||
| return [$member]; | ||
| } | ||
| } | ||
|
|
||
| return $apps; | ||
| } | ||
|
|
||
| return $this->usptoService->enrichFamilyMembers($apps); | ||
| } | ||
|
|
||
| private function isUSDocument(string $docnum): bool | ||
| { | ||
| return str_starts_with(strtoupper(trim($docnum)), 'US'); | ||
| } | ||
|
|
||
| private function buildUSMemberFromODP(string $docnum): array | ||
| { | ||
| $number = preg_replace('/\D/', '', $docnum); | ||
| if (!$number) { | ||
| return []; | ||
| } | ||
|
|
||
| $odData = $this->usptoService->getApplicationData($number); | ||
| if (empty($odData)) { | ||
| return []; | ||
| } | ||
|
|
||
| return [ | ||
| 'id' => 'US' . $number, | ||
| 'app' => [ | ||
| 'country' => 'US', | ||
| 'number' => ltrim($number, '0'), | ||
| 'kind' => 'A', | ||
| 'date' => null, | ||
| ], | ||
| 'pri' => [], | ||
| 'pct' => null, | ||
| 'div' => null, | ||
| 'cnt' => null, | ||
| 'title' => $odData['title'] ?? null, | ||
| 'applicants' => $odData['applicants'] ?? [], | ||
| 'inventors' => $odData['inventors'] ?? [], | ||
| 'procedure' => $odData['procedure'] ?? [], | ||
| ]; | ||
| } | ||
| } | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The manual implementation of the login logic lacks rate limiting, which was previously provided by the
AuthenticatesUserstrait (via theThrottlesLoginstrait it uses). This leaves the login endpoint vulnerable to brute-force attacks. Since you are avoiding framework traits for stability, consider implementing rate limiting manually using Laravel'sRateLimiterfacade within theloginmethod to maintain security parity.