Skip to content

Commit

Permalink
Refactor the errorReportingFilter out of standardImportActions into s…
Browse files Browse the repository at this point in the history
…tandardImportTail to allow standardImportActions to be called without necessarily reporting anything.

Abolish standardVerifyActions in favour of a call on the new standardImportActions followed by errorTerminatingFilter.
  • Loading branch information
iay committed Sep 10, 2013
1 parent b289420 commit b7b7ad5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 42 deletions.
3 changes: 2 additions & 1 deletion mdx/at_aconet/verbs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
<property name="stages">
<list>
<ref bean="at_aconet_edugainEntities"/>
<ref bean="standardVerifyActions"/>
<ref bean="standardImportActions"/>
<ref bean="errorTerminatingFilter"/>
</list>
</property>
</bean>
Expand Down
45 changes: 6 additions & 39 deletions mdx/common-beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,10 @@
Standard actions performed on any metadata import channel. Assumes that the
collection has been acquired, had its signature validated, and disassembled into
individual entities.
The result is a collection of entities, some of which may be labelled with
errors. No announcement of removal of those entities is performed here;
that is left to the caller.
-->
<bean id="standardImportActions" parent="CompositeStage"
p:id="standardImportActions">
Expand All @@ -698,45 +702,6 @@
<ref bean="removeEmptyExtensions"/>
<ref bean="checkSchemas"/>
<ref bean="CHECK_imported"/>
<ref bean="errorAnnouncingFilter"/>
</list>
</property>
</bean>

<!--
standardVerifyActions
Standard actions performed on any metadata import channel when verifying the
entities instead of importing them. The only difference between this and
standardImportActions is that an errorTerminatingFilter is used at the end
instead of an errorAnnouncingFilter.
Assumes that the collection has been acquired, had its signature validated, and
disassembled into individual entities.
-->
<bean id="standardVerifyActions" parent="CompositeStage"
p:id="standardVerifyActions">
<property name="composedStages">
<list>
<ref bean="populateItemIds"/>
<ref bean="populateRegistrationAuthorities"/>

<!--
The following three namespaces are always stripped because they are
specific to the UK registrar and can't be valid when imported from
some other source.
-->
<ref bean="stripUkfedlabelNamespace"/>
<ref bean="stripWayfNamespace"/>

<!-- Strip all entity attributes from this source. -->
<ref bean="stripMdattrNamespace"/>

<ref bean="cleanImport"/>
<ref bean="removeEmptyExtensions"/>
<ref bean="checkSchemas"/>
<ref bean="CHECK_imported"/>
<ref bean="errorTerminatingFilter"/>
</list>
</property>
</bean>
Expand All @@ -759,6 +724,8 @@
p:id="standardImportTail">
<property name="composedStages">
<list>
<!-- announce and remove any entities with errors -->
<ref bean="errorAnnouncingFilter"/>
<ref bean="assemble"/>
<ref bean="normaliseNamespaces"/>
</list>
Expand Down
2 changes: 1 addition & 1 deletion mdx/conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Aggregate names such as the above are used in the construction of bean names:
* `channel_xxxAggregate` is a composite stage that fetches the channel's `xxx` aggregate. The result will normally be a single `DomDocumentItem` whose document element is an `EntitiesDescriptor`. Execution will be terminated via `errorTerminatingFilter` if, for example, the signature does not verify.
* `channel_xxxEntities` is a composite stage that fetches the channel's `xxx` aggregate, checks that aggregate's global properties (signature, validity) and then disassembles it into a collection of entites each represented by a `DomDocumentItem` whose document element is an `EntityDescriptor`. Channel-specific rules such as presence of and appropriate values for `registrationAuthority` are checked but not enforced by this stage. Channel-independent checks and the enforcement of all checks (announcement, filtering or termination) are the responsibility of the caller.

**Note:** The conventions around which part of the system are responsible for performing and enforcing checks were changed around 2013-08-12. Previously, `channel_xxxEntities` beans both performed checks and enforced them. Now, `beans.xml` beans perform only channel-specific checks and never enforce. In most cases, this means the movement of `standardImportActions` and `stripMdattrNamespace` from the `...Entities` bean to all callers. `stripMdattrNamespace` has therefore been included in both `standardImportActions` and `standardVerifyActions` to make this transition simpler.
**Note:** The conventions around which part of the system are responsible for performing and enforcing checks were changed around 2013-08-12. Previously, `channel_xxxEntities` beans both performed checks and enforced them. Now, `beans.xml` beans perform only channel-specific checks and never enforce. In most cases, this means the movement of `standardImportActions` and `stripMdattrNamespace` from the `...Entities` bean to all callers. `stripMdattrNamespace` has therefore been included in `standardImportActions` to make this transition simpler.

As well as the physical aggregates published by a federation, the name `exported` is used (as for example in the bean name `channel_exportedEntities`) to represent the aggregate that either is that used for import by the UK federation, or is closest in spirit to that purpose. This aggregate is usually selected as follows, in descending order of preference:

Expand Down
3 changes: 2 additions & 1 deletion mdx/se_swamid/verbs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
<property name="stages">
<list>
<ref bean="se_swamid_edugainEntities"/>
<ref bean="standardVerifyActions"/>
<ref bean="standardImportActions"/>
<ref bean="errorTerminatingFilter"/>
</list>
</property>
</bean>
Expand Down
1 change: 1 addition & 0 deletions mdx/uk/generate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
<ref bean="removeUKEntities"/>
<ref bean="removeBlacklistedEntities"/>
<ref bean="standardImportActions"/>
<ref bean="errorAnnouncingFilter"/>
<ref bean="uk_fix_mailto"/>
<ref bean="uk_hide_idps"/>
</list>
Expand Down

0 comments on commit b7b7ad5

Please sign in to comment.