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

[Added] CreateUserSeed and CreateAccountSeed so these can be generated #434

Merged
merged 2 commits into from
Feb 22, 2021

Conversation

matthiashanel
Copy link
Contributor

@matthiashanel matthiashanel commented Feb 20, 2021

Signed-off-by: Matthias Hanel [email protected]

altered visibility for some functions for testing.
Since nkeys don't store the type I am not returning an NKEY and return the seed instead.
That seed can then be used to create the nkey.

/// Creates a private account seed String.
/// </summary>
/// <returns>A NATS Ed25519 Account Seed</returns>
public static string CreateAccountSeed()
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps add the others for completeness in case someone want to write a utility out of this... wdyt?

eg.

public static string CreateOperatorSeed();
public static string CreateServerSeed();
public static string CreateClusterSeed();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will add CreateOperatorSeed. Server and Cluster are not used.

public class TestNkeys
{
[Fact]
public void TestNKEYEncodeDecode()
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add seeds created by CreateUserSeed, CreateAccountSeed, etc...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

already have TestNKEYCreateUserSeed and TestNKEYCreateAccountSeed further down, will add the operator one

Copy link
Member

@ColinSullivan1 ColinSullivan1 left a comment

Choose a reason for hiding this comment

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

LGTM so far. Thanks @matthiashanel! A few requests, certainly open for discussion.

added seed generation for operator + unit test

Signed-off-by: Matthias Hanel <[email protected]>
Copy link
Member

@ColinSullivan1 ColinSullivan1 left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks!

@ColinSullivan1 ColinSullivan1 merged commit b90cca4 into master Feb 22, 2021
@scottf scottf deleted the generate-nkey branch August 24, 2021 11:34
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.

2 participants