Skip to content

Commit

Permalink
Merge pull request #222 from gestalt-config/feat/static-site
Browse files Browse the repository at this point in the history
Feat/static site
  • Loading branch information
credmond-git authored Oct 7, 2024
2 parents 68a5641 + 9a5baef commit 7809f21
Show file tree
Hide file tree
Showing 51 changed files with 1,341 additions and 705 deletions.
12 changes: 0 additions & 12 deletions docs/gestalt-static/blog/2019-05-28-first-blog-post.md

This file was deleted.

44 changes: 0 additions & 44 deletions docs/gestalt-static/blog/2019-05-29-long-blog-post.md

This file was deleted.

24 changes: 0 additions & 24 deletions docs/gestalt-static/blog/2021-08-01-mdx-blog-post.mdx

This file was deleted.

Binary file not shown.
29 changes: 0 additions & 29 deletions docs/gestalt-static/blog/2021-08-26-welcome/index.md

This file was deleted.

23 changes: 0 additions & 23 deletions docs/gestalt-static/blog/authors.yml

This file was deleted.

19 changes: 0 additions & 19 deletions docs/gestalt-static/blog/tags.yml

This file was deleted.

21 changes: 21 additions & 0 deletions docs/gestalt-static/docs/advanced/configurable-options.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
sidebar_position: 5
---

# Configuration Options
| Configuration | default | Details |
|-----------------------------------------|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| treatWarningsAsErrors | false | if we treat warnings as errors Gestalt will fail on any warnings. When set to true it overrides the behaviour in the below configs. |
| treatMissingArrayIndexAsError | false | By default Gestalt will insert null values into an array or list that is missing an index. By enabling this you will get an exception instead |
| treatMissingValuesAsErrors | false | By default Gestalt will not update values in classes not found in the config. Null values will be left null and values with defaults will keep their defaults. By enabling this you will get an exception if any value is missing. |
| treatMissingDiscretionaryValuesAsErrors | true | Sets treat missing discretionary values (optional, fields with defaults, fields with default annotations) as an error. If this is false you will be able to get the configuration with default values or an empty Optional. If this is true, if a field is missing and would have had a default it will fail and throw an exception. |
| dateDecoderFormat | null | Pattern for a DateTimeFormatter, if left blank will use the default for the decoder |
| localDateTimeFormat | null | Pattern for a DateTimeFormatter, if left blank will use the default for the decoder |
| localDateFormat | null | Pattern for a DateTimeFormatter, if left blank will use the default for the decoder |
| substitutionOpeningToken | `${` | Customize what tokens gestalt looks for when starting replacing substrings |
| substitutionClosingToken | `}` | Customize what tokens gestalt looks for when ending replacing substrings |
| maxSubstitutionNestedDepth | 5 | Get the maximum string substitution nested depth. If you have nested or recursive substitutions that go deeper than this it will fail. |
| nodeIncludeKeyword | `$include` | The token used to denote a included node. If this is found in a path it will attempt to load the node into the tree at this location. |
| nodeNestedIncludeLimit | 5 | The maximum number of nested Node Includes Gestalt will attempt. If you have nested or recursive Includes that go deeper than this it will fail. |
| observationsEnabled | false | if observations should be enabled. This needs to be used in conjunction with the gestalt-micrometer or other observations library. |
| proxyDecoderMode | CACHE | Either CACHE or PASSTHROUGH, where cache means we serve results through a cache that is never updated or pass through where each call is forwarded to Gestalt to be looked up. |
64 changes: 64 additions & 0 deletions docs/gestalt-static/docs/advanced/logging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
sidebar_position: 7
---

# Logging
Gestalt leverages [System.logger](https://docs.oracle.com/javase/9/docs/api/java/lang/System.Logger.html), the jdk logging library to provide a logging facade. Many logging libraries provide backends for System Logger.


## log4j 2
To use log4j2 as the logging backend for the system logger include these dependencies. This is supported in version 2.13.2 of log4j2.

In Maven:
```xml
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jpl</artifactId>
<version>${version}</version>
<scope>runtime</scope>
</dependency>
```
Or in Gradle
```kotlin
implementation("org.apache.logging.log4j:log4j-jpl:${version}")
```


## logback
To use logback as the logging backend for the system logger include these dependencies. This is supported in version 2+ of Logback.

In Maven:
```xml
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk-platform-logging</artifactId>
<version>${version}</version>
</dependency>
```
Or in Gradle
```kotlin
implementation("org.slf4j:slf4j-jdk-platform-logging:${version}")
```

# Secrets in exceptions and logging
Several places in the library we will print out the contents of a node if there is an error, or you call the debug print functionality.
To ensure that no secrets are leaked we conceal the secrets based on searching the path for several keywords. If the keyword is found in the path the leaf value will be replaced with a configurable mask.


How to configure the masking rules and the mask.
```java
Gestalt gestalt = new GestaltBuilder()
.addSource(MapConfigSourceBuilder.builder().setCustomConfig(configs).build())
.addSecurityMaskingRule("port")
.setSecurityMask("&&&&&")
.build();

gestalt.loadConfigs();

String rootNode = gestalt.debugPrint(Tags.of());

Assertions.assertEquals("MapNode{db=MapNode{password=LeafNode{value='test'}, " +
"port=LeafNode{value='*****'}, uri=LeafNode{value='my.sql.com'}}}", rootNode);
```

By default, the builder has several rules predefined [here](https://github.com/gestalt-config/gestalt/blob/main/gestalt-core/src/main/java/org/github/gestalt/config/builder/GestaltBuilder.java#L76).
Loading

0 comments on commit 7809f21

Please sign in to comment.