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"
356
-
}
357
-
}
358
-
} else {
359
-
// This is either a registration from CLI without --with-identity flag or
360
-
// an automated registration from origin or cache
361
-
ns.AdminMetadata.Description="This is a namespace registration from Pelican CLI or an automated registration. Certain fields may not be populated"
362
-
363
-
// If the namespace is in the topology, we require identity information to register a Pelican namespace
364
-
// for verification purpose
365
-
ifinTopo {
366
-
returnfalse,
367
-
nil,
368
-
permissionDeniedError{Message: fmt.Sprintf("A superspace or subspace of this namespace %s already exists in the OSDF topology: %s. "+
369
-
"To register a Pelican equivalence, you need to present your identity. "+
370
-
"If you are registering through Pelican CLI, try again with the flag '--with-identity' enabled. "+
371
-
"If this is an auto-registration from a Pelican origin or cache server, "+
372
-
"register your namespace or server through the Pelican registry website at %s instead.",
373
-
ns.Prefix,
374
-
GetTopoPrefixString(topoNss),
375
-
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"
376
362
}
377
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
+
}
378
384
379
-
// Overwrite status to Pending to filter malicious request
380
-
ns.AdminMetadata.Status=server_structs.RegPending
385
+
// Overwrite status to Pending to filter malicious request
386
+
ns.AdminMetadata.Status=server_structs.RegPending
381
387
382
-
err=AddNamespace(&ns)
383
-
iferr!=nil {
384
-
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))
389
-
}
390
-
returntrue, map[string]interface{}{
391
-
"message": msg,
392
-
}, nil
393
-
}
388
+
err=AddNamespace(&ns)
389
+
iferr!=nil {
390
+
returnfalse, nil, errors.Wrapf(err, "Failed to add the prefix %q to the database", ns.Prefix)
394
391
} else {
395
-
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
397
399
}
400
+
398
401
}
399
402
400
403
// Handle the namespace registration with nonce generation and verification, regardless of
0 commit comments