google / cap-library

Common Alerting Protocol Library
Apache License 2.0
81 stars 30 forks source link

addresses tag should be optional #8

Closed sschiavoni closed 9 years ago

sschiavoni commented 9 years ago

Original issue 9 created by shakusa@google.com on 2011-03-28T14:17:12.000Z:

As reported by Gary Ham:

I did find an issue, however. Starting with CAP 1.2, <addresses> is allowed as an optional tag in a Public CAP message. IPAWS-OPEN uses <addresses> for CAP 1.1 messages as well. Since the schema does not enforce the non-use of addresses, we did not try to get the Standards body to change 1.1. But the change was put into 1.2. So, please change your validation to allow <addresses> of <scope> = “Public” for CAP 1.2. (If you would relax it for CAP 1.1 as well, we would appreciate that as well. J)

Confirmed for 1.2 (http://docs.oasis-open.org/emergency/cap/v1.2/CAP-v1.2-os.html) addresses is (1) Required when <scope> is “Private”, optional when <scope> is “Public” or “Restricted”.

For 1.1 (http://www.oasis-open.org/committees/download.php/14759/emergency-CAPv1.1.pdf) addresses is Used when <scope> value is "Private"

However, the schema does not enforce this, so it seems reasonable to relax the constraint.

This is a simple change here: http://code.google.com/p/cap-library/source/browse/java/src/com/google/publicalerts/cap/CapValidator.java#&nbsp;111

sschiavoni commented 9 years ago

Comment #1 originally posted by shakusa@google.com on 2011-03-28T21:37:57.000Z:

http://codereview.appspot.com/4276081

sschiavoni commented 9 years ago

Comment #2 originally posted by shakusa@google.com on 2011-03-30T00:04:13.000Z:

Fix committed and pushed live.