mirror of
https://github.com/google/nomulus
synced 2026-09-06 08:07:03 +00:00
Prevent accidentally using full Drive URL as folder ID (#144)
* Prevent accidentally using full Drive URL as folder ID
This commit is contained in:
@@ -868,7 +868,9 @@ public class Registrar extends ImmutableObject implements Buildable, Jsonifiable
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setDriveFolderId(String driveFolderId) {
|
||||
public Builder setDriveFolderId(@Nullable String driveFolderId) {
|
||||
checkArgument(driveFolderId == null || !driveFolderId.contains("/"),
|
||||
"Drive folder ID must not be a full URL");
|
||||
getInstance().driveFolderId = driveFolderId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ abstract class CreateOrUpdateRegistrarCommand extends MutatingCommand {
|
||||
@Nullable
|
||||
@Parameter(
|
||||
names = "--drive_folder_id",
|
||||
description = "Id of this registrar's folder in Drive",
|
||||
description = "Id (not full URL) of this registrar's folder in Drive",
|
||||
converter = OptionalStringParameter.class,
|
||||
validateWith = OptionalStringParameter.class)
|
||||
Optional<String> driveFolderId;
|
||||
|
||||
@@ -240,12 +240,12 @@
|
||||
{param required: true /}
|
||||
{/call}
|
||||
{call registry.soy.forms.inputFieldRowWithValue}
|
||||
{param label: 'DRIVE ID' /}
|
||||
{param label: 'Drive ID' /}
|
||||
{param name: 'driveId' /}
|
||||
{param value: $driveId /}
|
||||
{param placeholder: 'required' /}
|
||||
{param description kind="text"}
|
||||
Id of this registrar's folder in Drive.
|
||||
ID (not full URL) of this registrar's folder in Google Drive.
|
||||
{/param}
|
||||
{param required: true /}
|
||||
{/call}
|
||||
|
||||
Reference in New Issue
Block a user