| 36 | |
| 37 | |
| 38 | static void json(JSON::ObjectWriter* writer, const Principal& principal) |
| 39 | { |
| 40 | if (principal.value.isSome()) { |
| 41 | writer->field("value", principal.value.get()); |
| 42 | } |
| 43 | if (!principal.claims.empty()) { |
| 44 | writer->field("claims", principal.claims); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | |
| 49 | std::ostream& operator<<(std::ostream& stream, const Principal& principal) |