Skip to content

Commit

Permalink
Merge pull request #343 from johnhawkinson/2023.09.27.acms-permissions
Browse files Browse the repository at this point in the history
2023.09.27.acms permissions
  • Loading branch information
mlissner authored Sep 27, 2023
2 parents 0604790 + 3d45454 commit 7423ea7
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 8 deletions.
7 changes: 6 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ Features:
- None yet

Changes:
- None yet
- Adds permissions to access ACMS URLs. ACMS is the new CM/ECF replacement
for the Second and Ninth Circuit Courts of Appeals, which goes live
for all new cases on Oct. 1, 2023. We do not currently support
ACMS, but because users have to acknlowledge permissions changes,
it's important to get that manual step out of the way as soon as
possible as we work on the code.

Fixes:
- None yet
Expand Down
42 changes: 42 additions & 0 deletions spec/PacerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ describe('The PACER module', function () {
'https://ecf.canb.uscourts.gov/cgi-bin/' + 'DktRpt.pl?caseNumber=1:17-cv-10577&caseId=0';
const appellateDocumentUrl = 'https://ecf.ca2.uscourts.gov/docs1/00205695758';

const AcmsDocketUrl = 'https://ca9-showdoc.azurewebsites.us/23-2081';
const AcmsDocumentUrl = 'https://ca9-showdoc.azurewebsites.us/download-confirmation/c61cb56b-9a5c-ee11-be6e-001dd8087d6a?loadEntry=1';
const EcfCaseQueryAcmsCaseUrl = 'https://ecf.ca9.uscourts.gov/n/beam/servlet/TransportRoom?servlet=CaseQuery.jsp&cnthd=1234567890&caseid=1007067&csnum1=23-2081&shorttitle=International+Brotherhood+of+Teamsters+v.+National+Labor+Relations+Board';
const nonAcmsAzureGovUrl = 'https://dc-ecosproduction.azurewebsites.us/login.aspx';
const AcmsFilingUrl = 'https://ca9-portal.powerappsportals.us/';
const AcmsFilingTestUrl = 'https://ca9-acms-pcx.powerappsportals.us/';
const FedcourtsNinthUrl = 'https://ca9.fedcourts.us';
const FedcourtsBogusUrl = 'https://bogus.fedcourts.us';

function InputContainer() {
document.body.innerHTML = '';
const inputContainer = document.createElement('div');
Expand Down Expand Up @@ -54,6 +63,39 @@ describe('The PACER module', function () {
it('matches even if trailing slash is absent', function () {
expect(PACER.getCourtFromUrl(noTrailingSlashUrl)).toBe('canb');
});

it('matches a valid ACMS docket URL', function () {
expect(PACER.getCourtFromUrl(AcmsDocketUrl)).toBe('ca9');
});

it('matches a valid ACMS document URL', function () {
expect(PACER.getCourtFromUrl(AcmsDocumentUrl)).toBe('ca9');
});

it('matches a valid ECF/PACER CaseQuery for an ACMS docket URL', function () {
expect(PACER.getCourtFromUrl(EcfCaseQueryAcmsCaseUrl)).toBe('ca9');
});

it('ignores a non-ACMS Azure URL', function () {
expect(PACER.getCourtFromUrl(nonAcmsAzureGovUrl)).toBe(null);
});

it('ignores an ACMS production filing URL', function () {
expect(PACER.getCourtFromUrl(AcmsFilingUrl)).toBe(null);
});

it('ignores an ACMS test filing URL', function () {
expect(PACER.getCourtFromUrl(AcmsFilingTestUrl)).toBe(null);
});

it('ignores a Fedcourts email domain as a URL', function () {
expect(PACER.getCourtFromUrl(FedcourtsNinthUrl)).toBe(null);
});

it('ignores a Fedcourts non-court URL', function () {
expect(PACER.getCourtFromUrl(FedcourtsBogusUrl)).toBe(null);
});

});

describe('convertToCourtListenerCourt', function () {
Expand Down
39 changes: 39 additions & 0 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,45 @@
},
"permissions": [
"*://*.uscourts.gov/",
"*://ca1-showdoc.azurewebsites.us/",
"*://ca2-showdoc.azurewebsites.us/",
"*://ca3-showdoc.azurewebsites.us/",
"*://ca4-showdoc.azurewebsites.us/",
"*://ca5-showdoc.azurewebsites.us/",
"*://ca6-showdoc.azurewebsites.us/",
"*://ca7-showdoc.azurewebsites.us/",
"*://ca8-showdoc.azurewebsites.us/",
"*://ca9-showdoc.azurewebsites.us/",
"*://ca10-showdoc.azurewebsites.us/",
"*://ca11-showdoc.azurewebsites.us/",
"*://cafc-showdoc.azurewebsites.us/",
"*://cadc-showdoc.azurewebsites.us/",
"*://ca1-portal.powerappsportals.us/",
"*://ca2-portal.powerappsportals.us/",
"*://ca3-portal.powerappsportals.us/",
"*://ca4-portal.powerappsportals.us/",
"*://ca5-portal.powerappsportals.us/",
"*://ca6-portal.powerappsportals.us/",
"*://ca7-portal.powerappsportals.us/",
"*://ca8-portal.powerappsportals.us/",
"*://ca9-portal.powerappsportals.us/",
"*://ca10-portal.powerappsportals.us/",
"*://ca11-portal.powerappsportals.us/",
"*://cafc-portal.powerappsportals.us/",
"*://cadc-portal.powerappsportals.us/",
"*://ca1.fedcourts.us/",
"*://ca2.fedcourts.us/",
"*://ca3.fedcourts.us/",
"*://ca4.fedcourts.us/",
"*://ca5.fedcourts.us/",
"*://ca6.fedcourts.us/",
"*://ca7.fedcourts.us/",
"*://ca8.fedcourts.us/",
"*://ca9.fedcourts.us/",
"*://ca10.fedcourts.us/",
"*://ca11.fedcourts.us/",
"*://cafc.fedcourts.us/",
"*://cadc.fedcourts.us/",
"notifications",
"storage",
"unlimitedStorage",
Expand Down
26 changes: 19 additions & 7 deletions src/pacer.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,26 @@ let PACER_TO_CL_IDS = {
// called from anywhere; by convention we use an ALL_CAPS name to allude to
// the purity (const-ness) of this object's contents.
let PACER = {
// Returns the court identifier for a given URL, or null if not a PACER site.
// Returns the court identifier for a given URL, or null if not a
// PACER, CM/ECF, or ACMS site.
getCourtFromUrl: function (url) {
// This regex is used as a security check to ensure that no components of
// RECAP are being used outside of PACER. Be sure tests pass appropriately
// before tweaking this regex.
let match = (url || '').toLowerCase().match(
/^\w+:\/\/(ecf|pacer)\.(\w+)(?:\.audio)?\.uscourts\.gov(?:\/.*)?$/);
return match ? match[2] : null;
// This function is used as a security check to ensure that no components of
// RECAP are being used outside of PACER/ECF/ACMS. Be sure tests
// pass appropriately before tweaking these regexes.
if (!url) { return null; }

let match;
// CM/ECF and PACER
match = url.toLowerCase().match(
/^\w+:\/\/(ecf|pacer)\.(\w+)(?:\.audio)?\.uscourts\.gov(?:\/.*)?$/);
if (match) { return match[2]; }

// ACMS
match = url.toLowerCase().match(
/^\w+:\/\/(\w+)-showdoc\.azurewebsites\.us(?:\/.*)?$/);
if (match) { return match[1]; }

return null;
},

// Returns true if the URL is for the login page
Expand Down

0 comments on commit 7423ea7

Please sign in to comment.