-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Log auth document URL when Catalog Root link missing. (PP-1209) (#45)
- Loading branch information
Showing
5 changed files
with
84 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,53 @@ | ||
import { OPDS1 } from "interfaces"; | ||
|
||
export const authDoc: OPDS1.AuthDocument = { | ||
const baseAuthDoc: OPDS1.AuthDocument = { | ||
id: "auth-doc-id", | ||
title: "auth doc title", | ||
description: "auth doc description", | ||
links: [], | ||
authentication: [] | ||
}; | ||
|
||
export const authDoc: OPDS1.AuthDocument = { | ||
...baseAuthDoc, | ||
links: [ | ||
...(baseAuthDoc.links ?? []), | ||
{ | ||
rel: OPDS1.SelfRel, | ||
href: "/auth-doc" | ||
}, | ||
{ | ||
rel: OPDS1.CatalogRootRel, | ||
href: "/catalog-root" | ||
} | ||
], | ||
authentication: [] | ||
] | ||
}; | ||
|
||
export const authDocNoLinks: OPDS1.AuthDocument = { ...baseAuthDoc }; | ||
|
||
export const authDocNoCatalogRoot: OPDS1.AuthDocument = { | ||
...baseAuthDoc, | ||
links: [ | ||
...(baseAuthDoc.links ?? []), | ||
{ | ||
rel: OPDS1.SelfRel, | ||
href: "/auth-doc" | ||
} | ||
] | ||
}; | ||
|
||
// This is not a valid auth doc, since the `href` is missing for the catalog | ||
// root link. But we don't control these, so it could happen. | ||
export const authDocNoCatalogRootHref: OPDS1.AuthDocument = { | ||
...baseAuthDoc, | ||
links: [ | ||
...(baseAuthDoc.links ?? []), | ||
{ | ||
rel: OPDS1.SelfRel, | ||
href: "/auth-doc" | ||
}, | ||
{ | ||
rel: OPDS1.CatalogRootRel | ||
} | ||
] | ||
} as OPDS1.AuthDocument; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters