MCPcopy Create free account
hub / github.com/cloudflare/cfssl / TestRemoteProfiles

Function TestRemoteProfiles

config/config_test.go:301–331  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

299}
300
301func TestRemoteProfiles(t *testing.T) {
302 var validRemoteProfile = &SigningProfile{
303 RemoteName: "localhost",
304 RemoteServer: "localhost:8080",
305 }
306
307 var invalidRemoteProfile = &SigningProfile{
308 RemoteName: "localhost",
309 }
310
311 var invalidRemoteAuthProfile = &SigningProfile{
312 RemoteName: "localhost",
313 RemoteServer: "localhost:8080",
314 AuthKeyName: "blahblah",
315 }
316
317 if !validRemoteProfile.validProfile(true) ||
318 !validRemoteProfile.validProfile(false) {
319 t.Fatal("valid remote profile is rejected.")
320 }
321
322 if invalidRemoteProfile.validProfile(true) ||
323 invalidRemoteProfile.validProfile(false) {
324 t.Fatal("invalid remote profile is accepted.")
325 }
326
327 if invalidRemoteAuthProfile.validProfile(true) ||
328 invalidRemoteAuthProfile.validProfile(false) {
329 t.Fatal("invalid remote profile is accepted.")
330 }
331}
332
333func TestInvalidDefault(t *testing.T) {
334 if invalidDefaultConfig.Signing.Default.validProfile(true) {

Callers

nothing calls this directly

Calls 1

validProfileMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…