You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ns.AdminMetadata.Description+="User email: "+val+" This is a namespace registration from Pelican CLI with OIDC authentication. Certain fields may not be populated"
358
-
}
359
-
}
360
-
} else {
361
-
// This is either a registration from CLI without --with-identity flag or
362
-
// an automated registration from origin or cache
363
-
ns.AdminMetadata.Description="This is a namespace registration from Pelican CLI or an automated registration. Certain fields may not be populated"
364
-
365
-
// If the namespace is in the topology, we require identity information to register a Pelican namespace
366
-
// for verification purpose
367
-
ifinTopo {
368
-
returnfalse,
369
-
nil,
370
-
permissionDeniedError{Message: fmt.Sprintf("A superspace or subspace of this namespace %s already exists in the OSDF topology: %s. "+
371
-
"To register a Pelican equivalence, you need to present your identity. "+
372
-
"If you are registering through Pelican CLI, try again with the flag '--with-identity' enabled. "+
373
-
"If this is an auto-registration from a Pelican origin or cache server, "+
374
-
"register your namespace or server through the Pelican registry website at %s instead.",
375
-
ns.Prefix,
376
-
GetTopoPrefixString(topoNss),
377
-
registryUrl)}
361
+
ns.AdminMetadata.Description+="User email: "+val+" This is a namespace registration from Pelican CLI with OIDC authentication. Certain fields may not be populated"
378
362
}
379
363
}
364
+
} else {
365
+
// This is either a registration from CLI without --with-identity flag or
366
+
// an automated registration from origin or cache
367
+
ns.AdminMetadata.Description="This is a namespace registration from Pelican CLI or an automated registration. Certain fields may not be populated"
368
+
369
+
// If the namespace is in the topology, we require identity information to register a Pelican namespace
370
+
// for verification purpose
371
+
ifinTopo {
372
+
returnfalse,
373
+
nil,
374
+
permissionDeniedError{Message: fmt.Sprintf("A superspace or subspace of this namespace %s already exists in the OSDF topology: %s. "+
375
+
"To register a Pelican equivalence, you need to present your identity. "+
376
+
"If you are registering through Pelican CLI, try again with the flag '--with-identity' enabled. "+
377
+
"If this is an auto-registration from a Pelican origin or cache server, "+
378
+
"register your namespace or server through the Pelican registry website at %s instead.",
379
+
ns.Prefix,
380
+
GetTopoPrefixString(topoNss),
381
+
registryUrl)}
382
+
}
383
+
}
380
384
381
-
// Overwrite status to Pending to filter malicious request
382
-
ns.AdminMetadata.Status=server_structs.RegPending
385
+
// Overwrite status to Pending to filter malicious request
386
+
ns.AdminMetadata.Status=server_structs.RegPending
383
387
384
-
err=AddNamespace(&ns)
385
-
iferr!=nil {
386
-
returnfalse, nil, errors.Wrapf(err, "Failed to add the prefix %q to the database", ns.Prefix)
msg=fmt.Sprintf("Prefix %s successfully registered. Note that there is an existing superspace or subspace of the namespace in the OSDF topology: %s. The registry admin will review your request and approve your namespace if this is expected.", ns.Prefix, GetTopoPrefixString(topoNss))
391
-
}
392
-
returntrue, map[string]interface{}{
393
-
"message": msg,
394
-
}, nil
395
-
}
388
+
err=AddNamespace(&ns)
389
+
iferr!=nil {
390
+
returnfalse, nil, errors.Wrapf(err, "Failed to add the prefix %q to the database", ns.Prefix)
396
391
} else {
397
-
returnfalse, nil, errors.Errorf("Unable to verify the client's public key, or an encountered an error with its own: "+
msg=fmt.Sprintf("Prefix %s successfully registered. Note that there is an existing superspace or subspace of the namespace in the OSDF topology: %s. The registry admin will review your request and approve your namespace if this is expected.", ns.Prefix, GetTopoPrefixString(topoNss))
395
+
}
396
+
returntrue, map[string]interface{}{
397
+
"message": msg,
398
+
}, nil
399
399
}
400
+
400
401
}
401
402
402
403
// Handle the namespace registration with nonce generation and verification, regardless of
0 commit comments