MCPcopy
hub / github.com/tmrts/go-patterns / authorizeUser

Function authorizeUser

structural/proxy/main.go:117–127  ·  view source on GitHub ↗

authorize validates user right to execute commands

(user string)

Source from the content-addressed store, hash-verified

115
116// authorize validates user right to execute commands
117func authorizeUser(user string) (err error) {
118 // As we use terminal like proxy, then
119 // we will intercept user name to validate if it's allowed to execute commands
120 if user != "gopher" {
121 // Do some logs, notifications etc...
122 err = fmt.Errorf("User %s in black list", user)
123 return
124 }
125
126 return
127}

Callers 1

NewTerminalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected