-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove user data from the database; move blinder and issuer auth data to the vault * minor config fix * remove unused func * import dig lib
- Loading branch information
1 parent
11b918c
commit 0b73ad0
Showing
21 changed files
with
342 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
-- +migrate Up | ||
create table proofs( | ||
id bigserial primary key, | ||
did text not null, | ||
data jsonb not null, | ||
pub_signals jsonb not null, | ||
document_sod jsonb not null | ||
create table claims( | ||
id uuid primary key, | ||
user_did text not null, | ||
issuer_did text not null, | ||
document_hash text not null | ||
); | ||
|
||
-- +migrate Down | ||
drop table proofs; | ||
drop table claims; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package config | ||
|
||
import ( | ||
"gitlab.com/distributed_lab/dig" | ||
"gitlab.com/distributed_lab/figure/v3" | ||
"gitlab.com/distributed_lab/kit/comfig" | ||
"gitlab.com/distributed_lab/kit/kv" | ||
) | ||
|
||
type VaultConfiger interface { | ||
VaultConfig() *VaultConfig | ||
} | ||
|
||
type VaultConfig struct { | ||
Address string `fig:"address,required"` | ||
Token string `dig:"VAULT_TOKEN,clear"` | ||
} | ||
|
||
type vault struct { | ||
once comfig.Once | ||
getter kv.Getter | ||
} | ||
|
||
func NewVaultConfiger(getter kv.Getter) VaultConfiger { | ||
return &vault{ | ||
getter: getter, | ||
} | ||
} | ||
|
||
func (v *vault) VaultConfig() *VaultConfig { | ||
return v.once.Do(func() interface{} { | ||
var result VaultConfig | ||
|
||
err := figure. | ||
Out(&result). | ||
From(kv.MustGetStringMap(v.getter, "vault")). | ||
Please() | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
if err := dig.Out(&result).Where(map[string]interface{}{ | ||
"address": result.Address, | ||
}).Now(); err != nil { | ||
panic(err) | ||
} | ||
|
||
return &result | ||
}).(*VaultConfig) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.