Skip to content

Commit

Permalink
Merge pull request #114 from unarxiv/docs
Browse files Browse the repository at this point in the history
Docs
  • Loading branch information
Xiaozhe Yao committed Nov 11, 2018
2 parents 524e086 + f0ba64a commit 5909707
Show file tree
Hide file tree
Showing 14 changed files with 825 additions and 481 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -19,7 +19,7 @@ format:
# yapf -i cvpm/**/*.py

docs:
npm run docs:build
cd docs && npm run docs:build

package:
python setup.py sdist bdist_wheel
Expand Down
2 changes: 1 addition & 1 deletion cli/config.go
Expand Up @@ -4,7 +4,7 @@
writeConfig()
validateConfig()
getDefaultConfig()
The config file is located at the home dir of current user, under ~/cvpm/config.toml
*/
package main
Expand Down
11 changes: 6 additions & 5 deletions cli/daemon.go
@@ -1,6 +1,6 @@
/*
This file handles daemon and services related tasks.
By using cvpm daemon install, it will install a system service under current user.
By using cvpm daemon install, it will install a system service under current user.
You can uninstall that service by using cvpm daemon uninstall
*/
package main
Expand All @@ -10,6 +10,7 @@ import (
"github.com/gin-gonic/gin"
"net/http"
)

// Default Running Port
const DaemonPort = "10590"

Expand All @@ -21,7 +22,7 @@ type RunRepoRequest struct {
Name string `json:name`
Vendor string `json:vendor`
Solver string `json:solver`
Port string `json:port`
Port string `json:port`
}

// Handle Post Request -> Run a Repo
Expand All @@ -40,9 +41,9 @@ func GetReposHandler(c *gin.Context) {
}

/* Run the Server and Do Mount Endpoint
/status -> Get to fetch System Status
/repo -> Post to Run a Repo
/repos -> Get to fetch Running Repos
/status -> Get to fetch System Status
/repo -> Post to Run a Repo
/repos -> Get to fetch Running Repos
*/
func runServer(port string) {
color.Red("Initiating")
Expand Down
6 changes: 3 additions & 3 deletions cli/handler.go
Expand Up @@ -12,10 +12,10 @@ import (
"bufio"
"fmt"
"github.com/fatih/color"
"github.com/getsentry/raven-go"
"github.com/mitchellh/go-homedir"
"github.com/olekukonko/tablewriter"
"github.com/urfave/cli"
"github.com/getsentry/raven-go"
"golang.org/x/crypto/ssh/terminal"
"log"
"os"
Expand Down Expand Up @@ -106,7 +106,7 @@ func RepoHandler(c *cli.Context) {
"vendor": runParams[0],
"name": runParams[1],
"solver": runParams[2],
"port": runningPort,
"port": runningPort,
}
ClientPost("repo", requestParams)
case "ps":
Expand Down Expand Up @@ -163,5 +163,5 @@ func ConfigHandler(c *cli.Context) {
}

func InitHandler(c *cli.Context) {

}
4 changes: 2 additions & 2 deletions cli/main.go
Expand Up @@ -2,15 +2,15 @@
Package CVPM (main) implements the CLI for CVPM.
To get started, use:
cvpm help
cvpm help
to get a detailed explanation.
*/
package main

import (
"github.com/urfave/cli"
"github.com/getsentry/raven-go"
"github.com/urfave/cli"
"log"
"os"
)
Expand Down
2 changes: 1 addition & 1 deletion cli/repository.go
Expand Up @@ -2,9 +2,9 @@ package main

import (
"fmt"
"github.com/getsentry/raven-go"
"github.com/BurntSushi/toml"
"github.com/fatih/color"
"github.com/getsentry/raven-go"
"gopkg.in/src-d/go-git.v4"
"io/ioutil"
"log"
Expand Down
2 changes: 1 addition & 1 deletion cli/shell.go
Expand Up @@ -2,9 +2,9 @@ package main

import (
"fmt"
"github.com/getsentry/raven-go"
"log"
"os/exec"
"github.com/getsentry/raven-go"
)

func pip(args []string) {
Expand Down
20 changes: 10 additions & 10 deletions cli/user.go
Expand Up @@ -3,15 +3,15 @@ package main
import (
"encoding/json"
"fmt"
"time"
"github.com/fatih/color"
"github.com/alexrudd/cognito-srp"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/external"
"github.com/aws/aws-sdk-go-v2/aws/endpoints"
"github.com/aws/aws-sdk-go-v2/aws/external"
cip "github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider"
"github.com/fatih/color"
"github.com/levigross/grequests"
"log"
"time"
)

type User struct {
Expand All @@ -22,26 +22,26 @@ type User struct {

func (u *User) login() User {
fmt.Println(u.Username)
csrp, _:= cognitosrp.NewCognitoSRP(u.Username, u.Password, "us-east-1_IYJ3FvCKZ", "1jinmsd412vcs8pkhqg5u0gjd2", nil)
csrp, _ := cognitosrp.NewCognitoSRP(u.Username, u.Password, "us-east-1_IYJ3FvCKZ", "1jinmsd412vcs8pkhqg5u0gjd2", nil)
cfg, _ := external.LoadDefaultAWSConfig()
cfg.Region = endpoints.UsEast1RegionID
cfg.Credentials = aws.AnonymousCredentials
svc := cip.New(cfg)
req := svc.InitiateAuthRequest(&cip.InitiateAuthInput{
AuthFlow: cip.AuthFlowTypeUserSrpAuth,
ClientId: aws.String(csrp.GetClientId()),
AuthFlow: cip.AuthFlowTypeUserSrpAuth,
ClientId: aws.String(csrp.GetClientId()),
AuthParameters: csrp.GetAuthParams(),
})
resp, _:= req.Send()
resp, _ := req.Send()
fmt.Println("123456")
fmt.Println(resp.ChallengeName)
if resp.ChallengeName == cip.ChallengeNameTypePasswordVerifier {
challengeInput, _:= csrp.PasswordVerifierChallenge(resp.ChallengeParameters, time.Now())
challengeInput, _ := csrp.PasswordVerifierChallenge(resp.ChallengeParameters, time.Now())
chal := svc.RespondToAuthChallengeRequest(challengeInput)
resp, _:= chal.Send()
resp, _ := chal.Send()
fmt.Println(resp.AuthenticationResult)
} else {

}
return *u
}
Expand Down

0 comments on commit 5909707

Please sign in to comment.