Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs #114

Merged
merged 2 commits into from
Nov 11, 2018
Merged

Docs #114

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading