omniauth-yahoojp 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cef0fc73e6ad6338ec0f4a4180774ab663b9a0846ad2e7658f9a4c3fd395b454
4
- data.tar.gz: 37e8e9ef4282fc449ea7d489ef4a43ea4ab0d231c7ddda5a6163b932c899d7ac
3
+ metadata.gz: 3e2e5091640143dd38a711507353562df857f8f78a58c533515b8f16cc498ea5
4
+ data.tar.gz: 8017e5b101087d514d661455e6a51e40d17397a3642aa2863183863ee37c4ba4
5
5
  SHA512:
6
- metadata.gz: cf6a1d9162d5855cd7ed66074b9f5d275312024602fb956a9e367e522aeaf36d3637c73856c3cd94b3dcc5f0d53ea01697aec948370689b766d0b6f6890a29c3
7
- data.tar.gz: 84aa02e550b3fd6bbc286912be6181b484b2d7d1db6ab6ff8792a9819575b08b0c77e406b56045fdac3073cb4900500eb07a7ab91641de909ffb1881d8953043
6
+ metadata.gz: 3768a8277939e04cb7bfaa0802b4e419f25df351d99a15d7f50ea2d710134b00179914eeb030c42af12370a6d815b8281cd8f0474dc32f325a0400b572f43e76
7
+ data.tar.gz: e7565557e3f45447be3c612a4aeb66cad363112a395a96ecbfbf73fb420e8ce2a7af9116624961a383ca2522f07e60a98f87781d1abfd4e741c1b7e509980d8f
data/CLAUDE.md CHANGED
@@ -44,6 +44,6 @@ This is a Ruby gem that implements an OmniAuth strategy for Yahoo! JAPAN's YConn
44
44
 
45
45
  ## Downstream Test Project
46
46
 
47
- - [`omniauth-yahoojp-tester-rails5`](https://github.com/mikanmarusan/omniauth-yahoojp-tester-rails5) is a Rails 5 app that consumes this gem for integration testing.
47
+ - [`omniauth-yahoojp-tester-containers`](https://github.com/mikanmarusan/omniauth-yahoojp-tester-containers) is an app that consumes this gem for integration testing.
48
48
  - Its CLAUDE.md documents the exact API surface used and cross-project update rules.
49
- - Use `/add-dir ../omniauth-yahoojp-tester-rails5` to add it for cross-project awareness when making API changes.
49
+ - Use `/add-dir ../omniauth-yahoojp-tester-containers` to add it for cross-project awareness when making API changes.
@@ -67,7 +67,7 @@ module OmniAuth
67
67
  access_token.options[:mode] = :header
68
68
  access_token.get('https://userinfo.yahooapis.jp/yconnect/v2/attribute').parsed
69
69
  elsif id_token
70
- id_token_claims
70
+ id_token_claims || {}
71
71
  else
72
72
  {}
73
73
  end
@@ -80,6 +80,8 @@ module OmniAuth
80
80
  def id_token_claims
81
81
  return nil unless id_token
82
82
  @id_token_claims ||= verify_id_token!
83
+ rescue JSON::JWT::InvalidFormat
84
+ nil
83
85
  end
84
86
 
85
87
  def prune!(hash)
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module YahooJp
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
@@ -118,9 +118,9 @@ RSpec.describe OmniAuth::Strategies::YahooJp do
118
118
  expect(WebMock).not_to have_requested(:get, 'https://auth.login.yahoo.co.jp/yconnect/v2/jwks')
119
119
  end
120
120
 
121
- it 'raises on malformed id_token' do
121
+ it 'returns nil on malformed id_token' do
122
122
  allow(access_token).to receive(:params).and_return({ 'id_token' => 'not-a-jwt' })
123
- expect { strategy.id_token_claims }.to raise_error(JSON::JWT::InvalidFormat)
123
+ expect(strategy.id_token_claims).to be_nil
124
124
  end
125
125
 
126
126
  context 'with invalid signature' do
@@ -327,6 +327,17 @@ RSpec.describe OmniAuth::Strategies::YahooJp do
327
327
  expect(strategy.raw_info).to eq({})
328
328
  end
329
329
  end
330
+
331
+ context 'with userinfo_access: false and malformed id_token' do
332
+ before do
333
+ strategy.options[:userinfo_access] = false
334
+ allow(access_token).to receive(:params).and_return({ 'id_token' => 'not-a-jwt' })
335
+ end
336
+
337
+ it 'returns an empty hash instead of raising' do
338
+ expect(strategy.raw_info).to eq({})
339
+ end
340
+ end
330
341
  end
331
342
 
332
343
  describe '#info' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-yahoojp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - mikanmarusan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-09 00:00:00.000000000 Z
11
+ date: 2026-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -129,8 +129,6 @@ executables: []
129
129
  extensions: []
130
130
  extra_rdoc_files: []
131
131
  files:
132
- - ".github/workflows/claude-code-review.yml"
133
- - ".github/workflows/claude.yml"
134
132
  - ".gitignore"
135
133
  - ".rspec"
136
134
  - CLAUDE.md
@@ -1,78 +0,0 @@
1
- name: Claude Code Review
2
-
3
- on:
4
- pull_request:
5
- types: [opened, synchronize]
6
- # Optional: Only run on specific file changes
7
- # paths:
8
- # - "src/**/*.ts"
9
- # - "src/**/*.tsx"
10
- # - "src/**/*.js"
11
- # - "src/**/*.jsx"
12
-
13
- jobs:
14
- claude-review:
15
- # Optional: Filter by PR author
16
- # if: |
17
- # github.event.pull_request.user.login == 'external-contributor' ||
18
- # github.event.pull_request.user.login == 'new-developer' ||
19
- # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20
-
21
- runs-on: ubuntu-latest
22
- permissions:
23
- contents: read
24
- pull-requests: read
25
- issues: read
26
- id-token: write
27
-
28
- steps:
29
- - name: Checkout repository
30
- uses: actions/checkout@v4
31
- with:
32
- fetch-depth: 1
33
-
34
- - name: Run Claude Code Review
35
- id: claude-review
36
- uses: anthropics/claude-code-action@beta
37
- with:
38
- claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39
-
40
- # Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
41
- # model: "claude-opus-4-20250514"
42
-
43
- # Direct prompt for automated review (no @claude mention needed)
44
- direct_prompt: |
45
- Please review this pull request and provide feedback on:
46
- - Code quality and best practices
47
- - Potential bugs or issues
48
- - Performance considerations
49
- - Security concerns
50
- - Test coverage
51
-
52
- Be constructive and helpful in your feedback.
53
-
54
- # Optional: Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR
55
- # use_sticky_comment: true
56
-
57
- # Optional: Customize review based on file types
58
- # direct_prompt: |
59
- # Review this PR focusing on:
60
- # - For TypeScript files: Type safety and proper interface usage
61
- # - For API endpoints: Security, input validation, and error handling
62
- # - For React components: Performance, accessibility, and best practices
63
- # - For tests: Coverage, edge cases, and test quality
64
-
65
- # Optional: Different prompts for different authors
66
- # direct_prompt: |
67
- # ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' &&
68
- # 'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' ||
69
- # 'Please provide a thorough code review focusing on our coding standards and best practices.' }}
70
-
71
- # Optional: Add specific tools for running tests or linting
72
- # allowed_tools: "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)"
73
-
74
- # Optional: Skip review for certain conditions
75
- # if: |
76
- # !contains(github.event.pull_request.title, '[skip-review]') &&
77
- # !contains(github.event.pull_request.title, '[WIP]')
78
-
@@ -1,64 +0,0 @@
1
- name: Claude Code
2
-
3
- on:
4
- issue_comment:
5
- types: [created]
6
- pull_request_review_comment:
7
- types: [created]
8
- issues:
9
- types: [opened, assigned]
10
- pull_request_review:
11
- types: [submitted]
12
-
13
- jobs:
14
- claude:
15
- if: |
16
- (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17
- (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18
- (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19
- (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20
- runs-on: ubuntu-latest
21
- permissions:
22
- contents: read
23
- pull-requests: read
24
- issues: read
25
- id-token: write
26
- actions: read # Required for Claude to read CI results on PRs
27
- steps:
28
- - name: Checkout repository
29
- uses: actions/checkout@v4
30
- with:
31
- fetch-depth: 1
32
-
33
- - name: Run Claude Code
34
- id: claude
35
- uses: anthropics/claude-code-action@beta
36
- with:
37
- claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38
-
39
- # This is an optional setting that allows Claude to read CI results on PRs
40
- additional_permissions: |
41
- actions: read
42
-
43
- # Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
44
- # model: "claude-opus-4-20250514"
45
-
46
- # Optional: Customize the trigger phrase (default: @claude)
47
- # trigger_phrase: "/claude"
48
-
49
- # Optional: Trigger when specific user is assigned to an issue
50
- # assignee_trigger: "claude-bot"
51
-
52
- # Optional: Allow Claude to run specific commands
53
- # allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
54
-
55
- # Optional: Add custom instructions for Claude to customize its behavior for your project
56
- # custom_instructions: |
57
- # Follow our coding standards
58
- # Ensure all new code has tests
59
- # Use TypeScript for new files
60
-
61
- # Optional: Custom environment variables for Claude
62
- # claude_env: |
63
- # NODE_ENV: test
64
-