8000 feat: configure default authorization policies for DWN operators by prnk28 · Pull Request #1255 · sonr-io/snrd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: configure default authorization policies for DWN operators #1255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions x/dwn/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
// DefaultParams returns default module parameters.
func DefaultParams() Params {
return Params{
Attenuations: DefaultAttenuations(),
AllowedOperators: []string{ // TODO:
"localhost",
"didao.xyz",
Expand All @@ -30,3 +31,35 @@ func (p Params) Validate() error {
// TODO:
return nil
}

// DefaultAttenuations returns the default Attenuation
func DefaultAttenuations() []*Attenuation {
return []*Attenuation{
{
Resource: &Resource{
Kind: "dwn",
Template: "{id}",
},
Capabilities: []*Capability{
{
Name: "sign",
Parent: "/vault",
Command: "/vault/sign",
Description: "Sign an arbitrary payload",
},
{
Name: "verify",
Parent: "/vault",
Command: "/vault/verify",
Description: "Verify a signature",
},
{
Name: "refresh",
Parent: "/vault",
Command: "/vault/refresh",
Description: "Refresh the Session KeyShares",
},
},
},
}
}
Loading
0