Skip to content

Commit 6cb8020

Browse files
sid200727adecaro
authored andcommitted
config: clarify minimal token-sdk configuration and required fields
Signed-off-by: Siddhi Khandelwal <siddhi.200727@gmail.com>
1 parent 57b15b2 commit 6cb8020

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

docs/core-token.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
## Minimal Token-SDK Configuration
2+
3+
The Token SDK can start with the following minimal configuration:
4+
5+
```yaml
6+
token:
7+
enabled: true
8+
tms:
9+
default:
10+
network: mynetwork
11+
namespace: mynamespace
12+
```
13+
14+
### Required Fields
15+
16+
The following fields are strictly required:
17+
18+
- `network`
19+
- `namespace`
20+
21+
All other configuration sections are optional and use sensible defaults.
22+
123
# Example core.yaml section
224

325
The following example provides descriptions for the various keys required by the Token SDK.

token/services/config/configuration.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ func NewConfiguration(cp Provider, keyID string, tmsID driver.TMSID) *Configurat
4141
func (m *Configuration) Validate() error {
4242
// check TMS ID
4343
if len(m.tmsID.Network) == 0 {
44-
return errors.New("missing network id")
44+
return errors.New("token-sdk configuration error: missing required field 'network'")
4545
}
4646
if len(m.tmsID.Namespace) == 0 {
47-
return errors.New("missing namespace id")
47+
return errors.New("token-sdk configuration error: missing required field 'namespace'")
4848
}
4949

5050
for _, validator := range m.validators {

0 commit comments

Comments
 (0)