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

Bug: provider connecting to lattice fails #176

Open
Solverj opened this issue Jan 22, 2025 · 0 comments
Open

Bug: provider connecting to lattice fails #176

Solverj opened this issue Jan 22, 2025 · 0 comments

Comments

@Solverj
Copy link

Solverj commented Jan 22, 2025

Given deploy custom-provider
When nats-server requires jwt and seed
Then provider fails startup with "ERROR Failed to create provider error="nats: Authorization Violation"

Problem:

//provider.go

	// Connect to NATS
	nc, err = nats.Connect(hostData.LatticeRPCURL)
	if err != nil {
		return nil, err
	}

Solution:

//provider.go
	var nc *nats.Conn
	// Connect to NATS
	if hostData.LatticeRPCUserSeed != "" && hostData.LatticeRPCUserJWT != "" {
		opts := nats.UserJWTAndSeed(hostData.LatticeRPCUserJWT, hostData.LatticeRPCUserSeed)
		logger.Debug("connecting to lattice through", "url", hostData.LatticeRPCURL, "opts", "userJWTAndSeed")
		nc, err = nats.Connect(hostData.LatticeRPCURL, opts)
	} else {
		logger.Debug("connecting to lattice through", "url", hostData.LatticeRPCURL)
		nc, err = nats.Connect(hostData.LatticeRPCURL)
	}
	if err != nil {
		return nil, err
	}

When: git push --set-upstream origin bug/provider-nats
Then: ERROR: Permission to wasmCloud/go.git denied to Solverj

//Solve Sthor

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

No branches or pull requests

1 participant