Skip to content

Commit 7ba23ac

Browse files
authored
chore(api): added a migration paragraph to the README (#113)
* chore(api): added a migration paragraph to the README
1 parent cea1ba2 commit 7ba23ac

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,22 @@ If an error occurred, an object like this is returned:
141141
}
142142
```
143143

144+
## Migrating from the public V1 API to the V2 API
145+
146+
### Sunset of the V1 API
147+
148+
The previous iteration of the Observatory JSON API has bee deprecated and will be shut down on October 31, 2024. At some point, there will be a strong reminder of that fact by responding with an error if a special header is not included with the request. At Oct 31 2024, the API will be completely shut down.
149+
150+
### Migrating your application
151+
152+
If you previously used the Observatory API with some automation or a CI context, the switch from the old `/api/v1/analyze` endpoint to the new `/api/v2/scan` endpoint should be painless:
153+
154+
* Replace all API calls to `POST https://http-observatory.security.mozilla.org/api/v1/analyze?host=<HOST TO SCAN>` with `POST https://observatory-api.mdn.mozilla.net/api/v2/scan?host=<HOST TO SCAN>`
155+
* Be aware that the complete list of headers has been removed from the response.
156+
* The POST parameters `rescan` and `hidden` in the POST body have been removed.
157+
* Remove all other requests from your application, if any. If you need any additional information about your scan, open the URL from the `detail_url` field of the response in your browser.
158+
* Note that scans are still limited to one every minute per host, otherwise a cached response is returned.
159+
144160
## Contributing
145161

146162
Our project welcomes contributions from any member of our community.

test/scanner.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe("Scanner", () => {
2929

3030
assert.equal(scanResult.scan.algorithmVersion, 4);
3131
assert.equal(scanResult.scan.grade, "A+");
32-
assert.equal(scanResult.scan.score, 125);
32+
assert.equal(scanResult.scan.score, 100);
3333
assert.equal(scanResult.scan.testsFailed, 0);
3434
assert.equal(scanResult.scan.testsPassed, 10);
3535
assert.equal(scanResult.scan.testsQuantity, 10);

0 commit comments

Comments
 (0)