MCPcopy Create free account
hub / github.com/asternic/wuzapi / sendToUserWebHookWithHmac

Function sendToUserWebHookWithHmac

wmiau.go:96–124  ·  view source on GitHub ↗
(webhookurl string, path string, jsonData []byte, userID string, token string, encryptedHmacKey []byte)

Source from the content-addressed store, hash-verified

94 if now.Sub(state.CreatedAt) > passkeyStateTTL {
95 delete(pendingPasskeyRequests, userID)
96 log.Info().Str("userID", userID).Msg("Passkey state expired and cleaned up")
97 }
98 }
99 pendingPasskeyMu.Unlock()
100 }
101 }()
102}
103
104func storePendingPasskey(userID string, state *PendingPasskeyState) {
105 state.CreatedAt = time.Now()
106 pendingPasskeyMu.Lock()
107 pendingPasskeyRequests[userID] = state
108 pendingPasskeyMu.Unlock()
109}
110
111func getAndConsumePendingPasskey(userID string) *PendingPasskeyState {
112 pendingPasskeyMu.Lock()
113 state, ok := pendingPasskeyRequests[userID]
114 if ok {
115 delete(pendingPasskeyRequests, userID)
116 }
117 pendingPasskeyMu.Unlock()
118 if !ok {
119 return nil
120 }
121 return state
122}
123
124func deletePendingPasskey(userID string) {
125 pendingPasskeyMu.Lock()
126 delete(pendingPasskeyRequests, userID)
127 pendingPasskeyMu.Unlock()

Callers 2

sendToUserWebHookFunction · 0.85
sendEventWithWebHookFunction · 0.85

Calls 4

safeGoFunction · 0.85
callHookWithHmacFunction · 0.85
callHookFileWithHmacFunction · 0.85
GetMethod · 0.80

Tested by

no test coverage detected