Skip to content

Commit

Permalink
Feature/oidf 53 (#54)
Browse files Browse the repository at this point in the history
* Develop (#53)

* Added Spring boot with status API

* chores: PR feedback

* Update README.md

* Updated the server name in gradle module

* Create admin-server component

* Added Spring boot with status API

* chores: PR feedback

* Updated the server name in gradle module

* Added test for status endpoint and added README

* Enabled test run on gradle build

* Enabled test run on gradle build

* Enabled test run on gradle build

* chore: extract ktor version

* Added Postgres and docker

* Added environment file

* Updated env variable

* Feature/oidf 45 status endpoint (#6)

* Moved admin-server to modules

* Fixed merge conflicts

* Updated CI for GitHub secrets

* Added docker in GitHub action

* Added env variable for docker in GitHub action

* Removed Windows in GitHub action

* Added comment for removing Windows in CI

* Removed hardcoded path from run script

* chore: fix project name

* feat: Created OpenAPI specs project of the EntityStatement class

* chore: fix project name

* chore: extract ktor version

* fix: temporarily hardcode db credentials

* chore: Created README.md and disabled model-only profile

* Feature/oidf 32 postgres docker (#7)

* Added Spring boot with status API

* chores: PR feedback

* Updated the server name in gradle module

* Added test for status endpoint and added README

* Enabled test run on gradle build

* Added Postgres and docker

* Added environment file

* Updated env variable

* Fixed merge conflicts

* Updated CI for GitHub secrets

* Added docker in GitHub action

* Added env variable for docker in GitHub action

* Removed Windows in GitHub action

* Added comment for removing Windows in CI

* Removed hardcoded path from run script

* fix: make admin server load env variables from root .env file (#10)

* chore: fix project name

* chore: extract ktor version

* fix: temporarily hardcode db credentials

* fix: import .env variables from file

* fix: adjust ci file to new docker compose dir

---------

Co-authored-by: sanderPostma <spostma@sphereon.com>

---------

Co-authored-by: John Melati <github@jcmelati.com>
Co-authored-by: sanderPostma <spostma@sphereon.com>

* chore: Added the build jar task

* Added Test container

* chore: Fixed versioning

* bugfix: Fixed Open Api specs file path

* chore: Added flyway dependency

* feat: Flyway setup

* fix: Merging issues

* feat: Added mapper for JWT

* refactor: Fixed the profiles section of the documentation

* refactor: Added fat jat and maven publication to local repository

* refactor: changed to string the value of the dateTimeLibrary property

* refactor: Upgraded OpenAPI generator and removed unneeded serialization configuration

* feat: Created the client to fetch entity statements

* feat: Added OpenAPI maven local and added mapper for entity statement

* OIDF -31: Added Kermit logging library (#12)

* Added Kermit logging

* Added logger class and added dependency in admin-server

* fix: adding env parameter for logging

* chores: removed logger env

* chores: changed from implementation to api

* refactor: Removed "public" from the database objects creation/utilization

* chores: code cleanup

* refactor: Made openid a KMM library.

* fix: Fixed ktor-client-cio issue

* fix: Changed the models jvm target to 11

* bugfix: Fixed OpenAPI model import issue

* fix: Fixed serialization issue and Open Api Generator bug

* feat: Added mapping for trust chain and categorize entity statement

* refactor: Refactored the unit tests

* chore: Added nexus configuration

* refactor: Updated nexus urls

* chores: moved decode code

* chore: Added Nexus repositories to the openid-federation-common module

* chores: PR feedback changes

* refactor: Updated nexus urls and added artifacts to be published to Nexus

* refactor: Extended build task with the publish task

* refactor: Removed the publish task from gradle build task

* chore: Added content negotiation and content-type entity-statement+jwt

* fix: enabled logger and updated GET call

* Revert "fix: enabled logger and updated GET call"

This reverts commit c82ec03.

* chores: PR changes

* Revert "Feature/oidf 46"

* fix: PR changes

* feature/OIDF-7 (#16)

* feat: Implemented KMS, JWKS generation and JWT sign

* fix: Test dependencies

* feat: Created sign and verify jwt functions

* refactor: Added trailing new line to the files

* fix: Removed some targets temporarily to fix build issues.

* refactor: made the second paramenter of functions a Map without default value and refactored the key generation

* refactor: Fixed build issues and removed commented-out code

* fix: Fixed failing test and null pointer exception

* chore: Removed redundant HTTPCache

* chore: Uncommented ios targets back

* refactor: refactored serializeNullable()

* refactor: refactored deserialize()

* refactor: refactored OutgoingEntityStatementContent.bytes()

* refactor: refactored the tests to use assertEquals()

* refactor: Fixed dependencies and made the protectedHeader a param

* refactor: Fixed code formatting

* refactor: Changed the response body to jwt string

* refactor: Removed unnecessary converter

* refactor: Made JWT payload and header classes to be used as input

* fix: add missing repositories for windows (#22)

* fix: add missing repositories for windows

* fix: update ci docker compose command

* feat: implement jwk persistence

* fix: remove unused statement

* fix: github CI

* feat/OIDF-51 - Implement Persistence Module (#21)

* merge oidf-7

* fix: models package

* fix: openapi TrustMarkOwner property

* fix: create account method return type

* fix: rename file for consistency

* feat: implement migration

* fix: repository dependency

* fix: add missing trailing new line

* feat: implement services module

* fix: package path

* fix: remove unused file

* fix: add missing entity to openapi spec

* feat: persist generated keys

* fix: typo

* fix: missing deps

* fix: ci docker command

* fix: dependency

* fix: remove unnecessary statement

* feat: abstract jwk to its own module

* feat: encrypt private keys when saving to database

* feat: add note to README regarding usage of Local KMS in prod envs

* fix: adapt key encryption test cases for when APP_KEY is null

* fix: adjust function name

* fix: add kotlin-js-store to gitignore

* fix: clean common gradle file

* fix: disable android build

* fix: remove js implementation from services

* feat: implement federation server structure

* feat: implement Subordinate repository

* fix: remove unused files

* feat: implement federation list endpoint

* Feature/oidf 55 (#27)

* feat: create servers dockerized containers

* fix: only build jvm jars

* fix: remove unnecessary env var

* feat: update README with docker instructions

* fix: further improve docker README

* fix: adjust CI

* fix: re-add missing env vars

* fix: example app key lenght

* fix: make docker wait for db to fully load

* fix: pass db user to health check

* fix: pass db user to health check

* Feature/oidf 54 (#31)

* feat: Implemented KMS, JWKS generation and JWT sign

* fix: Test dependencies

* feat: Created sign and verify jwt functions

* refactor: Added trailing new line to the files

* fix: Removed some targets temporarily to fix build issues.

* refactor: made the second paramenter of functions a Map without default value and refactored the key generation

* refactor: Fixed build issues and removed commented-out code

* fix: Fixed failing test and null pointer exception

* refactor: Fixed dependencies and made the protectedHeader a param

* refactor: Fixed code formatting

* refactor: Made JWT payload and header classes to be used as input

* fix: add missing repositories for windows (#22)

* fix: add missing repositories for windows

* fix: update ci docker compose command

* feat: implement jwk persistence

* fix: remove unused statement

* fix: github CI

* fix: add missing entity to openapi spec

* feat: persist generated keys

* fix: typo

* fix: remove unnecessary statement

* feat: abstract jwk to its own module

* feat: encrypt private keys when saving to database

* feat: add note to README regarding usage of Local KMS in prod envs

* fix: adapt key encryption test cases for when APP_KEY is null

* fix: adjust function name

* fix: add kotlin-js-store to gitignore

* fix: clean common gradle file

* fix: disable android build

* fix: remove js implementation from services

* feat: implement Subordinate repository (#29)

* feat: implement federation server structure (#28)

* feat: implement federation server structure

* feat: implement Subordinate repository

* fix: remove unused files

* feat: implement federation list endpoint

---------

Co-authored-by: Zoe Maas <zmaas@sphereon.com>

* fix: make docker wait for db to fully load (#32)

---------

Co-authored-by: Zoe Maas <zmaas@sphereon.com>
Co-authored-by: John Melati <github@jcmelati.com>

* Feature/oidf 57 (#33)

* feat: Implemented KMS, JWKS generation and JWT sign

* fix: Test dependencies

* feat: Created sign and verify jwt functions

* refactor: Added trailing new line to the files

* fix: Removed some targets temporarily to fix build issues.

* refactor: made the second paramenter of functions a Map without default value and refactored the key generation

* refactor: Fixed build issues and removed commented-out code

* fix: Fixed failing test and null pointer exception

* chore: Removed redundant HTTPCache

* chore: Uncommented ios targets back

* refactor: refactored serializeNullable()

* refactor: refactored deserialize()

* refactor: refactored OutgoingEntityStatementContent.bytes()

* refactor: refactored the tests to use assertEquals()

* refactor: Fixed dependencies and made the protectedHeader a param

* refactor: Fixed code formatting

* refactor: Changed the response body to jwt string

* refactor: Removed unnecessary converter

* refactor: Made JWT payload and header classes to be used as input

* fix: add missing repositories for windows (#22)

* fix: add missing repositories for windows

* fix: update ci docker compose command

* feat: implement jwk persistence

* fix: remove unused statement

* fix: github CI

* feat/OIDF-51 - Implement Persistence Module (#21)

* merge oidf-7

* fix: models package

* fix: openapi TrustMarkOwner property

* fix: create account method return type

* fix: rename file for consistency

* feat: implement migration

* fix: repository dependency

* fix: add missing trailing new line

* feat: implement services module

* fix: package path

* fix: remove unused file

* fix: add missing entity to openapi spec

* feat: persist generated keys

* fix: typo

* fix: missing deps

* fix: ci docker command

* fix: dependency

* fix: remove unnecessary statement

* feat: abstract jwk to its own module

* feat: encrypt private keys when saving to database

* feat: add note to README regarding usage of Local KMS in prod envs

* fix: adapt key encryption test cases for when APP_KEY is null

* fix: adjust function name

* fix: add kotlin-js-store to gitignore

* fix: clean common gradle file

* fix: disable android build

* fix: remove js implementation from services

* feat: implement federation server structure

* feat: implement Subordinate repository

* fix: remove unused files

* feat: implement federation list endpoint

* Feature/oidf 55 (#27)

* feat: create servers dockerized containers

* fix: only build jvm jars

* fix: remove unnecessary env var

* feat: update README with docker instructions

* fix: further improve docker README

* fix: adjust CI

* fix: re-add missing env vars

* fix: example app key lenght

* fix: make docker wait for db to fully load

---------

Co-authored-by: Zoe Maas <zmaas@sphereon.com>

* feat: Implemented KMS, JWKS generation and JWT sign (#14)

* feat: Implemented KMS, JWKS generation and JWT sign

* fix: Test dependencies

* feat: Created sign and verify jwt functions

* refactor: Added trailing new line to the files

* fix: Removed some targets temporarily to fix build issues.

* refactor: made the second paramenter of functions a Map without default value and refactored the key generation

* refactor: Fixed build issues and removed commented-out code

* fix: Fixed failing test and null pointer exception

* refactor: Fixed dependencies and made the protectedHeader a param

* refactor: Fixed code formatting

* refactor: Made JWT payload and header classes to be used as input

* fix: add missing repositories for windows (#22)

* fix: add missing repositories for windows

* fix: update ci docker compose command

* Feature/oidf 54 (#26)

* chore: Removed redundant HTTPCache

* chore: Uncommented ios targets back

* refactor: refactored serializeNullable()

* refactor: refactored deserialize()

* refactor: refactored OutgoingEntityStatementContent.bytes()

* refactor: refactored the tests to use assertEquals()

* refactor: Changed the response body to jwt string

* refactor: Removed unnecessary converter

* feat: implement jwk persistence

* fix: remove unused statement

* fix: github CI

* feat/OIDF-51 - Implement Persistence Module (#21)

* merge oidf-7

* fix: models package

* fix: openapi TrustMarkOwner property

* fix: create account method return type

* fix: rename file for consistency

* feat: implement migration

* fix: repository dependency

* fix: add missing trailing new line

* feat: implement services module

* fix: package path

* fix: remove unused file

* fix: add missing entity to openapi spec

* feat: persist generated keys

* fix: typo

* fix: missing deps

* fix: ci docker command

* fix: dependency

* fix: remove unnecessary statement

* feat: abstract jwk to its own module

* feat: encrypt private keys when saving to database

* feat: add note to README regarding usage of Local KMS in prod envs

* fix: adapt key encryption test cases for when APP_KEY is null

* fix: adjust function name

* fix: add kotlin-js-store to gitignore

* fix: clean common gradle file

* fix: disable android build

* fix: remove js implementation from services

* feat: implement Subordinate repository (#29)

* feat: implement federation server structure (#28)

* feat: implement federation server structure

* feat: implement Subordinate repository

* fix: remove unused files

* feat: implement federation list endpoint

---------

Co-authored-by: Zoe Maas <zmaas@sphereon.com>

---------

Co-authored-by: Zoe Maas <zmaas@sphereon.com>
Co-authored-by: John Melati <github@jcmelati.com>

* fix: jar creation

* feat: implement entity config builder

* feat: implement subordinate relationship create

* feat: implement published entity configuration statement persistence

* feat: implement published entity configuration statement persistence

* fix: entity configuration database constraint

* feat: implement entity configuration metadata

* fix: add return on end of files

* fix: add return on end of files

* fix: return constants on errors

* Feature/oidf 15 2 (#34)

* feat: implement entity config builder

* feat: implement subordinate relationship create

* feat: implement published entity configuration statement persistence

* feat: implement published entity configuration statement persistence

* fix: entity configuration database constraint

* feat: implement entity configuration metadata

* fix: add return on end of files

* fix: add return on end of files

* fix: return constants on errors

* fix: table name case

* feat: add authority hints support

* fix: authority hint already exists check

* fix: file format

* fix: adjust service filename

* fix: metadata field name

* feat: added KmsService and local KMS module

* fix: linked service layer to local KMS module

* feat: implement EntityConfigurationMetadataDTO

* feat: implement crit

* feat: Setup Spring JDBC for local kms

* fix: added missing properties file

* fix: added missing function in LocalKmsDatabaseConnection

* fix: change to SQLDelight

* fix: Fixed binary data store for Postgres

* feat: Added query for delete key

* feat: changed dependencies

* feat: moved JWT, Jwk to local kms module

* feat: linked generate key pair and sign functions

* Update README.md

* fix: fixed verify function

* fix: updated sign and verify function with ECkey

* fix: Fixed jvm test for sign and verify

* fix: Fixed verify parameter

* fix: Added JWK object into payload body

* fix: Added signing for EntityConfigurationStatement

* feat: create Entity Configuration Statement JWT

* fix: add missing type

* fix: remove unnecessary statement

* fix: ci

* fix: ci

* fix: ci

* fix: missing dto

* fix: remove wrong attributes from openapi spec

* fix: bump openapi version

* Feature/oidf 42 (#35)

* feat: added KmsService and local KMS module

* fix: linked service layer to local KMS module

* feat: Setup Spring JDBC for local kms

* fix: added missing properties file

* fix: added missing function in LocalKmsDatabaseConnection

* fix: change to SQLDelight

* fix: Fixed binary data store for Postgres

* feat: Added query for delete key

* feat: changed dependencies

* feat: moved JWT, Jwk to local kms module

* feat: linked generate key pair and sign functions

* fix: fixed verify function

* fix: updated sign and verify function with ECkey

* fix: Fixed jvm test for sign and verify

* fix: Fixed verify parameter

* fix: Added JWK object into payload body

* fix: Added signing for EntityConfigurationStatement

* feat: create Entity Configuration Statement JWT

---------

Co-authored-by: Robert Mathew <robert.c.mathew@gmail.com>

* feat: implement fetch endpoint

* fix: entity statement response content type

* feat: implement subordinate metadata

* fix: ci java dist

* feat: oidf client module

* feat: Implemented KMS, JWKS generation and JWT sign

* fix: Test dependencies

* feat: Created sign and verify jwt functions

* refactor: Added trailing new line to the files

* fix: Removed some targets temporarily to fix build issues.

* refactor: made the second paramenter of functions a Map without default value and refactored the key generation

* refactor: Fixed build issues and removed commented-out code

* fix: Fixed failing test and null pointer exception

* chore: Removed redundant HTTPCache

* chore: Uncommented ios targets back

* refactor: refactored serializeNullable()

* refactor: refactored deserialize()

* refactor: refactored OutgoingEntityStatementContent.bytes()

* refactor: refactored the tests to use assertEquals()

* refactor: Fixed dependencies and made the protectedHeader a param

* refactor: Fixed code formatting

* refactor: Changed the response body to jwt string

* refactor: Removed unnecessary converter

* refactor: Made JWT payload and header classes to be used as input

* fix: add missing repositories for windows (#22)

* fix: add missing repositories for windows

* fix: update ci docker compose command

* feat: implement jwk persistence

* fix: remove unused statement

* fix: github CI

* feat/OIDF-51 - Implement Persistence Module (#21)

* merge oidf-7

* fix: models package

* fix: openapi TrustMarkOwner property

* fix: create account method return type

* fix: rename file for consistency

* feat: implement migration

* fix: repository dependency

* fix: add missing trailing new line

* feat: implement services module

* fix: package path

* fix: remove unused file

* fix: add missing entity to openapi spec

* feat: persist generated keys

* fix: typo

* fix: missing deps

* fix: ci docker command

* fix: dependency

* fix: remove unnecessary statement

* feat: abstract jwk to its own module

* chore: Trust Chain validation implementation

* feat: encrypt private keys when saving to database

* feat: add note to README regarding usage of Local KMS in prod envs

* fix: adapt key encryption test cases for when APP_KEY is null

* fix: adjust function name

* fix: add kotlin-js-store to gitignore

* fix: clean common gradle file

* fix: disable android build

* fix: Fixed merging issues

* fix: Fixed coroutine issue

* fix: Fixed build trust chain

* fix: Fixed response headers

* chore: Build the trust chain

* refactor: Adjusted the trust chain validation to the models

* refactor: Adjusted the trust chain validation with the local-kms and removed dead code

* refactor: Removed service jvm folders and files

* chore: Added trust chain structure test

* refactor: Renamed op folder to validation

* chore: Added trust chain validation test

* chore: Added support to Subordinate Statements

* chore: Trust Chain Validation refactoring - Separate Entity Configuration Statement from Subordinate Statements

* chore: Trust Chain Validation refactoring - Build Trust Chain for testing

* chore: Trust Chain Validation refactoring - Enabled JS in local-kms module,

* chore: Trust Chain Validation refactoring - Moved client to its own module

* chore: Trust Chain Validation fixed broken tests -

* chore: Added jwk and jwt folder to openid-federation-common

* chore: Fixed jsMain module and implemented tests

* chore: Moved most part of the code to the common module

* refactor: Moved retrieveJwk function to commonMain

* refactor: Created JWT service that accepts callbacks and adjusted the code.

* feat: implement resolve trust chain

* fix: clean object mapping

* fix: remove constraints temporarily

* fix: extend trust chain build test

* fix: trust chain resolve method

* fix: get http engine automatically if none informed

* feat: extract helper functions

* feat: pass fetchservice as param

* fix: ci

* fix: js test

* fix: fetch initialization

* feat: implement client class

* fix: oid client js export

* fix: fetch class

* fix: indentation

* fix: js validateTrustChain return type

* fix: resolve trust chain method name

* feat: implement crypto module in client

* feat: implement js verify function callback in test

* fix: openapi jwk spec

* fix: implement reference time on verify test

* fix: code cleanup

* fix: clean tests

* fix: code cleanup

* fix: move logger to own module

* fix: make Trustchain a class to simplify dep injection

* fix: verify function

* fix: refactor helpers

* fix: refactor

* fix: refactor

* fix: reorder authority hints to process trust anchors first

* fix: add maxDepth parameter to trust chain resolution

* fix: refactor jwk model structure

* fix: subordinate jwks

* fix: export ICryptoServiceCallback to JS

* fix: pass callback constructors to oidf client js

* chore: docker production updates

* chore: docker production updates

* chore: docker production updates

* chore: revert docker compose ports updates

* refactor: Refactored OIDF-Client according to mdoc-cbor-crypto-multiplatform

* fixed: Fixed general bugs

* refactor: Picking common dependencies from libs.versions.toml

* refactor: Moved the trust chain to a callback

* refactor: Created js tests

* refactor: Created tests for jvm and js in their respective folders

* fix: Libraries compatibility: openapi generator, kotlinx coroutines and ktor client

* fix: Fixed issues with the implementation of the Default Trust Chain implementation.

* refactor: Removed println(...)

* refactor: Added the rest of the libraries to libs.versions.toml

* chore: adding publishing configs

* chore: adding publishing configs

* chore: reverted db ports in compose

* chore: fixed NEXUS_USERNAME env var

* chore: fixed NPM_TOKEN env var

* chore: open-api package rename due to npm issues

* fix: Fixed the mangled filed names in JS

* chore: also publish openid-federation-client

* chore: added Default fetch service

* chore: added generateTypeScriptDefinitions

* feat: adjust federation fetch endpoint to new spec without iss param

* fix: subordinate statement source endpoint

---------

Co-authored-by: Zoe Maas <zmaas@sphereon.com>
Co-authored-by: sanderPostma <spostma@sphereon.com>

* fix: revert fetch endpoint call to previous spec

* fix: docker build

* eol=lf

* Feat/oidf 65 3 (#43)

* fix: clean up tests

* fix: implement js client adapter and interfaces

* reorganize code

* fix: verify key type

* fix: remove iss from fetch endpoint

* Feature/oidf 65 2 (#45)

* update version

* update dockerfile versions

* revert urlsafe decode

* revert urlsafe decode

* implement TrustChainResolveResponse

* export interface from root to JS (#46)

* export interface from root to JS

* upgrade gh actions gradle setup

* chore: iterated Docker production scripts

* fix: subordinate statement metadata

* chore: version bump

* chore: fix subordinate jwk fetch

* feat: improve error responses (#47)

* feat: improve error responses

* fix: openapi specs

* feat: implement subordinate delete

* fix: update openapi spec

* chore: variable convention

* Feature/oidf 34 (#48)

* export interface from root to JS

* upgrade gh actions gradle setup

* change publish order

* make exception type more generic

* chore: add keycloack to docker compose

* save

* feat: enable jwt verification on protected routes

* feat: add identifier field on tenant account

* chore: updates openapi spec

* fix: keycloak-dev docker compose

* chore: update README

* Feature/oidf 73 (#49)

* feat: implement Trust Mark Definitions

* feat: implement Trust Mark Types and Issuers

* chore: update openapi spec

* chore: update openapi spec

* feat: implement Trust Mark object builder

* feat: implement federation trust mark endpoints

* chore: add configuration guide to readme

* chore: update openapi spec

* feat: implement received trust marks

* chore: fix openapi spec

* feat: finish trust mark implementation

* chore: clean env file

* chore: update README

* Feature/oidf 39 (#50)

* improve log and refactor

* pass username in header

* code refactor

* chore: move constants to common

* update readme

* clean db config

* fix unresolved ref

* fix unresolved ref

* clean services

* get root identifier from application properties

* extend logging feature and implement admin log endpoints

* fix log class

* update openapi spec

* clean code

* fix build errors

* extend logging

* change filter order

* feat: add technologies file

* Feature/oidf 77 (#51)

fix too many db connections

* Feature/oidf 63 (#52)

* implement db singleton pattern

* fix: remove db initialization from the springboot servers

* disable datasource autoconfigure in federation server

* feat: publish to dockerhub

* chore: ignore logs

* fix: docker hub deployment to correct account

* fix: reuse build artifacts

* fix: version bump on commit

* fix: move built jars to a place Dockerfile expects

* feat: tag and push to docker hub

* fix: semver compatibility

* fix: semver compatibility

* fix: versioning docker tag pattern

* chore: remove wrong reference

* fix: leave only semver active

* fix: only deploy to dockerhub on main and develop

---------

Co-authored-by: Robert Mathew <robert.c.mathew@gmail.com>
Co-authored-by: Niels Klomp <nklomp@users.noreply.github.com>
Co-authored-by: sanderPostma <spostma@sphereon.com>
Co-authored-by: Zoe Maas <zmaas@sphereon.com>
Co-authored-by: maikel-maas <86769796+maikel-maas@users.noreply.github.com>

* feat: implement trust chain validation

* feat: implement trust chain validation

* chore: remove files

* chore: remove wrong files

* chore: remove wrong files

* chore: update version

* chore: reorganize file structure

* chore: clean console log

* chore: extend debug logging

* Trust Mark Validation (#56)

* feat: implement trust mark validation

* feat: implement trust mark verify in js client

* Implement Http Resolver with Cache (#57)

* feat: implement http resolver and cache

* fix: httpclient mock

* fix: remove deprecated files

* Feature/oidf 82 (#58)

* chore: verify and clean specs

* chore: add header auth to endpoints

* chore: add root as default account header param

* chore: allow for create accounts with deleted usernames

* chore: clean

* chore: adjust version

* chore: remove unused dependency

* chore: update README openapi reference

* chore: remove swaggerhub reference

* chore: remove annotation

---------

Co-authored-by: Robert Mathew <robert.c.mathew@gmail.com>
Co-authored-by: Niels Klomp <nklomp@users.noreply.github.com>
Co-authored-by: sanderPostma <spostma@sphereon.com>
Co-authored-by: Zoe Maas <zmaas@sphereon.com>
Co-authored-by: maikel-maas <86769796+maikel-maas@users.noreply.github.com>
  • Loading branch information
6 people committed Feb 6, 2025
1 parent a0bdda1 commit f0b9ed4
Show file tree
Hide file tree
Showing 123 changed files with 5,880 additions and 5,330 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ to participate in federations, ensuring trust and security across different orga
- **JSON Object Signing and Encryption (JOSE)**: Standards for signing and encrypting JSON-based objects to ensure their
integrity and confidentiality.

# API Reference

For the complete API documentation, please visit:

- [Admin Server API Reference](https://app.swaggerhub.com/apis-docs/SphereonInt/OpenIDFederationAdminServer/1.0.0-d41)
- [Federation Server API Reference](https://app.swaggerhub.com/apis-docs/SphereonInt/OpenIDFederationServer/1.0.0-d41)

# Servers Deployment Instructions

## Docker Setup
Expand Down Expand Up @@ -642,11 +649,6 @@ GET http://localhost:8080/trust-mark-issuer/trust-mark-status
}
```

# API Reference

For the complete API documentation, please
visit [the API Reference](https://app.swaggerhub.com/apis-docs/SphereonInt/OpenIDFederationAPI)

# License

```
Expand Down
3 changes: 1 addition & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ gradle.projectsEvaluated {
}
}


plugins {
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.androidLibrary) apply false
Expand Down Expand Up @@ -93,7 +92,7 @@ fun getNpmVersion(): String {

allprojects {
group = "com.sphereon.oid.fed"
version = "0.4.4-SNAPSHOT"
version = "0.4.6-SNAPSHOT"
val npmVersion by extra { getNpmVersion() }

// Common repository configuration for all projects
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ services:
LOCAL_KMS_DATASOURCE_PASSWORD: ${LOCAL_KMS_DATASOURCE_PASSWORD}
LOCAL_KMS_DATASOURCE_DB: ${LOCAL_KMS_DATASOURCE_DB}
ROOT_IDENTIFIER: ${ROOT_IDENTIFIER}
DEV_MODE: ${DEV_MODE}
LOGGER_SEVERITY: ${LOGGER_SEVERITY}
depends_on:
db:
condition: service_healthy
Expand Down Expand Up @@ -122,6 +124,8 @@ services:
LOCAL_KMS_DATASOURCE_DB: ${LOCAL_KMS_DATASOURCE_DB}
ROOT_IDENTIFIER: ${ROOT_IDENTIFIER}
OAUTH2_RESOURCE_SERVER_JWT_ISSUER_URI: ${OAUTH2_RESOURCE_SERVER_JWT_ISSUER_URI}
DEV_MODE: ${DEV_MODE}
LOGGER_SEVERITY: ${LOGGER_SEVERITY}
depends_on:
db:
condition: service_healthy
Expand Down
7 changes: 2 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
kotlin.code.style=official

#Gradle
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M"

#Android
android.nonTransitiveRClass=true
android.useAndroidX=true

#Ktor
io.ktor.development=true

#MPP
kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.enableCInteropCommonization=true
ktor_version=3.0.3
Empty file removed logs/.gitkeep
Empty file.
Empty file removed logs/admin-server/.gitkeep
Empty file.
Empty file removed logs/federation-server/.gitkeep
Empty file.
1 change: 0 additions & 1 deletion modules/admin-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ java {
dependencies {
api(projects.modules.openapi)
api(projects.modules.openidFederationCommon)
api(projects.modules.persistence)
api(projects.modules.services)
api(projects.modules.logger)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import com.sphereon.oid.fed.services.*
import com.sphereon.oid.fed.services.config.AccountServiceConfig
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.core.env.Environment

@Configuration
open class ServiceConfig {
@Bean
open fun accountConfig(environment: org.springframework.core.env.Environment): AccountServiceConfig {
open fun accountConfig(environment: Environment): AccountServiceConfig {
System.setProperty(
"sphereon.federation.root-identifier",
environment.getProperty("sphereon.federation.root-identifier", "http://localhost:8081")
Expand All @@ -23,8 +24,8 @@ open class ServiceConfig {
}

@Bean
open fun entityConfigurationMetadataService(): EntityConfigurationMetadataService {
return EntityConfigurationMetadataService()
open fun entityConfigurationMetadataService(): MetadataService {
return MetadataService()
}

@Bean
Expand All @@ -38,8 +39,8 @@ open class ServiceConfig {
}

@Bean
open fun keyService(kmsClient: KmsClient): KeyService {
return KeyService(kmsClient)
open fun keyService(kmsClient: KmsClient): JwkService {
return JwkService(kmsClient)
}

@Bean
Expand All @@ -50,19 +51,19 @@ open class ServiceConfig {
@Bean
open fun subordinateService(
accountService: AccountService,
keyService: KeyService,
jwkService: JwkService,
kmsClient: KmsClient
): SubordinateService {
return SubordinateService(accountService, keyService, kmsClient)
return SubordinateService(accountService, jwkService, kmsClient)
}

@Bean
open fun trustMarkService(
keyService: KeyService,
jwkService: JwkService,
kmsClient: KmsClient,
accountService: AccountService
): TrustMarkService {
return TrustMarkService(keyService, kmsClient, accountService)
return TrustMarkService(jwkService, kmsClient, accountService)
}

@Bean
Expand All @@ -73,14 +74,23 @@ open class ServiceConfig {
@Bean
open fun entityConfigurationStatementService(
accountService: AccountService,
keyService: KeyService,
jwkService: JwkService,
kmsClient: KmsClient
): EntityConfigurationStatementService {
return EntityConfigurationStatementService(accountService, keyService, kmsClient)
return EntityConfigurationStatementService(accountService, jwkService, kmsClient)
}

@Bean
open fun receivedTrustMarkService(): ReceivedTrustMarkService {
return ReceivedTrustMarkService()
}

@Bean
open fun resolveService(
accountService: AccountService,
): ResolveService {
return ResolveService(
accountService
)
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.sphereon.oid.fed.server.admin.controllers

import com.sphereon.oid.fed.common.Constants
import com.sphereon.oid.fed.openapi.models.AccountDTO
import com.sphereon.oid.fed.openapi.models.CreateAccountDTO
import com.sphereon.oid.fed.persistence.models.Account
import com.sphereon.oid.fed.openapi.models.Account
import com.sphereon.oid.fed.openapi.models.CreateAccount
import com.sphereon.oid.fed.services.AccountService
import jakarta.servlet.http.HttpServletRequest
import org.springframework.http.HttpStatus
Expand All @@ -15,18 +14,18 @@ class AccountController(
private val accountService: AccountService
) {
@GetMapping
fun getAccounts(): List<AccountDTO> {
fun getAccounts(): List<Account> {
return accountService.getAllAccounts()
}

@PostMapping
@ResponseStatus(HttpStatus.CREATED)
fun createAccount(@RequestBody account: CreateAccountDTO): AccountDTO {
fun createAccount(@RequestBody account: CreateAccount): Account {
return accountService.createAccount(account)
}

@DeleteMapping
fun deleteAccount(request: HttpServletRequest): AccountDTO {
fun deleteAccount(request: HttpServletRequest): Account {
val account = request.getAttribute(Constants.ACCOUNT_ATTRIBUTE) as Account
return accountService.deleteAccount(account)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.sphereon.oid.fed.server.admin.controllers

import com.sphereon.oid.fed.common.Constants
import com.sphereon.oid.fed.openapi.models.AuthorityHintDTO
import com.sphereon.oid.fed.openapi.models.CreateAuthorityHintDTO
import com.sphereon.oid.fed.persistence.models.Account
import com.sphereon.oid.fed.openapi.models.Account
import com.sphereon.oid.fed.openapi.models.AuthorityHint
import com.sphereon.oid.fed.openapi.models.CreateAuthorityHint
import com.sphereon.oid.fed.services.AuthorityHintService
import jakarta.servlet.http.HttpServletRequest
import org.springframework.http.HttpStatus
Expand All @@ -15,7 +15,7 @@ class AuthorityHintController(
private val authorityHintService: AuthorityHintService
) {
@GetMapping
fun getAuthorityHints(request: HttpServletRequest): List<AuthorityHintDTO> {
fun getAuthorityHints(request: HttpServletRequest): List<AuthorityHint> {
val account = request.getAttribute(Constants.ACCOUNT_ATTRIBUTE) as Account
return authorityHintService.findByAccount(account)
}
Expand All @@ -24,8 +24,8 @@ class AuthorityHintController(
@ResponseStatus(HttpStatus.CREATED)
fun createAuthorityHint(
request: HttpServletRequest,
@RequestBody body: CreateAuthorityHintDTO
): AuthorityHintDTO {
@RequestBody body: CreateAuthorityHint
): AuthorityHint {
val account = request.getAttribute(Constants.ACCOUNT_ATTRIBUTE) as Account
return authorityHintService.createAuthorityHint(account, body.identifier)
}
Expand All @@ -34,7 +34,7 @@ class AuthorityHintController(
fun deleteAuthorityHint(
request: HttpServletRequest,
@PathVariable id: Int
): AuthorityHintDTO {
): AuthorityHint {
val account = request.getAttribute(Constants.ACCOUNT_ATTRIBUTE) as Account
return authorityHintService.deleteAuthorityHint(account, id)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
package com.sphereon.oid.fed.server.admin.controllers

import com.sphereon.oid.fed.common.Constants
import com.sphereon.oid.fed.openapi.models.CreateCritDTO
import com.sphereon.oid.fed.openapi.models.CreateCrit
import com.sphereon.oid.fed.persistence.models.Account
import com.sphereon.oid.fed.persistence.models.Crit
import com.sphereon.oid.fed.services.CritService
import jakarta.servlet.http.HttpServletRequest
import org.springframework.http.HttpStatus
import org.springframework.web.bind.annotation.DeleteMapping
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.ResponseStatus
import org.springframework.web.bind.annotation.RestController
import org.springframework.web.bind.annotation.*

@RestController
@RequestMapping("/crits")
Expand All @@ -25,7 +18,7 @@ class CritController(
@ResponseStatus(HttpStatus.CREATED)
fun createCrit(
request: HttpServletRequest,
@RequestBody body: CreateCritDTO
@RequestBody body: CreateCrit
): Crit {
val account = request.getAttribute(Constants.ACCOUNT_ATTRIBUTE) as Account
return critService.create(account, body.claim)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
package com.sphereon.oid.fed.server.admin.controllers

import com.sphereon.oid.fed.common.Constants
import com.sphereon.oid.fed.openapi.models.CreateMetadataDTO
import com.sphereon.oid.fed.openapi.models.EntityConfigurationMetadataDTO
import com.sphereon.oid.fed.persistence.models.Account
import com.sphereon.oid.fed.services.EntityConfigurationMetadataService
import com.sphereon.oid.fed.openapi.models.Account
import com.sphereon.oid.fed.openapi.models.CreateMetadata
import com.sphereon.oid.fed.openapi.models.Metadata
import com.sphereon.oid.fed.services.MetadataService
import jakarta.servlet.http.HttpServletRequest
import org.springframework.http.HttpStatus
import org.springframework.web.bind.annotation.*

@RestController
@RequestMapping("/metadata")
class EntityConfigurationMetadataController(
private val entityConfigurationMetadataService: EntityConfigurationMetadataService
private val metadataService: MetadataService
) {
@GetMapping
fun getEntityConfigurationMetadata(request: HttpServletRequest): List<EntityConfigurationMetadataDTO> {
fun getEntityConfigurationMetadata(request: HttpServletRequest): List<Metadata> {
val account = request.getAttribute(Constants.ACCOUNT_ATTRIBUTE) as Account
return entityConfigurationMetadataService.findByAccount(account).toList()
return metadataService.findByAccount(account).toList()
}

@PostMapping
@ResponseStatus(HttpStatus.CREATED)
fun createEntityConfigurationMetadata(
request: HttpServletRequest,
@RequestBody body: CreateMetadataDTO
): EntityConfigurationMetadataDTO {
@RequestBody body: CreateMetadata
): Metadata {
val account = request.getAttribute(Constants.ACCOUNT_ATTRIBUTE) as Account
return entityConfigurationMetadataService.createEntityConfigurationMetadata(
return metadataService.createEntityConfigurationMetadata(
account,
body.key,
body.metadata
Expand All @@ -38,9 +38,9 @@ class EntityConfigurationMetadataController(
fun deleteEntityConfigurationMetadata(
request: HttpServletRequest,
@PathVariable id: Int
): EntityConfigurationMetadataDTO {
): Metadata {
val account = request.getAttribute(Constants.ACCOUNT_ATTRIBUTE) as Account
return entityConfigurationMetadataService.deleteEntityConfigurationMetadata(
return metadataService.deleteEntityConfigurationMetadata(
account,
id
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
package com.sphereon.oid.fed.server.admin.controllers

import com.sphereon.oid.fed.common.Constants
import com.sphereon.oid.fed.openapi.models.EntityConfigurationStatementDTO
import com.sphereon.oid.fed.openapi.models.PublishEntityStatementDTO
import com.sphereon.oid.fed.persistence.models.Account
import com.sphereon.oid.fed.openapi.models.Account
import com.sphereon.oid.fed.openapi.models.EntityConfigurationStatement
import com.sphereon.oid.fed.openapi.models.PublishStatementRequest
import com.sphereon.oid.fed.services.EntityConfigurationStatementService
import jakarta.servlet.http.HttpServletRequest
import org.springframework.http.HttpStatus
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.ResponseStatus
import org.springframework.web.bind.annotation.RestController
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.*

@RestController
@RequestMapping("/entity-statement")
class EntityStatementController(
private val entityConfigurationStatementService: EntityConfigurationStatementService
) {
@GetMapping
fun getEntityStatement(request: HttpServletRequest): EntityConfigurationStatementDTO {
fun getEntityStatement(request: HttpServletRequest): EntityConfigurationStatement {
val account = request.getAttribute(Constants.ACCOUNT_ATTRIBUTE) as Account
return entityConfigurationStatementService.findByAccount(account)
}

@PostMapping
@ResponseStatus(HttpStatus.CREATED)
fun publishEntityStatement(
request: HttpServletRequest,
@RequestBody body: PublishEntityStatementDTO?
): String {
@RequestBody body: PublishStatementRequest?
): ResponseEntity<String> {
val account = request.getAttribute(Constants.ACCOUNT_ATTRIBUTE) as Account
return entityConfigurationStatementService.publishByAccount(account, body?.dryRun)
val result = entityConfigurationStatementService.publishByAccount(account, body?.dryRun)
return if (body?.dryRun == true) {
ResponseEntity.ok(result)
} else {
ResponseEntity.status(HttpStatus.CREATED).body(result)
}
}
}
Loading

0 comments on commit f0b9ed4

Please sign in to comment.