18 lines
539 B
Go
18 lines
539 B
Go
|
|
package track4
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
"net/http"
|
||
|
|
|
||
|
|
httpmiddleware "github.com/explorer/backend/libs/go-http-middleware"
|
||
|
|
)
|
||
|
|
|
||
|
|
type roleManager interface {
|
||
|
|
IsIPWhitelisted(ctx context.Context, operatorAddress string, ipAddress string) (bool, error)
|
||
|
|
LogOperatorEvent(ctx context.Context, eventType string, chainID *int, operatorAddress string, targetResource string, action string, details map[string]interface{}, ipAddress string, userAgent string) error
|
||
|
|
}
|
||
|
|
|
||
|
|
func clientIPAddress(r *http.Request) string {
|
||
|
|
return httpmiddleware.ClientIP(r)
|
||
|
|
}
|