()
| 263 | } |
| 264 | |
| 265 | func GenTerminalSessionId() (string, error) { |
| 266 | bytes := make([]byte, 16) |
| 267 | if _, err := rand.Read(bytes); err != nil { |
| 268 | return "", err |
| 269 | } |
| 270 | id := make([]byte, hex.EncodedLen(len(bytes))) |
| 271 | hex.Encode(id, bytes) |
| 272 | return string(id), nil |
| 273 | } |
| 274 | |
| 275 | // isValidShell checks if the shell is an allowed one |
| 276 | func isValidShell(validShells []string, shell string) bool { |
no test coverage detected