standard_id-apple 0.1.2 → 0.3.0

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: 3c67afb888da7a7a20542d46149eaf86215d02de9c097a757b98223f4c992811
4
- data.tar.gz: b905edd16718f7fee932b567250a7caa5136d1cf64f82030668b7bcb8dd40d87
3
+ metadata.gz: d28b3018e3f7fc20688cfddeb71fbe217a4582cda164801c248e33ea9186b14b
4
+ data.tar.gz: aa60781200a04bffbc7fe7e3103a2db6cb7309856cf7129f17442f98af4ad6d5
5
5
  SHA512:
6
- metadata.gz: fdd51606e4a08272c10bae448cecbf0472e8449a5679229013138b5fed0abef6f2e404ef1ef495731a1744c58538fbfc1c141af974ad02c825212a5a51adffc1
7
- data.tar.gz: 58e35ebc3804fd52719774db5a63229918e0c89462dca2b7f654a8a57820389549044c1ca42e27cf46155afc6617942084e1ce41b650866c9ba0a049e7599289
6
+ metadata.gz: c2e6d33e993110034869730d54aba8f507ffb4871ca9f4c6049dd85da2c744e8e0ef097d6954bef6d0ed13fd7f2ac5f7e3504fa7b61ad542358ff03b941442ef
7
+ data.tar.gz: 2d586fd41238374119a596c002cb2718b7ed81c405e8b8eb4927fd9190fedc621a4cd0998f2867582ad73cf2b6eec022be825a3f9edfadfdfed62a9d88429784
data/.editorconfig ADDED
@@ -0,0 +1,15 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = space
5
+ indent_size = 2
6
+ end_of_line = lf
7
+ charset = utf-8
8
+ trim_trailing_whitespace = true
9
+ insert_final_newline = true
10
+
11
+ [*.md]
12
+ trim_trailing_whitespace = false
13
+
14
+ [Makefile]
15
+ indent_style = tab
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.4.4
1
+ 4.0.1
data/AGENTS.md ADDED
@@ -0,0 +1,72 @@
1
+ # AGENTS.md - AI Agent Guide for standard_id-apple
2
+
3
+ `standard_id-apple` is a provider plugin for the [StandardId](https://github.com/rarebit-one/standard_id) authentication engine. It packages a `StandardId::Providers::Apple` implementation for Sign in with Apple, and auto-registers itself with the host StandardId installation via a `Rails::Railtie` so apps that bundle the gem don't need an explicit initializer.
4
+
5
+ ## Quick Reference
6
+
7
+ ```bash
8
+ # Run tests
9
+ bundle exec rspec
10
+
11
+ # Run a single spec file
12
+ bundle exec rspec spec/standard_id/apple/providers/apple_spec.rb
13
+
14
+ # Run linting (note: --config flag is required on Ruby 4.0)
15
+ bundle exec rubocop --config .rubocop.yml
16
+
17
+ # Auto-fix lint issues
18
+ bundle exec rubocop --config .rubocop.yml -A
19
+ ```
20
+
21
+ ## Project Structure
22
+
23
+ ```
24
+ standard_id-apple/
25
+ ├── lib/standard_id/
26
+ │ ├── apple.rb # Top-level require entrypoint
27
+ │ └── apple/
28
+ │ ├── version.rb # Gem version constant
29
+ │ ├── railtie.rb # Auto-registers provider on after_initialize
30
+ │ └── providers/apple.rb # StandardId::Providers::Apple implementation
31
+ └── spec/
32
+ ├── spec_helper.rb # Boots a minimal Rails app so the Railtie fires
33
+ └── standard_id/ # Provider specs
34
+ ```
35
+
36
+ ## Key Patterns
37
+
38
+ ### Provider class
39
+
40
+ `StandardId::Providers::Apple` inherits from `StandardId::Providers::Base` (defined in the parent `standard_id` gem) and implements the provider contract: `provider_name`, `authorization_url`, `get_user_info`, `config_schema`, plus Apple-specific helpers (`verify_id_token`, `generate_client_secret`, JWKS fetching).
41
+
42
+ ### Railtie auto-registration
43
+
44
+ `StandardId::Apple::Railtie` runs on `config.after_initialize` and calls `StandardId::ProviderRegistry.register(:apple, StandardId::Providers::Apple)`. Host apps just need the gem in their Gemfile — no initializer required.
45
+
46
+ ### Spec bootstrapping
47
+
48
+ `spec/spec_helper.rb` defines a tiny `Rails::Application` and calls `Rails.application.initialize!` so the Railtie's `after_initialize` hook fires during the spec run; without this the provider would not appear in the registry.
49
+
50
+ ## Key Files
51
+
52
+ | File | Purpose |
53
+ |------|---------|
54
+ | `lib/standard_id/apple.rb` | Top-level require entrypoint |
55
+ | `lib/standard_id/apple/railtie.rb` | Provider registration on Rails boot |
56
+ | `lib/standard_id/apple/providers/apple.rb` | Apple provider implementation |
57
+ | `lib/standard_id/apple/version.rb` | Gem version constant |
58
+ | `standard_id-apple.gemspec` | Gem metadata + runtime deps |
59
+
60
+ ## Dependencies
61
+
62
+ - **standard_id** `~> 0.1`, `>= 0.1.7` (parent engine — provides `Providers::Base`, `ProviderRegistry`, errors)
63
+ - **activesupport** `>= 8.0` (`Time.current`, `present?`/`blank?`, indifferent access)
64
+ - **jwt** `~> 2.7` (id_token decoding, client_secret signing)
65
+
66
+ Dev: rspec, rubocop, webmock, lefthook.
67
+
68
+ ## Testing
69
+
70
+ - WebMock stubs Apple's JWKS and token endpoints — never make real network calls in specs.
71
+ - The dummy Rails app in `spec_helper.rb` is intentionally minimal; add config via `StandardId.config.apple_*` setters in individual specs rather than expanding the dummy app.
72
+ - CI runs the full Ruby 4.0.x patch matrix via the shared `rarebit-one/.github` reusable workflow.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
1
8
  ## [Unreleased]
2
9
 
10
+ ## [0.3.0] - 2026-04-29
11
+
12
+ ### Added
13
+
14
+ - `.editorconfig` and `AGENTS.md` for dev tooling parity with the parent `standard_id` gem.
15
+ - SimpleCov branch coverage reporting in `spec/spec_helper.rb`. No minimum threshold is enforced; `coverage/` is gitignored.
16
+
17
+ ### Changed
18
+
19
+ - CI and release workflows migrated to the shared `rarebit-one/.github` reusable workflows (`reusable-gem-ci.yml@v1`, `reusable-gem-release.yml@v1`); `.github/workflows/ci.yml` and `release.yml` are now thin shims.
20
+ - CI matrix expanded to all four Ruby 4.0.x patch releases (`4.0.0`, `4.0.1`, `4.0.2`, `4.0.3`) and lint pinned to `4.0.3`. Branch protection will be updated post-merge to require the consolidated `ci / test` aggregator (added in `rarebit-one/.github#6`) instead of per-version checks, so future Ruby version churn won't require updating protection.
21
+
22
+ ### Removed
23
+
24
+ - **BREAKING:** Dropped support for Ruby < 4.0. `required_ruby_version` is now `>= 4.0`. Aligns with `standard_id` (the parent gem) which made the same break in [rarebit-one/standard_id#195](https://github.com/rarebit-one/standard_id/pull/195) — host apps must upgrade to Ruby 4.0+ before bundling this version.
25
+
26
+ ## [0.2.0] - 2026-04-21
27
+
28
+ ### Added
29
+
30
+ - Auto-register provider with StandardId via `Rails::Railtie` on `config.after_initialize`, so apps that bundle the gem no longer need an explicit initializer (#30)
31
+
32
+ ## [0.1.2] - 2026-01-13
33
+
34
+ ### Added
35
+
36
+ - Support nonce and passing custom parameters to Apple Sign In (#2)
37
+
38
+ ## [0.1.1] - 2025-12-24
39
+
40
+ ### Changed
41
+
42
+ - Standardized config access patterns
43
+
3
44
  ## [0.1.0] - 2025-12-20
4
45
 
5
- - Initial release
46
+ ### Added
47
+
48
+ - Initial release of Apple Sign In provider plugin for StandardId
data/CLAUDE.md ADDED
@@ -0,0 +1,26 @@
1
+ # CLAUDE.md
2
+
3
+ ## Worktree-Only Workflow (Enforced)
4
+
5
+ **All file modifications are blocked in the main checkout.** A PreToolUse hook (`enforce-worktree.sh`) rejects Edit, Write, and NotebookEdit operations targeting files outside a worktree. There are no opt-outs. Do not use Bash to write files in the main checkout either (e.g., `echo >`, `sed -i`, `tee`, `cp`) — the hook cannot intercept shell commands, so this rule is instruction-enforced.
6
+
7
+ Before writing any code, create a worktree:
8
+
9
+ ```bash
10
+ DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@refs/remotes/origin/@@')
11
+ DEFAULT_BRANCH=${DEFAULT_BRANCH:-main}
12
+ git fetch origin "$DEFAULT_BRANCH"
13
+ git worktree add .worktrees/<name> -b <branch-name> "origin/$DEFAULT_BRANCH"
14
+ ```
15
+
16
+ Then work inside `.worktrees/<name>/` for the rest of the session.
17
+
18
+ **Naming:** Use the Linear issue identifier if available (e.g., `.worktrees/<identifier>`), a task slug (e.g., `.worktrees/fix-auth-timeout`), or today's date (e.g., `.worktrees/2026-04-01`) as fallback.
19
+
20
+ **The hook allows modifications only when:**
21
+
22
+ 1. The file is inside a git worktree (detected via `git rev-parse --git-dir` returning a path under `.git/worktrees/`)
23
+ 2. Running in a CI/automated context where the checkout is already isolated
24
+ **Why this matters:** Working directly on the main checkout causes cross-contamination between sessions — uncommitted changes, wrong branches, and dirty state leak into unrelated work. Worktrees eliminate this entirely.
25
+
26
+ See the `/worktree` and `/start` skills for full conventions and flags.
@@ -240,5 +240,3 @@ module StandardId
240
240
  end
241
241
  end
242
242
  end
243
-
244
- StandardId::ProviderRegistry.register(:apple, StandardId::Providers::Apple)
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module StandardId
4
+ module Apple
5
+ class Railtie < ::Rails::Railtie
6
+ config.after_initialize do
7
+ StandardId::ProviderRegistry.register(:apple, StandardId::Providers::Apple)
8
+
9
+ Rails.logger.debug("[StandardId::Apple] registered provider") if Rails.logger
10
+ end
11
+ end
12
+ end
13
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module StandardId
4
4
  module Apple
5
- VERSION = "0.1.2"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
@@ -2,3 +2,4 @@ require "active_support/core_ext/numeric/time"
2
2
  require "active_support/core_ext/hash/indifferent_access"
3
3
  require "standard_id"
4
4
  require "standard_id/apple/providers/apple"
5
+ require "standard_id/apple/railtie" if defined?(Rails)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard_id-apple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaryl Sim
@@ -65,16 +65,20 @@ executables: []
65
65
  extensions: []
66
66
  extra_rdoc_files: []
67
67
  files:
68
+ - ".editorconfig"
68
69
  - ".rspec"
69
70
  - ".rubocop.yml"
70
71
  - ".ruby-version"
72
+ - AGENTS.md
71
73
  - CHANGELOG.md
74
+ - CLAUDE.md
72
75
  - CODE_OF_CONDUCT.md
73
76
  - LICENSE.txt
74
77
  - README.md
75
78
  - Rakefile
76
79
  - lib/standard_id/apple.rb
77
80
  - lib/standard_id/apple/providers/apple.rb
81
+ - lib/standard_id/apple/railtie.rb
78
82
  - lib/standard_id/apple/version.rb
79
83
  homepage: https://github.com/rarebit-one/standard_id_apple
80
84
  licenses:
@@ -83,6 +87,7 @@ metadata:
83
87
  homepage_uri: https://github.com/rarebit-one/standard_id_apple
84
88
  source_code_uri: https://github.com/rarebit-one/standard_id_apple
85
89
  changelog_uri: https://github.com/rarebit-one/standard_id_apple/blob/main/CHANGELOG.md
90
+ bug_tracker_uri: https://github.com/rarebit-one/standard_id_apple/issues
86
91
  rdoc_options: []
87
92
  require_paths:
88
93
  - lib
@@ -90,14 +95,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
95
  requirements:
91
96
  - - ">="
92
97
  - !ruby/object:Gem::Version
93
- version: 3.2.0
98
+ version: '4.0'
94
99
  required_rubygems_version: !ruby/object:Gem::Requirement
95
100
  requirements:
96
101
  - - ">="
97
102
  - !ruby/object:Gem::Version
98
103
  version: '0'
99
104
  requirements: []
100
- rubygems_version: 3.6.7
105
+ rubygems_version: 4.0.3
101
106
  specification_version: 4
102
107
  summary: Apple Sign In provider plugin for the StandardId engine.
103
108
  test_files: []