RealtimeToken returns a token that can be used client-side to listen in real-time to feed changes.
(readonly bool)
| 130 | |
| 131 | // RealtimeToken returns a token that can be used client-side to listen in real-time to feed changes. |
| 132 | func (f *feed) RealtimeToken(readonly bool) string { |
| 133 | var action action |
| 134 | if readonly { |
| 135 | action = actionRead |
| 136 | } else { |
| 137 | action = actionWrite |
| 138 | } |
| 139 | id := f.client.authenticator.feedID(f) |
| 140 | claims := f.client.authenticator.jwtFeedClaims(resFeed, action, id) |
| 141 | token, err := f.client.authenticator.jwtSignatureFromClaims(claims) |
| 142 | if err != nil { |
| 143 | return "" |
| 144 | } |
| 145 | return token |
| 146 | } |
nothing calls this directly
no test coverage detected