feature/implement vault allocation (#11)

* feat: add authentication middleware

* feat: add REST API endpoints for database interactions

* refactor: move DiscoveryDocument Pkl schema to oidc module

* fix: replace sonrd with test_node.sh

* feat: use NFT keeper to mint DID namespace NFT

* refactor: move NFT class configuration to types

* feat: add GlobalIntegrity genesis state

* fix: ensure GlobalIntegrity is initialized in genesis

* refactor: update all references to transactions module

* refactor: improve genesis state struct

* chore(did): update discovery endpoint to reflect base url

* feat: remove unused context cache and client code

* refactor: remove middleware dependency from keeper

* feat: Add new query handlers for DID module

* feat: Implement unimplemented params queries

* feat: add support for first-party caveats

* refactor: move motr command to cmd directory

* feat: add support for GitHub releases

* fix(motr): build app.wasm for motr package

* feat: add card component

* feat: add IndexedDB support for persistent storage

* feat: Add Row and Column components

* feat: add  and  components

* refactor: improve button component

* refactor: remove unnecessary button parameter in renderButton

* feat: add vault service endpoint

* feat: add input component
This commit is contained in:
Prad Nukala
2024-09-14 12:47:25 -04:00
committed by GitHub
parent bbfe2a2329
commit b593245fe6
133 changed files with 13352 additions and 4247 deletions
+10 -8
View File
@@ -1,8 +1,10 @@
package svc
import (
"fmt"
"github.com/labstack/echo/v4"
"github.com/onsonr/sonr/internal/db/orm"
oidc "github.com/onsonr/sonr/x/did/types/oidc"
)
func GrantAuthorization(e echo.Context) error {
@@ -25,13 +27,13 @@ func GetToken(e echo.Context) error {
func GetDiscovery(e echo.Context) error {
baseURL := "https://" + e.Request().Host // Ensure this is the correct base URL for your service
discoveryDoc := &orm.DiscoveryDocument{
Issuer: "https://sonr.id",
AuthorizationEndpoint: "https://api.sonr.id/auth",
TokenEndpoint: "https://api.sonr.id/token",
UserinfoEndpoint: "https://api.sonr.id/userinfo",
JwksUri: baseURL + "/jwks", // You'll need to implement this endpoint
RegistrationEndpoint: baseURL + "/register",
discoveryDoc := &oidc.DiscoveryDocument{
Issuer: baseURL,
AuthorizationEndpoint: fmt.Sprintf("%s/auth", baseURL),
TokenEndpoint: fmt.Sprintf("%s/token", baseURL),
UserinfoEndpoint: fmt.Sprintf("%s/userinfo", baseURL),
JwksUri: fmt.Sprintf("%s/jwks", baseURL),
RegistrationEndpoint: fmt.Sprintf("%s/register", baseURL),
ScopesSupported: []string{"openid", "profile", "email", "web3", "sonr"},
ResponseTypesSupported: []string{"code"},
ResponseModesSupported: []string{"query", "form_post"},