Skip to content

Commit

Permalink
Merge pull request #113 from ubirch/UC-1607-database-layer-abstractio…
Browse files Browse the repository at this point in the history
…n-v2

UC-1607 database layer abstraction
  • Loading branch information
Carlos-Augusto authored Feb 7, 2023
2 parents 88cef93 + 6259d1c commit ceaf854
Show file tree
Hide file tree
Showing 34 changed files with 1,343 additions and 181 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build

#############################
# Start the job on all push #
#############################
on:
push:
branches:
- master # or the name of your main branch
pull_request:
types: [opened, synchronize, reopened]


###############
# Set the Job #
###############
jobs:
build:
# Name the Job
name: Build
# Set the agent to run on
runs-on: ubuntu-latest

##################
# Load all steps #
##################
steps:
##########################
# Checkout the code base #
##########################
- uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ In order to connect the client to a postgres database, the DSN must be set in th
UBIRCH_DB_DSN=postgres://<username>:<password>@<hostname>:5432/<database>
```

The maximum number of open connections to the database can be limited with `dbMaxConns` (json)
or `UBIRCH_DB_MAX_CONNS` (env). The default is `0` (unlimited).

### SQLite

If the driver is set to `sqlite`, the client will by default create a SQLite database file `sqlite.db` in the mounted
Expand All @@ -157,6 +154,15 @@ embedded devices, and only one or very few identities need to be managed.
When compared to postgreSQL, a drawback of SQLite is the performance while handling a high load of chaining
requests for multiple identities at the same time.

### Database Connection Configuration

| JSON | env | description | default value |
|------------------------|-----------------------------|------------------------------------------------------------------------------------------------------------------------------------------|-----------------|
| `dbMaxOpenConns` | `UBIRCH_DB_MAX_OPEN_CONNS` | maximum number of open connections to the database | `0` (unlimited) |
| `dbMaxIdleConns` | `UBIRCH_DB_MAX_IDLE_CONNS` | maximum number of connections in the idle connection pool <br/>To disable idle connections, set to `-1` | `10` |
| `dbConnMaxLifetimeSec` | `DB_CONN_MAX_LIFETIME_SEC` | maximum amount of seconds a connection may be reused <br/>To disable connections being closed due to a connection's age, set to `-1` | `600` |
| `dbConnMaxIdleTimeSec` | `DB_CONN_MAX_IDLE_TIME_SEC` | maximum amount of seconds a connection may be idle <br/>To disable connections being closed due to a connection's idle time, set to `-1` | `60` |

## Identity Registration / Initialization

The UBIRCH client is able to handle multiple cryptographic identities.
Expand All @@ -182,7 +188,7 @@ This token is then used to authenticate requests against the identity registrati

```json
"staticAuth": "<static auth token>",
"enableRegistrationEndpoint": true,
"enableRegistrationEndpoint": true,
```

- env:
Expand Down Expand Up @@ -305,7 +311,7 @@ This token is then used to authenticate requests against the CSR creation endpoi

```json
"staticAuth": "<static auth token>",
"enableCSRCreationEndpoint": true,
"enableCSRCreationEndpoint": true,
```

- env:
Expand Down Expand Up @@ -616,7 +622,7 @@ This token is then used to authenticate requests against the deactivation endpoi

```json
"staticAuth": "<static auth token>",
"enableDeactivationEndpoint": true,
"enableDeactivationEndpoint": true,
```

- env:
Expand Down
Loading

0 comments on commit ceaf854

Please sign in to comment.