| 100 | |
| 101 | |
| 102 | Option<Error> validateImageID(const string& imageId) |
| 103 | { |
| 104 | if (!strings::startsWith(imageId, "sha512-")) { |
| 105 | return Error("Image ID needs to start with sha512-"); |
| 106 | } |
| 107 | |
| 108 | string hash = strings::remove(imageId, "sha512-", strings::PREFIX); |
| 109 | if (hash.length() != 128) { |
| 110 | return Error("Invalid hash length for: " + hash); |
| 111 | } |
| 112 | |
| 113 | return None(); |
| 114 | } |
| 115 | |
| 116 | |
| 117 | Option<Error> validateLayout(const string& imagePath) |
no test coverage detected