MCPcopy
hub / github.com/nats-io/nats.go / runTrustServer

Function runTrustServer

test/nats_test.go:172–185  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

170)
171
172func runTrustServer() *server.Server {
173 kp, _ := nkeys.FromSeed(oSeed)
174 pub, _ := kp.PublicKey()
175 opts := natsserver.DefaultTestOptions
176 opts.Port = TEST_PORT
177 opts.TrustedKeys = []string{string(pub)}
178 s := RunServerWithOptions(&opts)
179 mr := &server.MemAccResolver{}
180 akp, _ := nkeys.FromSeed(aSeed)
181 apub, _ := akp.PublicKey()
182 mr.Store(string(apub), aJWT)
183 s.SetAccountResolver(mr)
184 return s
185}
186
187func createTmpFile(t *testing.T, content []byte) string {
188 t.Helper()

Callers 8

TestAuthExpiredReconnectFunction · 0.85
TestBasicUserJWTAuthFunction · 0.85
TestUserJWTAndSeedFunction · 0.85
TestUserCredentialBytesFunction · 0.85

Calls 2

StoreMethod · 0.80
RunServerWithOptionsFunction · 0.70

Tested by

no test coverage detected