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

Add motor command to sonrd with login/register subcommands #536

Closed
wants to merge 4 commits into from

Conversation

prnk28
Copy link
Contributor

@prnk28 prnk28 commented Aug 24, 2022

See demo. Initial setup of motor command to create/login a Sonr account pulled from speedway and enhanced with Keychain, table logging.

API Updates

New Features (required)

  • UserAuth Info gets stored in system keychain on sonrd motor register
  • User is prompted with System Dialog on the first login to access Vault Password, AESDSC Key, and AESPSK Key
  • Support for multiple accounts on system

Checklist

  • [ X ] Unit tests
  • [ X ] Documentation

Fixes
Connects

 Mention [stepsize] in a comment if you'd like to report some technical debt. See examples here.

cmd/sonrd/main.go Show resolved Hide resolved
cmd/sonrd/utils/keychain.go Show resolved Hide resolved
cmd/sonrd/utils/prompt.go Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Base: 5.91% // Head: 5.91% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (2080d95) compared to base (04960e1).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff            @@
##             dev    #536      +/-   ##
========================================
- Coverage   5.91%   5.91%   -0.01%     
========================================
  Files        115     115              
  Lines      14512   14520       +8     
========================================
  Hits         859     859              
- Misses     13578   13586       +8     
  Partials      75      75              
Impacted Files Coverage Δ
pkg/client/client.go 8.33% <0.00%> (-1.67%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@prnk28 prnk28 requested a review from ntindle August 24, 2022 23:25
@joshLong145
Copy link

added @SCKelemen


// Arch returns the current architecture.
func Arch() string {
return runtime.GOARCH

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this function really necessary?


const K_SERVICE_NAME = "sonr-dev"

type UserAuth struct {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the struct representing the authorization form, or are we also storing this struct?

if i.AesDSCKey == nil {
return false
}
if len(i.AesDSCKey) < 32 {
Copy link

@SCKelemen SCKelemen Aug 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird.

AES Keys can only be 128, 192, or 256 bits, meaning this key has to be 32 bytes or 256 bits. Therefore, should this check not be strict equality?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func (i UserAuth) GenAccountCreateRequest() (*mt.CreateAccountRequest, error) {
if i.Validate() {
return &mt.CreateAccountRequest{
Password: i.Password,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming here this is the password in flight. Please let me know if this assumption is incorrect.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify in flight?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sent across the wire for authentication purposes, ie a web login form

@ntindle
Copy link

ntindle commented Sep 9, 2022

Are we still planning on doing this?

@prnk28
Copy link
Contributor Author

prnk28 commented Sep 11, 2022

Are we still planning on doing this?

Same method with same structure should be in speedway. @ntindle This doesnt use binding layer.

@mcjcloud
Copy link

Closing this PR for now for inactivity.

@mcjcloud mcjcloud closed this Oct 17, 2022
@prnk28 prnk28 deleted the introduce/dev-env branch November 15, 2022 22:41
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.

None yet

6 participants