Skip to content

Commit

Permalink
split ssi abilities in a specific package
Browse files Browse the repository at this point in the history
  • Loading branch information
patatoid committed Jan 18, 2025
1 parent 50421d6 commit d976f3a
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 66 deletions.
56 changes: 28 additions & 28 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) according to OAuth / OpenID connect specifications, changes may break in order to comply with those.

## [3.0.0-beta.3] - 2024-11-21
## [boruta - 3.0.0-beta.3] - 2024-11-21

### Changed

Expand All @@ -21,14 +21,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- adjustements to verifiable credential issuance and presentation

## [3.0.0-beta.2] - 2024-10-17
## [boruta - 3.0.0-beta.2] - 2024-10-17

### Added

- OpenID for Verifiable Credentials Presentation implementation
- resolve EBSI dids

## [3.0.0-beta.1] - 2024-09-01
## [boruta - 3.0.0-beta.1] - 2024-09-01

### Added

Expand All @@ -40,13 +40,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Preauthorized code flow implementation
- support for vc+sd-jwt, jwt_vc_json credentials formats

## [2.3.4] - 2024-06-10
## [boruta - 2.3.4] - 2024-06-10

### Fixed

- revoke previous issued tokens in case of code replay (authorization code grant)

## [2.3.3] - 2024-03-20
## [boruta - 2.3.3] - 2024-03-20

### Removed

Expand All @@ -56,7 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- revoke previous issued tokens in case of code replay

## [2.3.2] - 2023-12-23
## [boruta - 2.3.2] - 2023-12-23

- Note that you must run the `boruta.gen.migration` task to keep your database schema up to date while upgrading to this version.

Expand All @@ -66,14 +66,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- according to OpenID Connect core 1.0, clients have a `logo_uri` attribute
- `boruta.gen.migration` triggers a form to get statistics about boruta usage

## [2.3.1] - 2023-04-24
## [boruta - 2.3.1] - 2023-04-24

- Note that you must run the `boruta.gen.migration` task to keep your database schema up to date while upgrading to this version.

### Fixed
- public key is optional for oauth clients

## [2.3.0] - 2023-04-09
## [boruta - 2.3.0] - 2023-04-09

- Note that you must run the `boruta.gen.migration` task to keep your database schema up to date while upgrading to this version.

Expand All @@ -84,7 +84,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- handle userinfo signed responses
- client key pair regeneration admin function `Admin.regenerate_client_key_pair/1,3`

## [2.2.2] - 2022-10-25
## [boruta - 2.2.2] - 2022-10-25

- Note that you must run the `boruta.gen.migration` task to keep your database schema up to date while upgrading to this version.

Expand All @@ -95,13 +95,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- store the previous code associated with the delivered access token in authorization code grants
- prompt=none management for authorization code grant requests

## [2.2.1] - 2022-10-16
## [boruta - 2.2.1] - 2022-10-16

### Security

- remove symmetric keys from openid jwks

## [2.2.0] - 2022-09-13
## [boruta - 2.2.0] - 2022-09-13

- Note that you must run the `boruta.gen.migration` task to keep your database schema up to date while upgrading to this version.
- Upgrade to this version need you to invalidate the cache by running `Boruta.Config.cache_backend().delete_all()`
Expand All @@ -120,7 +120,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- enable refresh token rotation, revoke previous refresh token on successful refresh token requests
- fix redirect_uri injection in implicit, hybrid and code grants

## [2.1.5] - 2022-06-15
## [boruta - 2.1.5] - 2022-06-15

### Added

Expand All @@ -135,7 +135,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- id token `at_hash` and `c_hash` binary sizes for SHA256 and SHA384 signature hash algorithms

## [2.1.4] - 2022-06-07
## [boruta - 2.1.4] - 2022-06-07

Note that you must run the `boruta.gen.migration` task to keep your database schema up to date while upgrading to this version.

Expand All @@ -150,7 +150,7 @@ Note that you must run the `boruta.gen.migration` task to keep your database sch
- prefer `invalid_grant` to `invalid_code` and `invalid_refresh_token`
- error messages have been improved

## [2.1.3] - 2022-05-17
## [boruta - 2.1.3] - 2022-05-17

### Added

Expand All @@ -162,19 +162,19 @@ Note that you must run the `boruta.gen.migration` task to keep your database sch
- generated migrations can be rollbacked
- clients pkey constraint do not crash on admin create

## [2.1.2] - 2022-05-02
## [boruta - 2.1.2] - 2022-05-02

### Fixed

- hybrid requests shall return all errors as fragment

## [2.1.1] - 2022-04-30
## [boruta - 2.1.1] - 2022-04-30

### Fixed

- dialyzer warning on `Boruta.Oauth.Error` struct type

## [2.1.0] - 2022-04-29
## [boruta - 2.1.0] - 2022-04-29

### Added

Expand All @@ -185,7 +185,7 @@ Note that you must run the `boruta.gen.migration` task to keep your database sch

- OpenID Connect prompt=none login_required errors in domain

## [2.0.1] - 2022-04-12
## [boruta - 2.0.1] - 2022-04-12

### Added

Expand All @@ -200,7 +200,7 @@ Note that you must run the `boruta.gen.migration` task to keep your database sch

- generated openid authorize controller prompt=none error params type

## [2.0.0] - 2022-01-26
## [boruta - 2.0.0] - 2022-01-26

### Added

Expand All @@ -218,7 +218,7 @@ Note that you must run the `boruta.gen.migration` task to keep your database sch
- `Boruta.Ecto.Admin.list_active_tokens/0,1` returns query result instead of an `Ecto.Query`
- `Boruta.Oauth.ResourceOwners.claims/2` callback takes a `Boruta.Oauth.ResourceOwner` struct instead of `sub` as parameter

## [2.0.0-rc.1] - 2021-11-17
## [boruta - 2.0.0-rc.1] - 2021-11-17

### Fixed

Expand All @@ -235,7 +235,7 @@ Note that you must run the `boruta.gen.migration` task to keep your database sch
- Ecto `ClientsAdapter.get_by(id: id, secret: secret)` is removed in preference of `ClientsAdapter.get_client(id)` and `Oauth.Client.check_secret(client, secret)`.
- Ecto `ClientsAdapter.get_by(id: id, redirect_uri: redirect_uri)` is removed in preference of `ClientsAdapter.get_client(id)` and `Oauth.Client.check_redirect_uri(client, redirect_uri)`.

## [2.0.0-rc.0] 2021-10-12
## [boruta - 2.0.0-rc.0] 2021-10-12

### Added

Expand Down Expand Up @@ -275,13 +275,13 @@ becomes

- `boruta.gen.controllers` generated paths in umbrella apps

## [1.2.1] - 2021-10-10
## [boruta - 1.2.1] - 2021-10-10

### Security

- remove redirect_uris regex pattern check

## [1.2.0] - 2021-09-15
## [boruta - 1.2.0] - 2021-09-15

### Added

Expand All @@ -299,7 +299,7 @@ becomes

- `invalid_client` do not return neither format, nor redirect_uri in `Boruta.Oauth.Error`.

## [1.1.0] - 2021-08-16
## [boruta - 1.1.0] - 2021-08-16

### Added

Expand All @@ -319,19 +319,19 @@ becomes

- Internal server errors when no client_id provided to token and refresh_token grants

## [1.0.3] - 2021-07-29
## [boruta - 1.0.3] - 2021-07-29

### Security

- Refresh token revocation

## [1.0.2] - 2021-06-29
## [boruta - 1.0.2] - 2021-06-29

### Added

- Different OAuth flows integration guides

## [1.0.1] - 2021-03-10
## [boruta - 1.0.1] - 2021-03-10

### Fixed

Expand All @@ -341,4 +341,4 @@ becomes

- Documentation

## [1.0.0] - 2021-03-10
## [boruta - 1.0.0] - 2021-03-10
10 changes: 3 additions & 7 deletions config/config.exs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# Since configuration is shared in umbrella projects, this file
# should only configure the :boruta application itself
# and only for organization purposes. All other config goes to
# the umbrella root.
import Config

config :boruta,
config :boruta_ssi,
ecto_repos: [Boruta.Repo]

config :boruta, Boruta.Cache,
config :boruta_ssi, Boruta.Cache,
primary: [
gc_interval: 86_400_000, #=> 1 day
backend: :shards,
Expand All @@ -16,7 +12,7 @@ config :boruta, Boruta.Cache,

config :phoenix, :json_library, Jason

config :boruta, Boruta.Oauth,
config :boruta_ssi, Boruta.Oauth,
repo: Boruta.Repo

import_config "#{config_env()}.exs"
8 changes: 2 additions & 6 deletions config/dev.exs
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# Since configuration is shared in umbrella projects, this file
# should only configure the :boruta application itself
# and only for organization purposes. All other config goes to
# the umbrella root.
import Config

# Configure your database
config :boruta, Boruta.Repo,
config :boruta_ssi, Boruta.Repo,
username: "postgres",
password: "postgres",
database: "boruta_auth",
hostname: "localhost",
pool_size: 10

config :boruta, Boruta.Oauth,
config :boruta_ssi, Boruta.Oauth,
contexts: [
resource_owners: Dummy.ResourceOwners
]
8 changes: 2 additions & 6 deletions config/test.exs
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
# Since configuration is shared in umbrella projects, this file
# should only configure the :boruta application itself
# and only for organization purposes. All other config goes to
# the umbrella root.
import Config

config :logger, level: :error

config :boruta, Boruta.Repo,
config :boruta_ssi, Boruta.Repo,
username: System.get_env("POSTGRES_USER") || "postgres",
password: System.get_env("POSTGRES_PASSWORD") || "postgres",
database: System.get_env("POSTGRES_DATABASE") || "boruta_test",
hostname: System.get_env("POSTGRES_HOST") || "localhost",
pool: Ecto.Adapters.SQL.Sandbox

config :boruta, Boruta.Oauth,
config :boruta_ssi, Boruta.Oauth,
contexts: [
resource_owners: Boruta.Support.ResourceOwners
],
Expand Down
6 changes: 3 additions & 3 deletions guides/provider_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Once the application is up, we can go on to the authorization part. First, you c

def deps do
...
{:boruta, "~> 2.0"}
{:boruta_ssi, "~> 0.1"}
...
end
```
Expand Down Expand Up @@ -72,7 +72,7 @@ And give mandatory boruta configuration
```elixir
# config/config.exs

config :boruta, Boruta.Oauth,
config :boruta_ssi, Boruta.Oauth,
repo: BorutaExample.Repo,
issuer: "https://example.com"
```
Expand Down Expand Up @@ -130,7 +130,7 @@ and inject it with the main configuration
```elixir
# config/config.exs

config :boruta, Boruta.Oauth,
config :boruta_ssi, Boruta.Oauth,
repo: BorutaExample.Repo,
contexts: [
resource_owners: BorutaExample.ResourceOwners
Expand Down
2 changes: 1 addition & 1 deletion lib/boruta/cache.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ defmodule Boruta.Cache do
"""

use Nebulex.Cache,
otp_app: :boruta,
otp_app: :boruta_ssi,
adapter: Nebulex.Adapters.Replicated
end
6 changes: 3 additions & 3 deletions lib/boruta/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Boruta.Config do
Boruta configuration can be set as following in `config.exs` overriding following default configuration
```
config :boruta, Boruta.Oauth,
config :boruta_ssi, Boruta.Oauth,
repo: MyApp.Repo, # mandatory
cache_backend: Boruta.Cache,
contexts: [
Expand Down Expand Up @@ -184,7 +184,7 @@ defmodule Boruta.Config do
Missing configuration for resource_owners context. You can set your own
`Boruta.Oauth.ResourceOwners` behaviour implementation in config:
config :boruta, Boruta.Oauth,
config :boruta_ssi, Boruta.Oauth,
repo: MyApp.Repo,
contexts: [
resource_owners: MyApp.ResourceOwners
Expand Down Expand Up @@ -249,7 +249,7 @@ defmodule Boruta.Config do
defp oauth_config do
Keyword.merge(
@defaults,
Application.get_env(:boruta, Boruta.Oauth) || [],
Application.get_env(:boruta_ssi, Boruta.Oauth) || [],
fn _, a, b ->
if Keyword.keyword?(a) && Keyword.keyword?(b) do
Keyword.merge(a, b)
Expand Down
2 changes: 1 addition & 1 deletion lib/boruta/repo.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule Boruta.Repo do
@moduledoc false
use Ecto.Repo,
otp_app: :boruta,
otp_app: :boruta_ssi,
adapter: Ecto.Adapters.Postgres
end
4 changes: 2 additions & 2 deletions lib/mix/tasks/boruta.gen.controllers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,15 @@ defmodule Mix.Tasks.Boruta.Gen.Controllers do
end

defp template_path(path) do
:code.priv_dir(:boruta)
:code.priv_dir(:boruta_ssi)
|> Path.join("templates/boruta.gen.controllers")
|> Path.join(path <> ".eex")
end

defp raw_file_paths(paths) do
paths
|> Enum.map(fn path ->
:code.priv_dir(:boruta)
:code.priv_dir(:boruta_ssi)
|> Path.join("templates/boruta.gen.controllers")
|> Path.join(path)
end)
Expand Down
2 changes: 1 addition & 1 deletion lib/mix/tasks/boruta.gen.migration.ex
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ defmodule Mix.Tasks.Boruta.Gen.Migration do
ensure_repo(repo, args)

{:ok, migration_paths} =
:code.priv_dir(:boruta)
:code.priv_dir(:boruta_ssi)
|> Path.join("boruta/migrations")
|> File.ls()

Expand Down
Loading

0 comments on commit d976f3a

Please sign in to comment.