Skip to content

Commit b8b3613

Browse files
committed
ipn/yegor: send cid did pair for all api calls
1 parent 9440420 commit b8b3613

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

intra/ipn/rpn/yegor.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ type WsErrorResponse struct {
182182
Desc string `json:"errorDescription"`
183183
LogStatus string `json:"logStatus"`
184184
Failures map[string]any `json:"validationFailuresArray"`
185+
// RPN errors
186+
Error string `json:"error"`
187+
Details string `json:"details,omitempty"`
185188
}
186189

187190
/*
@@ -1035,12 +1038,14 @@ func baseurl(test bool, cid, did string) *url.URL {
10351038
return &u
10361039
}
10371040

1038-
func assetsurl(test bool) *url.URL {
1041+
func assetsurl(test bool, cid, did string) *url.URL {
10391042
u := url.URL{
10401043
Scheme: "https",
10411044
Host: svchosttest,
10421045
}
10431046
q := u.Query()
1047+
q.Set("cid", cid)
1048+
q.Set("did", did)
10441049
if test {
10451050
q.Set("rpn", "wsassetstest")
10461051
q.Set("test", "") // value for the test param does not matter
@@ -1154,12 +1159,17 @@ func getSession(h *http.Client, ent *WsEntitlement) (*WsSession, error) {
11541159
if len(tok) <= 0 {
11551160
return nil, errWsNoToken
11561161
}
1162+
cid := ent.Cid
1163+
if len(cid) <= 0 {
1164+
return nil, errWsNoCid
1165+
}
1166+
did := ent.Did
11571167
tokst := tokenState(tok)
11581168
/*
11591169
curl -x GET '.../Session'
11601170
-H 'Authorization: Bearer id:typ:epochsec:sig1:sig2'
11611171
*/
1162-
u := baseurl(ent.TestDomain, ent.Cid, ent.Did).JoinPath(wssessionpath)
1172+
u := baseurl(ent.TestDomain, cid, did).JoinPath(wssessionpath)
11631173
req, err := http.NewRequest("GET", u.String(), nil)
11641174
if err != nil {
11651175
return nil, log.EE("ws: getsess: make req err: %v", err)
@@ -1358,10 +1368,15 @@ func getServerList(h *http.Client, sess *WsSession, ent *WsEntitlement) (*WsServ
13581368
if len(bearer) <= 0 {
13591369
return nil, errWsNoToken
13601370
}
1371+
cid := ent.Cid
1372+
if len(cid) <= 0 {
1373+
return nil, errWsNoCid
1374+
}
1375+
did := ent.Did
13611376
test := ent.TestDomain
13621377

13631378
// curl -x GET '.../serverlist/mob-v2/1/<lochash>'
1364-
u := assetsurl(test).JoinPath(wslocpath, lochash)
1379+
u := assetsurl(test, cid, did).JoinPath(wslocpath, lochash)
13651380
locreq, err := http.NewRequest("GET", u.String(), nil)
13661381
if err != nil {
13671382
return nil, log.EE("ws: wgconfs: req err: %v", err)

0 commit comments

Comments
 (0)