MCPcopy Create free account
hub / github.com/GetStream/stream-go2 / feedAuth

Method feedAuth

authenticator.go:58–68  ·  view source on GitHub ↗
(resource resource, feed Feed)

Source from the content-addressed store, hash-verified

56}
57
58func (a authenticator) feedAuth(resource resource, feed Feed) authFunc {
59 return func(req *http.Request) error {
60 var feedID string
61 if feed != nil {
62 feedID = a.feedID(feed)
63 } else {
64 feedID = "*"
65 }
66 return a.jwtSignRequest(req, a.jwtFeedClaims(resource, actions[req.Method], feedID))
67 }
68}
69
70func (a authenticator) collectionsAuth(req *http.Request) error {
71 claims := jwt.MapClaims{

Callers 15

TestFeedAuthFunction · 0.95
AddToManyMethod · 0.80
FollowManyMethod · 0.80
UnfollowManyMethod · 0.80
getAppActivitiesMethod · 0.80
UpdateActivitiesMethod · 0.80
updateActivityMethod · 0.80
addActivityMethod · 0.80
addActivitiesMethod · 0.80
removeActivityByIDMethod · 0.80

Calls 3

feedIDMethod · 0.95
jwtSignRequestMethod · 0.95
jwtFeedClaimsMethod · 0.95

Tested by 1

TestFeedAuthFunction · 0.76