Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 33 additions & 58 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
このファイルは Claude Code (claude.ai/code) がこのリポジトリで作業する際のガイダンスを提供します。

## プロジェクト概要

EcAuth Identity Providerで使用される共通ユーティリティライブラリです。NuGetパッケージとしてGitHub Packagesで配布されます。
EcAuth Identity Provider で使用される共通ユーティリティライブラリです。NuGet パッケージとして GitHub Packages で配布されます。

## 関連リポジトリ

| リポジトリ | 説明 |
|--------------------------------------------------------------------------|-----------------------------------------|
| [EcAuth](https://github.com/EcAuth/EcAuth) | IdentityProvider メインアプリケーション |
| [EcAuth.MockIdP](https://github.com/EcAuth/EcAuth.MockIdP) | E2E テスト用モック IdP |
| [ecauth-infrastructure](https://github.com/EcAuth/ecauth-infrastructure) | IaC(Terraform + Ansible) |
| [EcAuthDocs](https://github.com/EcAuth/EcAuthDocs) | 設計ドキュメント |

## プロジェクト構造

```
EcAuth.IdpUtilities/
├── src/
│ └── EcAuth.IdpUtilities/ # メインライブラリプロジェクト
│ ├── EmailHashUtil.cs # メールアドレスハッシュ化
│ ├── Iron.cs # Stateパラメータ暗号化(Iron仕様実装)
│ ├── RandomUtil.cs # セキュアランダム文字列生成
│ └── Migrations/ # EF Core マイグレーション用ヘルパー
├── tests/
│ └── EcAuth.IdpUtilities.Test/ # xUnit ユニットテスト
│ ├── EmailHashUtilTests.cs
│ ├── IronTests.cs
│ └── RandomUtil.cs
├── .github/
│ └── workflows/
│ ├── ci.yml # CI (ビルド・テスト)
│ └── publish-nuget.yml # NuGet パッケージ公開
├── EcAuth.IdpUtilities.sln
├── README.md
├── CLAUDE.md
└── LICENSE
├── src/EcAuth.IdpUtilities/ # メインライブラリプロジェクト
│ ├── EmailHashUtil.cs # メールアドレスハッシュ化
│ ├── Iron.cs # State パラメータ暗号化(Iron 仕様実装)
│ ├── RandomUtil.cs # セキュアランダム文字列生成
│ └── Migrations/ # EF Core マイグレーション用ヘルパー
├── tests/EcAuth.IdpUtilities.Test/ # xUnit ユニットテスト
└── .github/workflows/
├── ci.yml # CI (ビルド・テスト)
└── publish-nuget.yml # NuGet パッケージ公開
```

## 開発コマンド
Expand All @@ -39,7 +38,7 @@ EcAuth.IdpUtilities/
# ソリューション全体のビルド
dotnet build EcAuth.IdpUtilities.sln

# Releaseビルド
# Release ビルド
dotnet build --configuration Release
```

Expand Down Expand Up @@ -76,50 +75,36 @@ dotnet pack src/EcAuth.IdpUtilities/EcAuth.IdpUtilities.csproj --configuration R
git push origin v1.0.0
```

2. GitHub Actionsワークフロー(`publish-nuget.yml`)が自動的に実行され、GitHub Packagesに公開されます。

### ローカルからの公開(手動)

```bash
# GitHub Packages に公開
dotnet nuget push ./artifacts/EcAuth.IdpUtilities.1.0.0.nupkg \
--source https://nuget.pkg.github.com/EcAuth/index.json \
--api-key YOUR_GITHUB_PAT
```
2. GitHub Actions ワークフロー(`publish-nuget.yml`)が自動的に実行され、GitHub Packages に公開されます。

## バージョニング
### バージョニング

- セマンティックバージョニング(SemVer)を使用
- `src/EcAuth.IdpUtilities/EcAuth.IdpUtilities.csproj` の `<Version>` タグを更新
- リリース時は対応するGitタグを作成(例: `v1.0.0`)
- リリース時は対応する Git タグを作成(例: `v1.0.0`)

## 依存関係

- .NET 9.0
- DotNetEnv (3.1.1)
- Microsoft.EntityFrameworkCore.SqlServer (9.0.9)
- System.Text.Json (9.0.9)
- System.IdentityModel.Tokens.Jwt (8.14.0)
- Microsoft.IdentityModel.Tokens (8.14.0)
- Microsoft.EntityFrameworkCore.SqlServer (9.0.x)
- System.Text.Json (9.0.x)
- System.IdentityModel.Tokens.Jwt (8.x)
- Microsoft.IdentityModel.Tokens (8.x)

## コーディング規約

- 行末の空白は削除
- 改行コードはLF
- Null許容参照型を有効化(`<Nullable>enable</Nullable>`)
- 暗黙的usingsを有効化(`<ImplicitUsings>enable</ImplicitUsings>`)
- 改行コードは LF
- Null 許容参照型を有効化(`<Nullable>enable</Nullable>`)
- 暗黙的 usings を有効化(`<ImplicitUsings>enable</ImplicitUsings>`)

## CI/CD

### GitHub Actions ワークフロー

- **CI (`.github/workflows/ci.yml`)**:
- PR作成時に自動実行
- ビルド・テストの成功を確認

- **NuGet Publish (`.github/workflows/publish-nuget.yml`)**:
- タグプッシュ時(`v*`)に自動実行
- GitHub Packagesにパッケージを公開
- **CI (`.github/workflows/ci.yml`)**: PR 作成時に自動実行、ビルド・テストの成功を確認
- **NuGet Publish (`.github/workflows/publish-nuget.yml`)**: タグプッシュ時(`v*`)に自動実行、GitHub Packages にパッケージを公開

## トラブルシューティング

Expand All @@ -140,13 +125,3 @@ dotnet build
# 特定のテストを実行して詳細確認
dotnet test --filter FullyQualifiedName~EmailHashUtilTests --verbosity detailed
```

### NuGet パッケージが見つからない

GitHub PackagesからのNuGetパッケージ取得には認証が必要です。`nuget.config`を確認してください。

## 関連リポジトリ

- [EcAuth](https://github.com/EcAuth/EcAuth) - メインIdentity Providerアプリケーション
- [EcAuth.MockIdP](https://github.com/EcAuth/EcAuth.MockIdP) - E2Eテスト用モックIdP
- [ecauth-infrastructure](https://github.com/EcAuth/ecauth-infrastructure) - IaC(Terraform + Ansible)
Loading