grim/hgkeeper

Remove unused environment variable

11 months ago, aklitzing
cc7d4b7251eb
Remove unused environment variable

It is not necessary since c10e152f5523.

Reviewed at https://reviews.imfreedom.org/r/2447/
package authorized_keys
import (
"fmt"
"strings"
"keep.imfreedom.org/grim/hgkeeper/access"
"keep.imfreedom.org/grim/hgkeeper/globals"
)
type Command struct {
FingerPrint string `kong:"arg,help='The fingerprint of the calling user'"`
HGKeeperExec string `kong:"flag,help='The path to hgkeeper executable',default='hgkeeper'"`
}
func (c *Command) Run(g *globals.Globals) error {
if err := access.Setup(g.ReposPath, g.AdminRepo); err != nil {
return err
}
defer access.Teardown()
pubkey, err := access.PubkeyFromFingerprint(c.FingerPrint)
if err != nil {
return err
}
username, err := access.UsernameFromFingerprint(c.FingerPrint)
if err != nil {
return err
}
options := []string{
fmt.Sprintf("command=\"%s --repos-path='%s' once %s\"", c.HGKeeperExec, g.ReposPath, username),
"restrict",
}
fmt.Printf("%s %s", strings.Join(options, ","), pubkey)
return nil
}