Skip to content

Commit c1d0caa

Browse files
committed
Initial scaffold with test plan
Skeleton for activeadmin-oidc: gemspec, Gemfile, Rakefile, lib/ entry point, version, MIT license, README. Full TDD/BDD test plan locked in docs/TEST_PLAN.md before any implementation code is written. The gem will depend on omniauth_openid_connect for the OIDC protocol layer and add ActiveAdmin-specific wiring: JIT user provisioning, role mapping, email-migration fallback, Zitadel preset, login view override, and an install generator.
0 parents  commit c1d0caa

11 files changed

Lines changed: 510 additions & 0 deletions

File tree

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/.bundle/
2+
/.yardoc
3+
/_yardoc/
4+
/coverage/
5+
/doc/
6+
/pkg/
7+
/spec/reports/
8+
/spec/examples.txt
9+
/tmp/
10+
*.gem
11+
.DS_Store
12+
.rspec_status
13+
/Gemfile.lock
14+
/spec/dummy/log/
15+
/spec/dummy/tmp/
16+
/spec/dummy/db/*.sqlite3
17+
/spec/dummy/db/*.sqlite3-journal
18+
/spec/dummy/storage/

.rspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--require spec_helper
2+
--format documentation
3+
--color

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.3.10

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# frozen_string_literal: true
2+
3+
source "https://rubygems.org"
4+
5+
gemspec

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Igor Fedoronchuk
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# activeadmin-oidc
2+
3+
> Status: pre-alpha — test plan only. No implementation yet.
4+
5+
OpenID Connect single sign-on for [ActiveAdmin](https://activeadmin.info/), with a first-class [Zitadel](https://zitadel.com/) preset.
6+
7+
This gem plugs generic OIDC SSO into ActiveAdmin's existing Devise stack. It builds on [`omniauth_openid_connect`](https://github.com/omniauth/omniauth_openid_connect) for the OIDC protocol and adds the wiring ActiveAdmin apps actually need: JIT user provisioning, role mapping from provider claims, a Zitadel preset for the nested `urn:zitadel:iam:org:project:roles` claim, a login-view override, and a single install generator.
8+
9+
## Why not just follow the ActiveAdmin wiki?
10+
11+
The [ActiveAdmin OAuth wiki recipe](https://github.com/activeadmin/activeadmin/wiki/Log-in-through-OAuth-providers) is a 200-line copy-paste that only covers Google and doesn't handle role mapping, account linking, or Zitadel's claim shape. This gem packages the wiring once so you can `rails g activeadmin_oidc:install` and be done.
12+
13+
## What this gem does NOT reimplement
14+
15+
The OIDC protocol layer — discovery, JWKS, token verification, PKCE, nonce, state — is delegated to the maintained upstream [`omniauth_openid_connect`](https://github.com/omniauth/omniauth_openid_connect) gem. This gem is a convention-over-configuration wrapper, not a new OIDC client.
16+
17+
## Status and roadmap
18+
19+
Design and test plan are locked. See [`docs/TEST_PLAN.md`](docs/TEST_PLAN.md) for the full TDD/BDD roadmap. Implementation follows red-green-refactor in this order:
20+
21+
1. `Configuration`
22+
2. `Discovery` wrapper over omniauth_openid_connect discovery
23+
3. `RoleResolver`
24+
4. `UserProvisioner`
25+
5. `Presets::Zitadel`
26+
6. Rails engine, routes, `SessionsController`
27+
7. Install generator
28+
8. Security hardening pass
29+
30+
## License
31+
32+
MIT — see [`LICENSE.txt`](LICENSE.txt).

Rakefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# frozen_string_literal: true
2+
3+
require "bundler/gem_tasks"
4+
5+
begin
6+
require "rspec/core/rake_task"
7+
RSpec::Core::RakeTask.new(:spec)
8+
task default: :spec
9+
rescue LoadError
10+
# rspec not available
11+
end

activeadmin-oidc.gemspec

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# frozen_string_literal: true
2+
3+
require_relative "lib/activeadmin/oidc/version"
4+
5+
Gem::Specification.new do |spec|
6+
spec.name = "activeadmin-oidc"
7+
spec.version = ActiveAdmin::Oidc::VERSION
8+
spec.authors = ["Igor Fedoronchuk"]
9+
spec.summary = "OpenID Connect SSO for ActiveAdmin with a Zitadel preset"
10+
spec.description = <<~DESC
11+
activeadmin-oidc plugs generic OpenID Connect single sign-on into ActiveAdmin.
12+
It builds on Devise + omniauth_openid_connect and adds JIT user provisioning,
13+
role mapping from provider claims, a Zitadel preset, and a single install
14+
generator that wires everything up.
15+
DESC
16+
spec.license = "MIT"
17+
spec.homepage = "https://github.com/fedoronchuk/activeadmin-oidc"
18+
19+
spec.required_ruby_version = ">= 3.3.0"
20+
21+
spec.files = Dir[
22+
"lib/**/*",
23+
"app/**/*",
24+
"config/**/*",
25+
"docs/**/*",
26+
"README.md",
27+
"LICENSE.txt"
28+
]
29+
spec.require_paths = ["lib"]
30+
31+
spec.add_dependency "activeadmin", ">= 3.0"
32+
spec.add_dependency "devise", ">= 4.9"
33+
spec.add_dependency "omniauth", ">= 2.1"
34+
spec.add_dependency "omniauth-rails_csrf_protection", ">= 1.0"
35+
spec.add_dependency "omniauth_openid_connect", ">= 0.7"
36+
spec.add_dependency "rails", ">= 7.2"
37+
38+
spec.add_development_dependency "rspec-rails", ">= 6.0"
39+
spec.add_development_dependency "webmock", ">= 3.19"
40+
spec.add_development_dependency "jwt", ">= 2.7"
41+
spec.add_development_dependency "sqlite3", ">= 1.7"
42+
spec.add_development_dependency "rake", ">= 13.0"
43+
spec.add_development_dependency "rubocop", ">= 1.60"
44+
spec.add_development_dependency "rubocop-rails", ">= 2.20"
45+
spec.add_development_dependency "rubocop-rspec", ">= 2.25"
46+
47+
spec.metadata["rubygems_mfa_required"] = "true"
48+
end

0 commit comments

Comments
 (0)