novakeyclient

package module
v0.1.28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2025 License: MIT Imports: 19 Imported by: 0

README

🚀 NovaKey Client Go

NovaKey is a secure key management system designed primarily for bots, AI agents, and runtime sandboxes.
It uses ed25519 cryptography to authorize clients.

🔗 Public API: https://novakey-api.core-regulus.com


🧭 Getting Started

1. Generate an ed25519 key pair

NovaKey requires a public/private ed25519 key pair for authentication and project access.


2. Create a .novakey-init.yaml file

Example configuration:

backend:
  endpoint: https://novakey-api.core-regulus.com

workspace:
  name: # Your workspace name #
  description: # Description of your workspace #

  project:
    name: # Your project name #
    keyPass: # Password used to encrypt project keys #
    description: # Description of your project #
    keys:
      - name: # Key name 1 #
        value: # Key value 1 #
      - name: # Key name 2 #
        value: # Key value 2 #
    users:
      - key: # ed25519 public key of the user to grant access #
        roleName: Project Reader

💡 This file initializes your project configuration. You can modify it later — all updates will be automatically reflected.
⚠️ Never commit keyPass to your repository! All keys are encrypted using this value.


3. Create a .novakey-user.yaml file

This file defines your personal user credentials:

email:          # Your email address #
privateKeyFile: # Path to your ed25519 private key #

💡 All operations are performed using this user account.
⚠️ Do not include this file in your repository!


4. Use NovaKey in your Go project

📦 Install the client library:

go get github.com/core-regulus/novakey-client

📄 Example usage:

package main

import (
    "log"

    novakeyclient "github.com/core-regulus/novakey-client"
)

func main() {
    launchCfg, err := novakeyclient.NewClient(novakeyclient.InitConfig{Directory: "."})
    if err != nil {
        log.Fatalf("Config error: %v", err)
    }

    log.Printf("Using key: %s", launchCfg)
}

After the first launch, a novakey-launch.yaml file will be generated containing:

  • Workspace and project IDs
  • API endpoint
  • keyPass hash

You can safely commit this file to your repository.
Any user who clones the repository and has access to the project will automatically receive all associated project keys.


📦 Novakey


📦 Client Libraries


📄 License

NovaKey is distributed under the MIT License.
See the LICENSE file for more details.


🧑‍💻 Authors

Core Regulus Team
🌐 https://core-regulus.com

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInitFileNotFound = errors.New("no .novakey-init.yaml file found")
View Source
var ErrLockFileNotFound = errors.New("no novakey-lock.yaml file found")

Functions

func EncodeSSHPublicKey

func EncodeSSHPublicKey(pub ed25519.PublicKey, username string) (string, error)

func GenerateKey

func GenerateKey() (string, error)

func GenerateNonce

func GenerateNonce(n int) ([]byte, error)

func ParseOpenSSHED25519Signer

func ParseOpenSSHED25519Signer(keyPEM string) (ssh.Signer, ed25519.PublicKey, error)

func PrivateKeyToOpenSSHPEM

func PrivateKeyToOpenSSHPEM(priv ed25519.PrivateKey) (string, error)

Types

type BakendConfig

type BakendConfig struct {
	Endpoint string `yaml:"endpoint"`
}

type Client

type Client struct {
	BaseURL    string
	HTTPClient *http.Client
}

func NewClientFromLaunchConfig

func NewClientFromLaunchConfig(launchConfig LaunchConfig) *Client

func (*Client) DeleteProject

func (c *Client) DeleteProject(
	ctx context.Context,
	privateKey string,
	req novakeytypes.DeleteProjectRequest,
) novakeytypes.DeleteProjectResponse

func (*Client) DeleteUser

func (c *Client) DeleteUser(
	ctx context.Context,
	privateKey string,
	req novakeytypes.DeleteUserRequest,
) novakeytypes.DeleteUserResponse

func (*Client) DeleteWorkspace

func (c *Client) DeleteWorkspace(
	ctx context.Context,
	privateKey string,
	req novakeytypes.DeleteWorkspaceRequest,
) novakeytypes.DeleteWorkspaceResponse

func (*Client) GetProject

func (c *Client) GetProject(
	ctx context.Context,
	privateKey string,
	req novakeytypes.GetProjectRequest,
) novakeytypes.GetProjectResponse

func (*Client) GetWorkspace added in v0.1.26

func (c *Client) GetWorkspace(
	ctx context.Context,
	privateKey string,
	req novakeytypes.GetWorkspaceRequest,
) novakeytypes.GetWorkspaceResponse

func (*Client) SetProject

func (c *Client) SetProject(
	ctx context.Context,
	privateKey string,
	req novakeytypes.SetProjectRequest,
) novakeytypes.SetProjectResponse

func (*Client) SetUser

func (c *Client) SetUser(
	ctx context.Context,
	privateKey string,
	signerKey string,
	req novakeytypes.SetUserRequest,
) novakeytypes.SetUserResponse

func (*Client) SetWorkspace

func (c *Client) SetWorkspace(
	ctx context.Context,
	privateKey string,
	req novakeytypes.SetWorkspaceRequest,
) novakeytypes.SetWorkspaceResponse

type InitConfig

type InitConfig struct {
	Directory string
}

type LaunchConfig

type LaunchConfig struct {
	Client    *Client                `yaml:"-"`
	Backend   BakendConfig           `yaml:"backend"`
	Workspace novakeytypes.Workspace `yaml:"workspace"`
	Signer    novakeytypes.Signer    `yaml:"-"`
}

func LoadFromInitConfig added in v0.1.26

func LoadFromInitConfig(cfg InitConfig) (*LaunchConfig, error)

func LoadFromLockFile added in v0.1.26

func LoadFromLockFile(cfg InitConfig) (*LaunchConfig, error)

func NewClient

func NewClient(cfg InitConfig) (*LaunchConfig, error)

type LockConfig added in v0.1.24

type LockConfig struct {
	WorkspaceId uuid.UUID `yaml:"workspaceId"`
	ProjectId   uuid.UUID `yaml:"projectId"`
	Endpoint    string    `yaml:"endpoint"`
}

type UserConfig

type UserConfig struct {
	Email          string `yaml:"email"`
	PrivateKeyFile string `yaml:"privateKeyFile"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL