@@ -10,8 +10,11 @@ import (
1010 "time"
1111
1212 "github.com/localstack/lstk/internal/env"
13+ "github.com/localstack/lstk/internal/version"
1314)
1415
16+ const actor = "lstk"
17+
1518type PlatformAPI interface {
1619 CreateAuthRequest (ctx context.Context ) (* AuthRequest , error )
1720 CheckAuthRequestConfirmed (ctx context.Context , id , exchangeToken string ) (bool , error )
@@ -73,10 +76,20 @@ func NewPlatformClient() *PlatformClient {
7376}
7477
7578func (c * PlatformClient ) CreateAuthRequest (ctx context.Context ) (* AuthRequest , error ) {
76- req , err := http .NewRequestWithContext (ctx , http .MethodPost , c .baseURL + "/v1/auth/request" , nil )
79+ payload := map [string ]string {
80+ "actor" : actor ,
81+ "version" : version .Version (),
82+ }
83+ body , err := json .Marshal (payload )
84+ if err != nil {
85+ return nil , fmt .Errorf ("failed to marshal request: %w" , err )
86+ }
87+
88+ req , err := http .NewRequestWithContext (ctx , http .MethodPost , c .baseURL + "/v1/auth/request" , bytes .NewReader (body ))
7789 if err != nil {
7890 return nil , fmt .Errorf ("failed to create request: %w" , err )
7991 }
92+ req .Header .Set ("Content-Type" , "application/json" )
8093
8194 resp , err := c .httpClient .Do (req )
8295 if err != nil {
0 commit comments