| 63 | |
| 64 | |
| 65 | const Option<Subject> createSubject(const Option<Principal>& principal) |
| 66 | { |
| 67 | if (principal.isSome()) { |
| 68 | Subject subject; |
| 69 | |
| 70 | if (principal->value.isSome()) { |
| 71 | subject.set_value(principal->value.get()); |
| 72 | } |
| 73 | |
| 74 | foreachpair (const string& key, const string& value, principal->claims) { |
| 75 | Label* claim = subject.mutable_claims()->mutable_labels()->Add(); |
| 76 | claim->set_key(key); |
| 77 | claim->set_value(value); |
| 78 | } |
| 79 | |
| 80 | return subject; |
| 81 | } |
| 82 | |
| 83 | return None(); |
| 84 | } |
| 85 | |
| 86 | |
| 87 | Future<bool> authorizeLogAccess( |
no test coverage detected