diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2020-01-20 13:10:24 +0100 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2020-01-20 13:10:24 +0100 |
commit | bce0531c3f7679a4176a892608a9f77b31f9848d (patch) | |
tree | 4f7b1481d364ecf46316784dd4c77168cc2e84c3 /controller-api/src | |
parent | 5f4ca0aab540012fb02326fd597207c2a181add6 (diff) |
Validate sourceUrl parameters
Diffstat (limited to 'controller-api/src')
-rw-r--r-- | controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java index 9c024d32457..685eed22699 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java @@ -3,6 +3,7 @@ package com.yahoo.vespa.hosted.controller.api.integration.deployment; import com.yahoo.component.Version; +import java.net.URI; import java.time.Instant; import java.util.Objects; import java.util.Optional; @@ -50,6 +51,8 @@ public class ApplicationVersion implements Comparable<ApplicationVersion> { if (commit.isPresent() && commit.get().length() > 128) throw new IllegalArgumentException("Commit may not be longer than 128 characters"); + sourceUrl.map(URI::create); + if (authorEmail.isPresent() && ! authorEmail.get().matches("[^@]+@[^@]+")) throw new IllegalArgumentException("Invalid author email '" + authorEmail.get() + "'."); |