Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,15 @@ mod tests {
assert!(catalog
.allows("github-issues", "GET", "/repositories/123/issues")
.is_some());
// atomic-plugins#5 Phase 1: the composed google-calendar document
// now allows the one write operation Devonian's lens sends.
assert!(catalog
.allows(
"google-calendar",
"PATCH",
"/calendar/v3/calendars/team%40example.com/events/id"
)
.is_some());
}

/// Tests a specific, separately identified catalog revision (not the
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub struct Config {
/// Immutable pinned revision of `localthought/overlays`' `catalog.json` used
/// when `CATALOG_PATH` is not set. Shared with tests that need to validate
/// the exact catalog the application would load by default.
pub const DEFAULT_CATALOG_PATH: &str = "https://raw.githubusercontent.com/localthought/overlays/8f29d9973267b6b3877aa27a5ab50cd41b010e6c/catalog.json";
pub const DEFAULT_CATALOG_PATH: &str = "https://raw.githubusercontent.com/localthought/overlays/5d344a62e36f918a065bab1fbb7736571877673e/catalog.json";

/// Reads a required environment variable and rejects it if unset or blank,
/// so a blank `.env` value fails configuration explicitly instead of being
Expand Down
2 changes: 1 addition & 1 deletion src/identity_catalog_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fn composed_github_identity_uses_numeric_subject_without_google_legacy_mapping()
#[ignore = "downloads the published catalog revision and its pinned OAD sources"]
async fn published_catalog_loads_trusted_google_and_github_identity_operations() {
let catalog = Catalog::load(
"https://raw.githubusercontent.com/localthought/overlays/8f29d9973267b6b3877aa27a5ab50cd41b010e6c/catalog.json",
"https://raw.githubusercontent.com/localthought/overlays/5d344a62e36f918a065bab1fbb7736571877673e/catalog.json",
&crate::build_http_client(),
)
.await
Expand Down
64 changes: 64 additions & 0 deletions tests/identity-catalog/google-calendar-composed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ components:
format: date-time
timeZone:
type: string
etag:
type: string
description: 'Opaque version identifier, present on every read. Send back
as `If-Match` on a PATCH for optimistic-concurrency conflict detection.

'
paginationSchemes:
pageToken:
type: pageToken
Expand Down Expand Up @@ -460,6 +466,64 @@ paths:
x-crud:
action: read
resource: event
patch:
operationId: events-patch
summary: Update fields on an existing event
description: 'A partial update to an event. `If-Match` carries the event''s
last-known ETag for optimistic-concurrency conflict detection; Google returns
412 if the event changed remotely since it was read.

'
parameters:
- name: calendarId
in: path
required: true
schema:
type: string
- name: eventId
in: path
required: true
schema:
type: string
- name: sendUpdates
in: query
required: false
description: Whether to notify attendees of the change.
schema:
type: string
enum:
- all
- externalOnly
- none
- name: If-Match
in: header
required: false
description: The event's last-known ETag.
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/event'
responses:
'200':
description: The updated event.
content:
application/json:
schema:
$ref: '#/components/schemas/event'
'412':
description: The If-Match precondition failed.
security:
- googleOnline:
- https://www.googleapis.com/auth/calendar.events
- googleOffline:
- https://www.googleapis.com/auth/calendar.events
x-crud:
action: update
resource: event
/v1/userinfo:
get:
operationId: getGoogleAuthenticatedPrincipal
Expand Down
22 changes: 15 additions & 7 deletions tests/identity-catalog/sources.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"catalog": {
"path": "catalog.json",
"sha256": "9b79ad36b99b78810e5f276d060fdec1f28deff3f918604e975925d20d8b998c"
"sha256": "8244b8af1193be1fd16ef71b394895e3be17e19e7bb15b07ea6c8763276e397f"
},
"platforms": {
"google-calendar": [
Expand All @@ -10,24 +10,28 @@
"sha256": "093d160025a14c69479bbf30d277a19a83c696f10c3b37d81ccefeddf30f860f"
},
{
"url": "https://raw.githubusercontent.com/localthought/overlays/168a9395a5ce290eee10a6a924c57717e7e0395a/googleapis.com/google-calendar/v3/auth-overlay.yaml",
"sha256": "6ad6b9375eede96fe8981a988301400345ca3c97c3e9ee4b38ab9e358addd1d0"
"url": "https://raw.githubusercontent.com/localthought/overlays/c844b237027e0297e40f5ff540ba041d760f862a/googleapis.com/google-calendar/v3/auth-overlay.yaml",
"sha256": "b03aef38c8c8ec688fcbf5d8280a27927c7f62cc3b2ba838c8b8b927bce99005"
},
{
"url": "https://raw.githubusercontent.com/localthought/overlays/d603d5453e9dc5ec26a1d7a6b9cfaeec934d5f4a/googleapis.com/google-calendar/v3/pagination-overlay.yaml",
"sha256": "38fc738ac451a545084750d984b7ee5cd29db45b7fa8b48c346347ea8342cd84"
},
{
"url": "https://raw.githubusercontent.com/localthought/overlays/d603d5453e9dc5ec26a1d7a6b9cfaeec934d5f4a/googleapis.com/google-calendar/v3/crud-causality-overlay.yaml",
"sha256": "51449d355b3f2708b02aee6efe26f72bc8b5287e8a1e5553d53b0aa632ee4526"
"url": "https://raw.githubusercontent.com/localthought/overlays/c844b237027e0297e40f5ff540ba041d760f862a/googleapis.com/google-calendar/v3/crud-causality-overlay.yaml",
"sha256": "03f8dcf2e65e95af791496804559b9d7b8414869b61832bf6a1da6c504e57023"
},
{
"url": "https://raw.githubusercontent.com/localthought/overlays/0621413709fc88d65e908ae3643ceaaa53872194/googleapis.com/google-calendar/v3/schema-overlay.yaml",
"sha256": "06ba78fc58e56f09e3edebad0a58597fdb14c0078c78508e01e2c6ca2298febd"
"url": "https://raw.githubusercontent.com/localthought/overlays/c844b237027e0297e40f5ff540ba041d760f862a/googleapis.com/google-calendar/v3/schema-overlay.yaml",
"sha256": "7638a04bc9a39cbe03b3b093f9f4a68222e6a08f0d309922fa14015aefe535f0"
},
{
"url": "https://raw.githubusercontent.com/localthought/overlays/ee929c625d3c63dea87bcccae932a98a33138a8f/googleapis.com/google-calendar/v3/identity-overlay.yaml",
"sha256": "9acf145f2a0611202ae199c29976eebe22813e67977354bd057e0446b89cc6f1"
},
{
"path": "googleapis.com/google-calendar/v3/identity-overlay.yaml",
"sha256": "9acf145f2a0611202ae199c29976eebe22813e67977354bd057e0446b89cc6f1"
}
],
"github-issues": [
Expand All @@ -54,6 +58,10 @@
{
"url": "https://raw.githubusercontent.com/localthought/overlays/ee929c625d3c63dea87bcccae932a98a33138a8f/github.com/github-issues/1.1.4/identity-overlay.yaml",
"sha256": "8df50990a4d3d98aeec83a134e0f5f0fc8abf5fc87de4ee32d95e5a616bc5e77"
},
{
"path": "github.com/github-issues/1.1.4/identity-overlay.yaml",
"sha256": "8df50990a4d3d98aeec83a134e0f5f0fc8abf5fc87de4ee32d95e5a616bc5e77"
}
]
}
Expand Down
Loading