Avoid leaking admin-ness into threshold-oriented alarms

Fixes bug 1237567

Previously when an admin created a threshold-oriented alarm on
behalf of an non-admin identity, this had the effect of leaking
visibility onto statistics for resources that would not normally
be visible to the non-admin tenant.

Now we ensure that an additional implicit threshold rule query
constraint is added on the project ID of the non-admin indentity
that will ultimately own the alarm.

This is acheived by splitting the query validation from the
construction of the kwargs from the query. The addition of the
implicit query constraint to the threshold rule can then be
delayed to a later point in the dispatch path where the full
context of the alarm is known (so that we can check for the case
where the alarm is created by an admin on behalf of another tenant).

Change-Id: I1adae8c899112e7c3eb4e94f3f68262c84a98574
Avoid leaking admin-ness into combination alarms

Previously when an admin created a combination alarm on
behalf of an non-admin identity, this had the effect of leaking
visibility onto alarms that would not normally
be visible to the non-admin tenant.

Now we validate all alarm ids with the project ID of the non-admin
identity that will ultimately own the alarm instead of the project ID
of the API caller.

Fixes bug #1237632

Change-Id: I5d1cf41c9182f09bc37b93deb14dda58f1d6dcd6
Change alarm_history.detail to text type

The existing alarm_history.detail column size is 255 chars,
which is not enough for some large JSON payloads.

Change to Text column to make sure we store all detail.

Change-Id: I1b4ebee33954acc1f41a4cf0d0b991055b7d4fe9
Closes-Bug: #1236861
Signed-off-by: Stephen Gran <stephen.gran@guardian.co.uk>
Merge "Avoid leaking admin-ness into threshold-oriented alarms"
Merge "Change alarm_history.detail to text type"
Merge "Avoid leaking admin-ness into combination alarms"