@@ -18,15 +18,21 @@ type (
18
18
Type string `json:"type"`
19
19
Data struct {
20
20
Auth struct {
21
+ Username string `json:"username"`
21
22
Password string `json:"password"`
22
23
ApiHost string `json:"apiHost"`
23
24
ApiPathPrefix string `json:"apiPathPrefix"`
25
+ SshPrivateKey string `json:"sshPrivateKey"`
24
26
} `json:"auth"`
25
27
} `json:"data"`
26
28
} `json:"spec"`
27
29
}
28
30
)
29
31
32
+ func newContextAPI (codefresh Codefresh ) IContextAPI {
33
+ return & context {codefresh }
34
+ }
35
+
30
36
func (c context ) GetGitContexts () (error , * []ContextPayload ) {
31
37
var result []ContextPayload
32
38
var qs = map [string ]string {
@@ -36,7 +42,7 @@ func (c context) GetGitContexts() (error, *[]ContextPayload) {
36
42
37
43
resp , err := c .codefresh .requestAPI (& requestOptions {
38
44
method : "GET" ,
39
- path : "/contexts" ,
45
+ path : "/api/ contexts" ,
40
46
qs : qs ,
41
47
})
42
48
if err != nil {
@@ -45,7 +51,7 @@ func (c context) GetGitContexts() (error, *[]ContextPayload) {
45
51
46
52
err = c .codefresh .decodeResponseInto (resp , & result )
47
53
48
- return nil , & result
54
+ return err , & result
49
55
}
50
56
51
57
func (c context ) GetGitContextByName (name string ) (error , * ContextPayload ) {
@@ -56,7 +62,7 @@ func (c context) GetGitContextByName(name string) (error, *ContextPayload) {
56
62
57
63
resp , err := c .codefresh .requestAPI (& requestOptions {
58
64
method : "GET" ,
59
- path : "/contexts/" + name ,
65
+ path : "/api/ contexts/" + name ,
60
66
qs : qs ,
61
67
})
62
68
if err != nil {
0 commit comments