Skip to content

Commit

Permalink
Clean up and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jekuaitk committed Jan 17, 2025
1 parent 5fc0468 commit 24df6fc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 116 deletions.
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Key types and providers for OS2Web built on the [Key module](https://www.drupal.org/project/key).

The OS2Web key module provides two _key types_, [Certificate](#certificate) and [OpenID Connect
(OIDC)](#openid-connect-oidc). Two _key providers_, [Azure Key Vault](#azure-key-vault) and [Infisical](#infisical), are
(OIDC)](#openid-connect-oidc). Two _key providers_, [Azure Key Vault](#azure-key-vault) and [HashiCorp Vault](#hashiCorp-vault), are
planned, but not yet implemented.

See [the Key Developer Guide](https://www.drupal.org/docs/contributed-modules/key/developer-guide) for details in how to
Expand Down Expand Up @@ -106,13 +106,16 @@ $key = $repository->getKey('openid_connect_ad');

## Providers

The module comes with two key providers.

### Azure Key Vault

`@todo` <https://azure.microsoft.com/en-us/products/key-vault>
Used for fetching certificate from Azure Key vault.

### Infisical
### HashiCorp Vault

`@todo` <https://infisical.com/>
Used to fetch any sort of secret string from HashiCorp vault. Note that
this can only provide string values, i.e. no binary files.

## Coding standards

Expand Down Expand Up @@ -146,3 +149,17 @@ analysis:
```shell
docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.3-fpm ./scripts/code-analysis
```

## Unit tests

We use [PHPUnit](https://phpunit.de/documentation.html) for unit testing.

Testing mostly centers around the conversion and parsing of certificates. For this purpose a bunch of test
certificates has been generated.

Running PHPUnit tests in a standalone Drupal module is a bit tricky, so we use a helper script to run the
analysis:

```shell
docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.3-fpm ./scripts/unit-tests
```
7 changes: 0 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@
"sort-packages": true
},
"scripts": {
"code-analysis": [
"@code-analysis/drupal-check"
],
"code-analysis/drupal-check": [
"# @see https://github.com/mglaman/drupal-check/issues/261#issuecomment-1030141772 for details on exclude-dir value",
"drupal-check --deprecations --analysis --exclude-dir='vendor' *.* src"
],
"coding-standards-apply": [
"@coding-standards-apply/phpcs"
],
Expand Down
105 changes: 0 additions & 105 deletions phpunit.xml

This file was deleted.

0 comments on commit 24df6fc

Please sign in to comment.