Skip to content

Commit

Permalink
box -> app namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-p committed May 13, 2024
1 parent 61a8c3c commit 4dc9a4d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
24 changes: 12 additions & 12 deletions TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ The list displays every DID instance along it's local alias for simpler usage.

```txt
Name DID
sample-account did:algo:testnet:box:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007
sample-account did:algo:testnet:app:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007
```

### 4.3 Inspect your local DID document
Expand Down Expand Up @@ -336,17 +336,17 @@ document.
"https://w3id.org/security/suites/ed25519-2020/v1",
"https://w3id.org/security/suites/x25519-2020/v1"
],
"id": "did:algo:testnet:box:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007",
"id": "did:algo:testnet:app:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007",
"verificationMethod": [
{
"id": "did:algo:testnet:box:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007#master",
"id": "did:algo:testnet:app:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007#master",
"type": "Ed25519VerificationKey2020",
"controller": "did:algo:testnet:box:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007",
"controller": "did:algo:testnet:app:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007",
"publicKeyMultibase": "z9Ry8aFPMLKapvtYkNNSFsoNhkc4192j4ai17EzMquAZc"
}
],
"authentication": [
"did:algo:testnet:box:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007#master"
"did:algo:testnet:app:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007#master"
]
}
}
Expand Down Expand Up @@ -422,7 +422,7 @@ the following.
```shell
2024-04-30T17:42:54-04:00 INF submitting request to the network
2024-04-30T17:42:54-04:00 INF publishing: sample-account
2024-04-30T17:42:54-04:00 INF publishing DID document did=did:algo:testnet:box:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007
2024-04-30T17:42:54-04:00 INF publishing DID document did=did:algo:testnet:app:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007
2024-04-30T17:43:10-04:00 INF DID instance published
```

Expand All @@ -448,28 +448,28 @@ algoid retrieve [existing DID]
For example, to resolve the DID created as part of this tutorial.

```shell
algoid resolve did:algo:testnet:box:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007
algoid resolve did:algo:testnet:app:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007

2024-04-30T17:43:41-04:00 INF retrieving record
2024-04-30T17:43:41-04:00 INF retrieving DID document did=did:algo:testnet:box:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007
2024-04-30T17:43:41-04:00 INF retrieving DID document did=did:algo:testnet:app:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007
2024-04-30T17:43:43-04:00 WRN skipping validation
{
"@context": [
"https://www.w3.org/ns/did/v1",
"https://w3id.org/security/suites/ed25519-2020/v1",
"https://w3id.org/security/suites/x25519-2020/v1"
],
"id": "did:algo:testnet:box:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007",
"id": "did:algo:testnet:app:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007",
"verificationMethod": [
{
"id": "did:algo:testnet:box:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007#master",
"id": "did:algo:testnet:app:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007#master",
"type": "Ed25519VerificationKey2020",
"controller": "did:algo:testnet:box:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007",
"controller": "did:algo:testnet:app:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007",
"publicKeyMultibase": "z9Ry8aFPMLKapvtYkNNSFsoNhkc4192j4ai17EzMquAZc"
}
],
"authentication": [
"did:algo:testnet:box:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007#master"
"did:algo:testnet:app:654583141:7d42e6e0f3c71d777de36849cf96e28b812453198cee2d2cc2b7b19438060007#master"
]
}
```
2 changes: 1 addition & 1 deletion client/cli/cmd/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func runRegisterCmd(_ *cobra.Command, args []string) error {
}

// Generate base identifier instance
subject := fmt.Sprintf("%s:box:%d:%x", network, appID, account.PublicKey)
subject := fmt.Sprintf("%s:app:%d:%x", network, appID, account.PublicKey)
method := "algo"
log.WithFields(xlog.Fields{
"subject": subject,
Expand Down
2 changes: 1 addition & 1 deletion client/internal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func parseSubjectString(subject string) (pub []byte, network string, appID uint6
}

namespace := idSegments[1]
if namespace != "box" {
if namespace != "app" {
err = fmt.Errorf("invalid namespace in subject identifier: %s", namespace)
return pub, network, appID, err
}
Expand Down
2 changes: 1 addition & 1 deletion client/ui/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func TestListAfterRegister(t *testing.T) {
body, err := io.ReadAll(res.Body)
require.NoError(t, err)

require.Regexp(t, `{"name":"TestListAfterRegister","did":"did:algo:custom:box:`, string(body))
require.Regexp(t, `{"name":"TestListAfterRegister","did":"did:algo:custom:app:`, string(body))
}

func TestUpdate(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion client/ui/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (p *Provider) Register(network string, name string, passphrase string) erro
}

// Generate base identifier instance
subject := fmt.Sprintf("%s:box:%d:%x", network, p.client.Networks[network].StorageAppID(), account.PublicKey)
subject := fmt.Sprintf("%s:app:%d:%x", network, p.client.Networks[network].StorageAppID(), account.PublicKey)
method := "algo"
p.log.WithFields(xlog.Fields{
"subject": subject,
Expand Down

0 comments on commit 4dc9a4d

Please sign in to comment.