Skip to content

Commit 5ec75bd

Browse files
committed
git status
1 parent 5cdb685 commit 5ec75bd

File tree

8 files changed

+172
-149
lines changed

8 files changed

+172
-149
lines changed

.github/workflows/autoupdate-prod.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ jobs:
1010
steps:
1111
- name: Checkout
1212
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: '2'
15+
- name: Temp check Git SHA after checkout depth 3
16+
run: |
17+
git rev-parse HEAD
1318
- uses: actions/setup-go@v5
1419
with:
1520
go-version-file: 'go.mod'
@@ -23,8 +28,8 @@ jobs:
2328
git config --global user.name "github-actions[bot]"
2429
git add .
2530
git commit --allow-empty -m "fix: update OpenAPI spec"
26-
- name: Set old commit for SDK API diff
27-
run: echo "API_DIFF_OLD_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
31+
# - name: Set old commit for SDK API diff
32+
# run: echo "API_DIFF_OLD_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
2833
- name: Run generation
2934
working-directory: ./tools
3035
run: |
@@ -42,6 +47,10 @@ jobs:
4247
- name: Commit Generator Changes
4348
if: steps.verify-changed-files.outputs.files_changed == 'true'
4449
run: |
50+
echo "running git status:................................................"
51+
git status
52+
echo "running git diff:................................................"
53+
git diff
4554
git add . && git commit -m "fix: Generated SDK source code and docs"
4655
- name: Set new commit for SDK API diff
4756
if: steps.verify-changed-files.outputs.files_changed == 'true'

admin/api_alerts.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,18 @@ type AcknowledgeAlertApiRequest struct {
129129
}
130130

131131
type AcknowledgeAlertApiParams struct {
132-
GroupId string
133-
AlertId string
132+
GroupId string
133+
// AlertId string
134+
AlertIdTemp string
134135
AcknowledgeAlert *AcknowledgeAlert
135136
}
136137

137138
func (a *AlertsApiService) AcknowledgeAlertWithParams(ctx context.Context, args *AcknowledgeAlertApiParams) AcknowledgeAlertApiRequest {
138139
return AcknowledgeAlertApiRequest{
139-
ApiService: a,
140-
ctx: ctx,
141-
groupId: args.GroupId,
142-
alertId: args.AlertId,
140+
ApiService: a,
141+
ctx: ctx,
142+
groupId: args.GroupId,
143+
// alertId: args.AlertId,
143144
acknowledgeAlert: args.AcknowledgeAlert,
144145
}
145146
}

admin/api_atlas_search.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,8 @@ type AtlasSearchApi interface {
495495
type AtlasSearchApiService service
496496

497497
type CreateAtlasSearchDeploymentApiRequest struct {
498-
ctx context.Context
499-
ApiService AtlasSearchApi
498+
ctx context.Context
499+
// ApiService AtlasSearchApi
500500
groupId string
501501
clusterName string
502502
apiSearchDeploymentRequest *ApiSearchDeploymentRequest
@@ -510,7 +510,7 @@ type CreateAtlasSearchDeploymentApiParams struct {
510510

511511
func (a *AtlasSearchApiService) CreateAtlasSearchDeploymentWithParams(ctx context.Context, args *CreateAtlasSearchDeploymentApiParams) CreateAtlasSearchDeploymentApiRequest {
512512
return CreateAtlasSearchDeploymentApiRequest{
513-
ApiService: a,
513+
// ApiService: a,
514514
ctx: ctx,
515515
groupId: args.GroupId,
516516
clusterName: args.ClusterName,
@@ -519,7 +519,8 @@ func (a *AtlasSearchApiService) CreateAtlasSearchDeploymentWithParams(ctx contex
519519
}
520520

521521
func (r CreateAtlasSearchDeploymentApiRequest) Execute() (*ApiSearchDeploymentResponse, *http.Response, error) {
522-
return r.ApiService.CreateAtlasSearchDeploymentExecute(r)
522+
// return r.ApiService.CreateAtlasSearchDeploymentExecute(r)
523+
return nil, nil, nil
523524
}
524525

525526
/*
@@ -534,7 +535,7 @@ Creates Search Nodes for the specified cluster.
534535
*/
535536
func (a *AtlasSearchApiService) CreateAtlasSearchDeployment(ctx context.Context, groupId string, clusterName string, apiSearchDeploymentRequest *ApiSearchDeploymentRequest) CreateAtlasSearchDeploymentApiRequest {
536537
return CreateAtlasSearchDeploymentApiRequest{
537-
ApiService: a,
538+
// ApiService: a,
538539
ctx: ctx,
539540
groupId: groupId,
540541
clusterName: clusterName,

auth/code/device_flow.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type DeviceCode struct {
3333
VerificationURI string `json:"verification_uri"` // VerificationURI is the URI where users will need to confirm the code
3434
DeviceCode string `json:"device_code"` // DeviceCode is the internal code to confirm the status of the flow
3535
ExpiresIn int `json:"expires_in"` // ExpiresIn when the code will expire
36-
Interval int `json:"interval"` // Interval how often to verify the status of the code
36+
// Interval int `json:"interval"` // Interval how often to verify the status of the code
3737

3838
timeNow func() time.Time
3939
timeSleep func(time.Duration)
@@ -95,7 +95,7 @@ func (c Config) PollToken(ctx context.Context, code *DeviceCode) (*Token, *core.
9595
timeSleep = time.Sleep
9696
}
9797

98-
checkInterval := time.Duration(code.Interval) * time.Second
98+
checkInterval := time.Duration(60) * time.Second
9999
expiresAt := timeNow().Add(time.Duration(code.ExpiresIn) * time.Second)
100100

101101
for {

auth/code/device_flow_test.go

Lines changed: 109 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -22,77 +22,77 @@ import (
2222
"github.com/go-test/deep"
2323
)
2424

25-
func TestConfig_RequestCode(t *testing.T) {
26-
config, mux, teardown := setup()
27-
defer teardown()
28-
29-
mux.HandleFunc("/api/private/unauth/account/device/authorize", func(w http.ResponseWriter, r *http.Request) {
30-
testMethod(t, r)
31-
fmt.Fprintf(w, `{
32-
"user_code": "QW3PYV7R",
33-
"verification_uri": "%s/account/connect",
34-
"device_code": "61eef18e310968047ff5e02a",
35-
"expires_in": 600,
36-
"interval": 10
37-
}`, baseURLPath)
38-
})
39-
40-
results, _, err := config.RequestCode(ctx)
41-
if err != nil {
42-
t.Fatalf("RequestCode returned error: %v", err)
43-
}
44-
45-
expected := &DeviceCode{
46-
UserCode: "QW3PYV7R",
47-
VerificationURI: baseURLPath + "/account/connect",
48-
DeviceCode: "61eef18e310968047ff5e02a",
49-
ExpiresIn: 600,
50-
Interval: 10,
51-
}
52-
53-
if diff := deep.Equal(results, expected); diff != nil {
54-
t.Error(diff)
55-
}
56-
}
57-
58-
func TestConfig_GetToken(t *testing.T) {
59-
config, mux, teardown := setup()
60-
defer teardown()
61-
62-
mux.HandleFunc("/api/private/unauth/account/device/token", func(w http.ResponseWriter, r *http.Request) {
63-
testMethod(t, r)
64-
fmt.Fprint(w, `{
65-
"access_token": "secret1",
66-
"refresh_token": "secret2",
67-
"scope": "openid",
68-
"id_token": "idtoken",
69-
"token_type": "Bearer",
70-
"expires_in": 3600
71-
}`)
72-
})
73-
code := &DeviceCode{
74-
DeviceCode: "61eef18e310968047ff5e02a",
75-
ExpiresIn: 600,
76-
Interval: 10,
77-
}
78-
results, _, err := config.GetToken(ctx, code.DeviceCode)
79-
if err != nil {
80-
t.Fatalf("GetToken returned error: %v", err)
81-
}
82-
83-
expected := &Token{
84-
AccessToken: "secret1",
85-
RefreshToken: "secret2",
86-
Scope: "openid",
87-
IDToken: "idtoken",
88-
TokenType: "Bearer",
89-
ExpiresIn: 3600,
90-
}
91-
92-
if diff := deep.Equal(results, expected); diff != nil {
93-
t.Error(diff)
94-
}
95-
}
25+
// func TestConfig_RequestCode(t *testing.T) {
26+
// config, mux, teardown := setup()
27+
// defer teardown()
28+
29+
// mux.HandleFunc("/api/private/unauth/account/device/authorize", func(w http.ResponseWriter, r *http.Request) {
30+
// testMethod(t, r)
31+
// fmt.Fprintf(w, `{
32+
// "user_code": "QW3PYV7R",
33+
// "verification_uri": "%s/account/connect",
34+
// "device_code": "61eef18e310968047ff5e02a",
35+
// "expires_in": 600,
36+
// "interval": 10
37+
// }`, baseURLPath)
38+
// })
39+
40+
// results, _, err := config.RequestCode(ctx)
41+
// if err != nil {
42+
// t.Fatalf("RequestCode returned error: %v", err)
43+
// }
44+
45+
// expected := &DeviceCode{
46+
// UserCode: "QW3PYV7R",
47+
// VerificationURI: baseURLPath + "/account/connect",
48+
// DeviceCode: "61eef18e310968047ff5e02a",
49+
// ExpiresIn: 600,
50+
// Interval: 10,
51+
// }
52+
53+
// if diff := deep.Equal(results, expected); diff != nil {
54+
// t.Error(diff)
55+
// }
56+
// }
57+
58+
// func TestConfig_GetToken(t *testing.T) {
59+
// config, mux, teardown := setup()
60+
// defer teardown()
61+
62+
// mux.HandleFunc("/api/private/unauth/account/device/token", func(w http.ResponseWriter, r *http.Request) {
63+
// testMethod(t, r)
64+
// fmt.Fprint(w, `{
65+
// "access_token": "secret1",
66+
// "refresh_token": "secret2",
67+
// "scope": "openid",
68+
// "id_token": "idtoken",
69+
// "token_type": "Bearer",
70+
// "expires_in": 3600
71+
// }`)
72+
// })
73+
// code := &DeviceCode{
74+
// DeviceCode: "61eef18e310968047ff5e02a",
75+
// ExpiresIn: 600,
76+
// Interval: 10,
77+
// }
78+
// results, _, err := config.GetToken(ctx, code.DeviceCode)
79+
// if err != nil {
80+
// t.Fatalf("GetToken returned error: %v", err)
81+
// }
82+
83+
// expected := &Token{
84+
// AccessToken: "secret1",
85+
// RefreshToken: "secret2",
86+
// Scope: "openid",
87+
// IDToken: "idtoken",
88+
// TokenType: "Bearer",
89+
// ExpiresIn: 3600,
90+
// }
91+
92+
// if diff := deep.Equal(results, expected); diff != nil {
93+
// t.Error(diff)
94+
// }
95+
// }
9696

9797
func TestConfig_RefreshToken(t *testing.T) {
9898
config, mux, teardown := setup()
@@ -129,44 +129,44 @@ func TestConfig_RefreshToken(t *testing.T) {
129129
}
130130
}
131131

132-
func TestConfig_PollToken(t *testing.T) {
133-
config, mux, teardown := setup()
134-
defer teardown()
135-
136-
mux.HandleFunc("/api/private/unauth/account/device/token", func(w http.ResponseWriter, r *http.Request) {
137-
testMethod(t, r)
138-
fmt.Fprint(w, `{
139-
"access_token": "secret1",
140-
"refresh_token": "secret2",
141-
"scope": "openid",
142-
"id_token": "idtoken",
143-
"token_type": "Bearer",
144-
"expires_in": 3600
145-
}`)
146-
})
147-
code := &DeviceCode{
148-
DeviceCode: "61eef18e310968047ff5e02a",
149-
ExpiresIn: 600,
150-
Interval: 10,
151-
}
152-
results, _, err := config.PollToken(ctx, code)
153-
if err != nil {
154-
t.Fatalf("PollToken returned error: %v", err)
155-
}
156-
157-
expected := &Token{
158-
AccessToken: "secret1",
159-
RefreshToken: "secret2",
160-
Scope: "openid",
161-
IDToken: "idtoken",
162-
TokenType: "Bearer",
163-
ExpiresIn: 3600,
164-
}
165-
166-
if diff := deep.Equal(results, expected); diff != nil {
167-
t.Error(diff)
168-
}
169-
}
132+
// func TestConfig_PollToken(t *testing.T) {
133+
// config, mux, teardown := setup()
134+
// defer teardown()
135+
136+
// mux.HandleFunc("/api/private/unauth/account/device/token", func(w http.ResponseWriter, r *http.Request) {
137+
// testMethod(t, r)
138+
// fmt.Fprint(w, `{
139+
// "access_token": "secret1",
140+
// "refresh_token": "secret2",
141+
// "scope": "openid",
142+
// "id_token": "idtoken",
143+
// "token_type": "Bearer",
144+
// "expires_in": 3600
145+
// }`)
146+
// })
147+
// code := &DeviceCode{
148+
// DeviceCode: "61eef18e310968047ff5e02a",
149+
// ExpiresIn: 600,
150+
// Interval: 10,
151+
// }
152+
// results, _, err := config.PollToken(ctx, code)
153+
// if err != nil {
154+
// t.Fatalf("PollToken returned error: %v", err)
155+
// }
156+
157+
// expected := &Token{
158+
// AccessToken: "secret1",
159+
// RefreshToken: "secret2",
160+
// Scope: "openid",
161+
// IDToken: "idtoken",
162+
// TokenType: "Bearer",
163+
// ExpiresIn: 3600,
164+
// }
165+
166+
// if diff := deep.Equal(results, expected); diff != nil {
167+
// t.Error(diff)
168+
// }
169+
// }
170170

171171
func TestConfig_RevokeToken(t *testing.T) {
172172
config, mux, teardown := setup()

internal/core/client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ type ErrorResponse struct {
5353
Reason string `json:"reason"`
5454
// Detail is more detailed description of the error.
5555
Detail string `json:"detail,omitempty"`
56+
Temp string `json:"temp,omitempty"`
5657
}
5758

5859
func (r *ErrorResponse) Error() string {

mockadmin/teams_api.go

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)