Skip to content
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

Implement gRPC Sessions #1082

Merged
merged 34 commits into from
Jun 4, 2024
Merged

Implement gRPC Sessions #1082

merged 34 commits into from
Jun 4, 2024

Conversation

prnk28 added 30 commits May 31, 2024 21:58
feat: Improve script formatting in Dockerfile

style: Fix indentation in README.md

refactor: Remove unused htmx package in middleware

style: Remove unused daiad.go package
Refactored the actor package to enhance the signature functionality.
Added new types for requests and responses and refactored the controllerActor.
Removed unnecessary code from validator and actor files.
Implemented new sign protocol in the controllerActor for message processing.
…efactor context related functions

Add context parameter to the NewCredentialClaims function in the credentials.go file to handle context-related operations efficiently. Refactor context-related functions in the local package for better organization and clarity.
Added github.com/asynkron/protoactor-go as a direct dependency and removed
it as an indirect dependency.
Removed unused package "addr" and removed redundant newline in encrypt.go file.
…sion type

Introduced `authorizedSession` type to extend the existing `session` type and added a new `Session` interface with methods for authentication and validation.
Renamed functions in the local package to `SetLocalChainID` and
`SetLocalValidatorAddress` for clarity and consistency. Removed
unused variables and functions related to cache setup.
…rizedSession instead of session to provide more information.
The changes in this commit make it possible to fetch the public key
directly from the SecretKey struct, without requiring an external
curve object. This simplifies the API and makes the code more
self-contained.
The changes remove the `controller` package from the codebase. The `controller` package was previously used to handle the signing and refreshing of the keyshares, but this functionality has now been moved directly into the `vault` package. The removal of the `controller` package simplifies the codebase and eliminates the need for a separate controller component.
This commit introduces the `Generate` function to create a new vault with
generated credentials. The vault now includes a `credentials` field of type
`props.Credentials` to store the generated credentials. Additionally, the
`wallet` field has been moved to be a member of the `vault` struct.
The changes in this commit move the credential management functionality from the `props` package to a new `auth` package. This is done to better separate concerns and make the codebase more modular.

The key changes are:

- Moved the `Credentials` struct and related methods from `pkg/vault/props/creds.go` to `pkg/vault/auth/creds.go`.
- Updated the `vault` package to use the new `auth.NewCredentials()` method instead of `props.NewCredentials()`.
- Removed the `pkg/auth/credential.go` file as its contents have been integrated into the new `auth` package.

This change will improve the maintainability and testability of the credential management functionality in the Vault.
The changes in this commit improve the way sessions are retrieved from the cache. The `GetSession` function has been moved to the `SonrContext` struct, and it now uses the session ID from the context to fetch the session from the cache. This change makes the session retrieval more explicit and tied to the context, improving the overall code organization and readability.
Creates a new wallet instance using the provided keyshares and
a new file system instance using the first wallet account address.
This allows the vault to manage the user's credentials, properties,
and secure file storage.
The changes in this commit add error handling to the `LinkCredential` function in the `Credentials` struct. Specifically:

- If the `origin` parameter is an empty string, the function will return an error.
- The function will now return an error in addition to modifying the `Credentials` map.

This ensures that calling code can properly handle errors when trying to link a new credential.
…nd properties

Create vaultFS struct in fs.go to encapsulate Wallet, Credentials, and Properties. 
Update vault struct in vault.go to use vaultFS instead of individual fields.
feat: Implement GetInfoFile and ToFileMap methods in vaultFS

feat: Add AddFileMap method to virtual file system

fix: Update vault struct initialization in Generate function

feat: Add NewFSWithKss method to create VFS with kss keys

feat: Update VFS interface to include AddFileMap method
feat: Add Register Options for WebAuthn authentication

feat: Add EncryptedSet interface for keyshare set
This commit adds the ability to encrypt keyshares using a password in the
keyshares struct and encryptedSet struct.
Update the vaultFS struct fields and methods to use auth package.
Add necessary imports and update the GetInfoFile method.
Update the Cache struct to include Set and Get methods for adding and retrieving values from the cache using string-constrained keys.
 
This commit introduces two new structs: `CredentialClaims` and `Account`.

The `CredentialClaims` struct represents the claims for a credential, including registered claims and a list of credential descriptors. The `NewCredentialClaims` function returns a new instance of `CredentialClaims` with some default values set.

The `Account` struct represents a wallet account, containing the address, public key, index, and coin type. The `NewAccount` function creates a new `Account` instance from a public key, coin, and index.

Additionally, the `Wallet` struct has been updated to use the `Account` struct instead of the `chain.Account` struct. The `Credentials` and `Properties` fields have been removed, as they were not used in the provided code.
@prnk28 prnk28 enabled auto-merge (squash) June 4, 2024 20:24
@prnk28 prnk28 merged commit b5d011a into main Jun 4, 2024
5 checks passed
@prnk28 prnk28 deleted the implement/sessions branch June 4, 2024 20:34
@prnk28 prnk28 linked an issue Jun 4, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Local AES-DAED Bidirectional Encryption for Clients/Validators
1 participant