@@ -18,15 +18,21 @@ type (
1818 Type string `json:"type"`
1919 Data struct {
2020 Auth struct {
21+ Username string `json:"username"`
2122 Password string `json:"password"`
2223 ApiHost string `json:"apiHost"`
2324 ApiPathPrefix string `json:"apiPathPrefix"`
25+ SshPrivateKey string `json:"sshPrivateKey"`
2426 } `json:"auth"`
2527 } `json:"data"`
2628 } `json:"spec"`
2729 }
2830)
2931
32+ func newContextAPI (codefresh Codefresh ) IContextAPI {
33+ return & context {codefresh }
34+ }
35+
3036func (c context ) GetGitContexts () (error , * []ContextPayload ) {
3137 var result []ContextPayload
3238 var qs = map [string ]string {
@@ -36,7 +42,7 @@ func (c context) GetGitContexts() (error, *[]ContextPayload) {
3642
3743 resp , err := c .codefresh .requestAPI (& requestOptions {
3844 method : "GET" ,
39- path : "/contexts" ,
45+ path : "/api/ contexts" ,
4046 qs : qs ,
4147 })
4248 if err != nil {
@@ -45,7 +51,7 @@ func (c context) GetGitContexts() (error, *[]ContextPayload) {
4551
4652 err = c .codefresh .decodeResponseInto (resp , & result )
4753
48- return nil , & result
54+ return err , & result
4955}
5056
5157func (c context ) GetGitContextByName (name string ) (error , * ContextPayload ) {
@@ -56,7 +62,7 @@ func (c context) GetGitContextByName(name string) (error, *ContextPayload) {
5662
5763 resp , err := c .codefresh .requestAPI (& requestOptions {
5864 method : "GET" ,
59- path : "/contexts/" + name ,
65+ path : "/api/ contexts/" + name ,
6066 qs : qs ,
6167 })
6268 if err != nil {
0 commit comments