Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Beyond the contract, this module ships the **shared infrastructure** every adapt
- A ready-to-use reactive `IdpController` (auto-mounted under `/idp`) that exposes every `IdpAdapter` operation over HTTP — it is registered automatically by `IdpWebAutoConfiguration` as soon as an `IdpAdapter` bean is present in a reactive web application.
- Cross-cutting `IdpMetrics` (Micrometer) auto-configured via `IdpObservabilityAutoConfiguration`, giving uniform authentication, token and error metrics regardless of which provider is active.

The concrete provider is selected at runtime with the `firefly.idp.provider` property; each adapter activates itself with `@ConditionalOnProperty(name = "firefly.idp.provider", havingValue = "<provider>")`. You depend on this core plus exactly one provider adapter.
The concrete provider is selected at runtime with the `firefly.security.idp.provider` property; each adapter activates itself with `@ConditionalOnProperty(name = "firefly.security.idp.provider", havingValue = "<provider>")`. You depend on this core plus exactly one provider adapter.

### Provider adapters

Expand All @@ -55,7 +55,7 @@ The concrete provider is selected at runtime with the `firefly.idp.provider` pro
- **Drop-in REST controller** — `IdpController` exposes all of the above under `/idp` with zero boilerplate, auto-configured only when an `IdpAdapter` bean exists in a reactive web app.
- **Built-in observability** — `IdpMetrics` records authentication counts/latency, tokens issued/refreshed and errors, tagged by `provider`.
- **Vendor-neutral DTOs** — a complete, validated DTO surface (`jakarta.validation`) shared by all adapters.
- **Pluggable by property** — switch providers with `firefly.idp.provider` and a single dependency swap; no code changes.
- **Pluggable by property** — switch providers with `firefly.security.idp.provider` and a single dependency swap; no code changes.

## Requirements

Expand Down Expand Up @@ -143,7 +143,7 @@ Because every operation returns a Reactor `Mono`, the adapter composes cleanly i

## Configuration

This core module exposes a single property under the `firefly.idp` prefix; provider-specific keys (e.g. `firefly.idp.keycloak.*`, `firefly.idp.cognito.*`) are documented by each adapter module.
This core module exposes a single property under the `firefly.security.idp` prefix; provider-specific keys (e.g. `firefly.security.idp.keycloak.*`, `firefly.security.idp.cognito.*`) are documented by each adapter module.

```yaml
firefly:
Expand All @@ -156,7 +156,7 @@ firefly:

| Property | Default | Description |
| --- | --- | --- |
| `firefly.idp.provider` | _(none, required)_ | Selects the active IDP adapter. One of `keycloak`, `cognito`, `azure-ad`, `internal-db`. Validated as `@NotBlank` via `IdpProperties`. |
| `firefly.security.idp.provider` | _(none, required)_ | Selects the active IDP adapter. One of `keycloak`, `cognito`, `azure-ad`, `internal-db`. Validated as `@NotBlank` via `IdpProperties`. |
| `firefly.observability.metrics.enabled` | `true` | When `true` (or absent), registers the `IdpMetrics` bean. Set to `false` to disable IDP metrics. |

Auto-configuration entry points (`META-INF/spring/...AutoConfiguration.imports`):
Expand Down Expand Up @@ -196,11 +196,11 @@ When the `IdpController` is auto-mounted, the following endpoints are exposed un

`IdpMetrics` (auto-configured) records, all tagged by `provider`:

- `firefly.idp.authentications` — total auth attempts, tagged `status=success|failure`
- `firefly.idp.authentication.duration` — authentication latency timer
- `firefly.idp.token.issued` — tokens issued, tagged `token.type`
- `firefly.idp.token.refreshed` — token refreshes
- `firefly.idp.errors` — failed IDP operations, tagged `operation`, `error.type`
- `firefly.security.idp.authentications` — total auth attempts, tagged `status=success|failure`
- `firefly.security.idp.authentication.duration` — authentication latency timer
- `firefly.security.idp.token.issued` — tokens issued, tagged `token.type`
- `firefly.security.idp.token.refreshed` — token refreshes
- `firefly.security.idp.errors` — failed IDP operations, tagged `operation`, `error.type`

Adapters wrap their authentication calls with `IdpMetrics.timedAuthentication(provider, mono)` to get success/failure counters and the latency timer for free.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

@Data
@Validated
@ConfigurationProperties(prefix = "firefly.idp")
@ConfigurationProperties(prefix = "firefly.security.idp")
public class IdpProperties {

@NotBlank(message = "IDP provider must be specified (keycloak, cognito, or internal-db)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
* <p>
* Records:
* <ul>
* <li>{@code firefly.idp.authentications} — total auth attempts, tagged by {@code provider}, {@code status=success|failure}</li>
* <li>{@code firefly.idp.authentication.duration} — auth latency timer, tagged by {@code provider}</li>
* <li>{@code firefly.idp.token.issued} — total tokens issued, tagged by {@code provider}, {@code token.type}</li>
* <li>{@code firefly.idp.token.refreshed} — token refresh count, tagged by {@code provider}</li>
* <li>{@code firefly.idp.errors} — failed IDP operations, tagged by {@code operation}, {@code error.type}</li>
* <li>{@code firefly.security.idp.authentications} — total auth attempts, tagged by {@code provider}, {@code status=success|failure}</li>
* <li>{@code firefly.security.idp.authentication.duration} — auth latency timer, tagged by {@code provider}</li>
* <li>{@code firefly.security.idp.token.issued} — total tokens issued, tagged by {@code provider}, {@code token.type}</li>
* <li>{@code firefly.security.idp.token.refreshed} — token refresh count, tagged by {@code provider}</li>
* <li>{@code firefly.security.idp.errors} — failed IDP operations, tagged by {@code operation}, {@code error.type}</li>
* </ul>
*/
public class IdpMetrics extends FireflyMetricsSupport {
Expand Down
Loading