Skip to content

Bug: provider connecting to lattice fails #176

@Solverj

Description

@Solverj

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions