diff --git a/src/clojars/db.clj b/src/clojars/db.clj index c34ee934..8532830a 100644 --- a/src/clojars/db.clj +++ b/src/clojars/db.clj @@ -557,11 +557,11 @@ ;; group doesn't exist, reject since we no longer auto-create groups (empty? actives) - (err (format "Group '%s' doesn't exist (see https://git.io/JOs8J)" groupname)) + (err (format "Group '%s' doesn't exist. See https://bit.ly/3MuKGXO" groupname)) ;; group isn't verified, so new jars/projects can't be deployed to it (not (find-group-verification db groupname)) - (err (format "Group '%s' isn't verified, so can't contain new projects (see https://git.io/JOs8J)" groupname))))) + (err (format "Group '%s' isn't verified, so can't contain new projects. See https://bit.ly/3MuKGXO" groupname))))) (defn add-group "Adds a new group entry without any checks other than if it exists diff --git a/src/clojars/routes/repo.clj b/src/clojars/routes/repo.clj index fae37c8a..ad3f33c9 100644 --- a/src/clojars/routes/repo.clj +++ b/src/clojars/routes/repo.clj @@ -201,7 +201,7 @@ (when (and (not (maven/snapshot-version? version)) (db/find-jar db group-id artifact-id version)) (throw-invalid :non-snapshot-redeploy - "redeploying non-snapshots is not allowed (see https://git.io/v1IAs)"))) + "redeploying non-snapshots is not allowed. See https://bit.ly/3EYzhwT"))) (defn assert-non-central-shadow [group-id artifact-id] (when-not (maven/can-shadow-maven? group-id artifact-id) @@ -212,10 +212,10 @@ :report? true}] (if (= ret :failure) (throw-invalid :central-shadow-check-failure - "failed to contact Maven Central to verify project name (see https://git.io/vMUHN)" + "failed to contact Maven Central to verify project name. See https://bit.ly/3rTLqxZ" (assoc meta :status 503)) (throw-invalid :central-shadow - "shadowing Maven Central artifacts is not allowed (see https://git.io/vMUHN)" + "shadowing Maven Central artifacts is not allowed. See https://bit.ly/3rTLqxZ" meta)))))) (defn assert-jar-uploaded [artifacts pom] @@ -258,7 +258,7 @@ ;; OSes, URLs and tools. (validate-regex name #"^[a-z0-9_.-]+$" (str "project names must consist solely of lowercase " - "letters, numbers, hyphens and underscores (see https://git.io/v1IAl)")) + "letters, numbers, hyphens and underscores. See https://bit.ly/3MuL20A")) ;; Maven's pretty accepting of version numbers, but so far in 2.5 years ;; bar one broken non-ascii exception only these characters have been used. @@ -267,7 +267,7 @@ ;; compatible for everyone let's lock it down. (validate-regex version #"^[a-zA-Z0-9_.+-]+$" (str "version strings must consist solely of letters, " - "numbers, dots, pluses, hyphens and underscores (see https://git.io/v1IA2)"))) + "numbers, dots, pluses, hyphens and underscores. See https://bit.ly/3Kf5KzX"))) (defn validate-deploy [db dir pom {:keys [group name version]}] (validate-jar-name+version name version) @@ -376,7 +376,7 @@ [session group artifact] (when-not (token-session-matches-group-artifact? session group artifact) (throw-forbidden - "The provided token's scope doesn't allow deploying this artifact (see https://git.io/JfwjM)" + "The provided token's scope doesn't allow deploying this artifact. See https://bit.ly/3LmCclv" {:group group :artifact artifact}))) @@ -494,7 +494,7 @@ (if (auth/unauthed-or-token-request? req) (f req) (let [{:keys [username]} (auth/parse-authorization-header (get-in req [:headers "authorization"])) - message "a deploy token is required to deploy (see https://git.io/JfwjM)"] + message "a deploy token is required to deploy. See https://bit.ly/3LmCclv"] (log/audit db {:tag :deploy-password-rejection :message message :username username}) diff --git a/test/clojars/integration/uploads_test.clj b/test/clojars/integration/uploads_test.clj index 9cc78a79..cffd17e8 100644 --- a/test/clojars/integration/uploads_test.clj +++ b/test/clojars/integration/uploads_test.clj @@ -434,7 +434,7 @@ (register-as "dantheman" "test@example.org" "password")) (let [token (create-deploy-token (session (help/app-from-system)) "dantheman" "password" "testing")] (is (thrown-with-msg? DeploymentException - #"Forbidden - Group 'new-group' doesn't exist \(see https://git.io/JOs8J\)" + #"Forbidden - Group 'new-group' doesn't exist. See https://bit.ly/3MuKGXO" (deploy {:coordinates '[new-group/test "0.0.1"] :jar-file (io/file (io/resource "test.jar")) @@ -447,7 +447,7 @@ :group_name "new-group" :jar_name "test" :version "0.0.1" - :message "Group 'new-group' doesn't exist (see https://git.io/JOs8J)" + :message "Group 'new-group' doesn't exist. See https://bit.ly/3MuKGXO" :tag "deploy-forbidden"}))) (deftest user-can-deploy-a-new-version-to-an-existing-project-in-a-non-verified-group @@ -494,7 +494,7 @@ (db/add-admin help/*db* "legacy-group" "dantheman" "testing") (is (thrown-with-msg? DeploymentException - #"Forbidden - Group 'legacy-group' isn't verified, so can't contain new projects \(see https://git.io/JOs8J\)" + #"Forbidden - Group 'legacy-group' isn't verified, so can't contain new projects. See https://bit.ly/3MuKGXO" (deploy {:coordinates '[legacy-group/test "0.0.1"] :jar-file (io/file (io/resource "test.jar")) @@ -507,7 +507,7 @@ :group_name "legacy-group" :jar_name "test" :version "0.0.1" - :message "Group 'legacy-group' isn't verified, so can't contain new projects (see https://git.io/JOs8J)" + :message "Group 'legacy-group' isn't verified, so can't contain new projects. See https://bit.ly/3MuKGXO" :tag "deploy-forbidden"}))) (deftest user-cannot-redeploy @@ -532,7 +532,7 @@ :group_name "org.clojars.dantheman" :jar_name "test" :version "0.0.1" - :message "redeploying non-snapshots is not allowed (see https://git.io/v1IAs)" + :message "redeploying non-snapshots is not allowed. See https://bit.ly/3EYzhwT" :tag "non-snapshot-redeploy"}))) (deftest deploy-cannot-shadow-central @@ -556,7 +556,7 @@ :group_name "org.tcrawley" :jar_name "dynapath" :version "0.0.1" - :message "shadowing Maven Central artifacts is not allowed (see https://git.io/vMUHN)" + :message "shadowing Maven Central artifacts is not allowed. See https://bit.ly/3rTLqxZ" :tag "central-shadow"}))) (deftest deploy-cannot-shadow-central-unless-allowlisted @@ -742,12 +742,12 @@ {:coordinates '[org.clojars.dantheman/test "1.0.0"] :jar-file (io/file (io/resource "test.jar")) :pom-file (io/file (io/resource "test-0.0.1/test.pom")) - :password "password"}) + :password "password"}))) - (help/match-audit {:username "guest"} - {:user "guest" - :message "a deploy token is required to deploy (see https://git.io/JfwjM)" - :tag "deploy-password-rejection"})))) + (help/match-audit {:username "dantheman"} + {:user "dantheman" + :message "a deploy token is required to deploy. See https://bit.ly/3LmCclv" + :tag "deploy-password-rejection"})) (deftest deploy-requires-path-to-match-pom (-> (session (help/app-from-system)) @@ -822,7 +822,7 @@ :group_name "org.clojars.dantheman" :jar_name "teST" :version "0.0.1" - :message "project names must consist solely of lowercase letters, numbers, hyphens and underscores (see https://git.io/v1IAl)" + :message "project names must consist solely of lowercase letters, numbers, hyphens and underscores. See https://bit.ly/3MuL20A" :tag "regex-validation-failed"}))) (deftest deploy-requires-ascii-version @@ -843,7 +843,7 @@ :group_name "org.clojars.dantheman" :jar_name "test" :version "1.α.0" - :message "version strings must consist solely of letters, numbers, dots, pluses, hyphens and underscores (see https://git.io/v1IA2)" + :message "version strings must consist solely of letters, numbers, dots, pluses, hyphens and underscores. See https://bit.ly/3Kf5KzX" :tag "regex-validation-failed"}))) (deftest put-on-html-fails