forked from TrueCloudLab/frostfs-node
[#908] adm: Support frostfsid basic operations
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
parent
be33070550
commit
0e3d144695
5 changed files with 367 additions and 3 deletions
|
@ -3,9 +3,11 @@ package morph
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
commonCmd "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/internal/common"
|
||||
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
|
||||
"github.com/nspcc-dev/neo-go/pkg/encoding/address"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
|
@ -31,3 +33,28 @@ func getFrostfsIDAdmin(v *viper.Viper) (util.Uint160, bool, error) {
|
|||
}
|
||||
return util.Uint160{}, true, fmt.Errorf("frostfsid: admin is invalid: '%s'", admin)
|
||||
}
|
||||
|
||||
func getFrostfsIDSubjectKey(cmd *cobra.Command) *keys.PublicKey {
|
||||
subjKeyHex, _ := cmd.Flags().GetString(subjectKeyFlag)
|
||||
subjKey, err := keys.NewPublicKeyFromString(subjKeyHex)
|
||||
commonCmd.ExitOnErr(cmd, "invalid subject key: %w", err)
|
||||
return subjKey
|
||||
}
|
||||
|
||||
//func decodeFrostfsIDNamespaces(resStack []stackitem.Item) ([]string, error) {
|
||||
// var res []string
|
||||
//
|
||||
// if len(resStack) == 0 {
|
||||
// return res, nil
|
||||
// }
|
||||
//
|
||||
// if len(resStack) > 0 {
|
||||
// nodes, err := decodeNodeList(resStack[0])
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
//
|
||||
// nm.SetNodes(nodes)
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue