awslabs / aws-sdk-rust

AWS SDK for the Rust Programming Language
https://awslabs.github.io/aws-sdk-rust/
Apache License 2.0
3.01k stars 248 forks source link

sdk_apimanagement for a Websocket in Lambda - Error: NoMatchingAuthScheme #978

Closed Sandy-Garrido closed 10 months ago

Sandy-Garrido commented 10 months ago

Describe the bug

Prefacing this issue with the fact that it could be my misconfiguring.

I'm currently having trouble posting a message back to a connection via a Websocket API.

I've tried a few things such as getting credentials using some of the methods I've seen around github but whichever way I do try I just haven't managed to crack the right combination.

I have a lambda role which I usually set privs there but it doesn't seem to even work when I give it full admin. I assumed action execute-api:ManageConnections would suffice?

Expected Behavior

I just expected either a less confusing error message or a success :D

Current Behavior

Error sending message to connection: 
DispatchFailure(DispatchFailure 
{ source: ConnectorError { kind: Other(None), 
source: NoMatchingAuthScheme, connection: Unknown } })

Reproduction Steps

// not 100% certain what endpoint url it needs here?
// https://xxxxx.execute-api.xx-xx-xx.amazonaws.com/dev/@connections ??
let endpoint_url = "xxxxxx";

let config = SdkConfig::builder()
  .endpoint_url(endpoint_url)
  .behavior_version(BehaviorVersion::latest())
  .build();
let client = aws_sdk_apigatewaymanagement::Client::new(&config);

client
  .post_to_connection()
  .connection_id(connection_id)
  .data(data_as_blob)
  .send().await;

Possible Solution

No response

Additional Information/Context

No response

Version

├── aws-config v1.0.1
│   ├── aws-credential-types v1.0.1
│   │   ├── aws-smithy-async v1.0.1
│   │   ├── aws-smithy-runtime-api v1.0.1
│   │   │   ├── aws-smithy-async v1.0.1 (*)
│   │   │   ├── aws-smithy-types v1.0.1
│   │   ├── aws-smithy-types v1.0.1 (*)
│   ├── aws-http v0.60.0
│   │   ├── aws-smithy-runtime-api v1.0.1 (*)
│   │   ├── aws-smithy-types v1.0.1 (*)
│   │   ├── aws-types v1.0.1
│   │   │   ├── aws-credential-types v1.0.1 (*)
│   │   │   ├── aws-smithy-async v1.0.1 (*)
│   │   │   ├── aws-smithy-runtime-api v1.0.1 (*)
│   │   │   ├── aws-smithy-types v1.0.1 (*)
│   ├── aws-runtime v1.0.1
│   │   ├── aws-credential-types v1.0.1 (*)
│   │   ├── aws-http v0.60.0 (*)
│   │   ├── aws-sigv4 v1.0.1
│   │   │   ├── aws-credential-types v1.0.1 (*)
│   │   │   ├── aws-smithy-http v0.60.0
│   │   │   │   ├── aws-smithy-runtime-api v1.0.1 (*)
│   │   │   │   ├── aws-smithy-types v1.0.1 (*)
│   │   │   ├── aws-smithy-runtime-api v1.0.1 (*)
│   │   │   ├── aws-smithy-types v1.0.1 (*)
│   │   ├── aws-smithy-async v1.0.1 (*)
│   │   ├── aws-smithy-http v0.60.0 (*)
│   │   ├── aws-smithy-runtime-api v1.0.1 (*)
│   │   ├── aws-smithy-types v1.0.1 (*)
│   │   ├── aws-types v1.0.1 (*)
│   ├── aws-sdk-sso v1.1.0
│   │   ├── aws-credential-types v1.0.1 (*)
│   │   ├── aws-http v0.60.0 (*)
│   │   ├── aws-runtime v1.0.1 (*)
│   │   ├── aws-smithy-async v1.0.1 (*)
│   │   ├── aws-smithy-http v0.60.0 (*)
│   │   ├── aws-smithy-json v0.60.0
│   │   │   └── aws-smithy-types v1.0.1 (*)
│   │   ├── aws-smithy-runtime v1.0.1
│   │   │   ├── aws-smithy-async v1.0.1 (*)
│   │   │   ├── aws-smithy-http v0.60.0 (*)
│   │   │   ├── aws-smithy-runtime-api v1.0.1 (*)
│   │   │   ├── aws-smithy-types v1.0.1 (*)
│   │   ├── aws-smithy-runtime-api v1.0.1 (*)
│   │   ├── aws-smithy-types v1.0.1 (*)
│   │   ├── aws-types v1.0.1 (*)
│   ├── aws-sdk-ssooidc v1.1.0
│   │   ├── aws-credential-types v1.0.1 (*)
│   │   ├── aws-http v0.60.0 (*)
│   │   ├── aws-runtime v1.0.1 (*)
│   │   ├── aws-smithy-async v1.0.1 (*)
│   │   ├── aws-smithy-http v0.60.0 (*)
│   │   ├── aws-smithy-json v0.60.0 (*)
│   │   ├── aws-smithy-runtime v1.0.1 (*)
│   │   ├── aws-smithy-runtime-api v1.0.1 (*)
│   │   ├── aws-smithy-types v1.0.1 (*)
│   │   ├── aws-types v1.0.1 (*)
│   ├── aws-sdk-sts v1.3.0
│   │   ├── aws-credential-types v1.0.1 (*)
│   │   ├── aws-http v0.60.0 (*)
│   │   ├── aws-runtime v1.0.1 (*)
│   │   ├── aws-smithy-async v1.0.1 (*)
│   │   ├── aws-smithy-http v0.60.0 (*)
│   │   ├── aws-smithy-json v0.60.0 (*)
│   │   ├── aws-smithy-query v0.60.0
│   │   │   ├── aws-smithy-types v1.0.1 (*)
│   │   ├── aws-smithy-runtime v1.0.1 (*)
│   │   ├── aws-smithy-runtime-api v1.0.1 (*)
│   │   ├── aws-smithy-types v1.0.1 (*)
│   │   ├── aws-smithy-xml v0.60.0
│   │   ├── aws-types v1.0.1 (*)
│   ├── aws-smithy-async v1.0.1 (*)
│   ├── aws-smithy-http v0.60.0 (*)
│   ├── aws-smithy-json v0.60.0 (*)
│   ├── aws-smithy-runtime v1.0.1 (*)
│   ├── aws-smithy-runtime-api v1.0.1 (*)
│   ├── aws-smithy-types v1.0.1 (*)
│   ├── aws-types v1.0.1 (*)
├── aws-sdk-apigatewaymanagement v1.3.0
│   ├── aws-credential-types v1.0.1 (*)
│   ├── aws-http v0.60.0 (*)
│   ├── aws-runtime v1.0.1 (*)
│   ├── aws-smithy-async v1.0.1 (*)
│   ├── aws-smithy-http v0.60.0 (*)
│   ├── aws-smithy-json v0.60.0 (*)
│   ├── aws-smithy-runtime v1.0.1 (*)
│   ├── aws-smithy-runtime-api v1.0.1 (*)
│   ├── aws-smithy-types v1.0.1 (*)
│   ├── aws-types v1.0.1 (*)
├── aws-sdk-cognitoidentityprovider v1.3.0
│   ├── aws-credential-types v1.0.1 (*)
│   ├── aws-http v0.60.0 (*)
│   ├── aws-runtime v1.0.1 (*)
│   ├── aws-smithy-async v1.0.1 (*)
│   ├── aws-smithy-http v0.60.0 (*)
│   ├── aws-smithy-json v0.60.0 (*)
│   ├── aws-smithy-runtime v1.0.1 (*)
│   ├── aws-smithy-runtime-api v1.0.1 (*)
│   ├── aws-smithy-types v1.0.1 (*)
│   ├── aws-types v1.0.1 (*)
├── aws-sdk-dynamodb v1.3.0
│   ├── aws-credential-types v1.0.1 (*)
│   ├── aws-http v0.60.0 (*)
│   ├── aws-runtime v1.0.1 (*)
│   ├── aws-smithy-async v1.0.1 (*)
│   ├── aws-smithy-http v0.60.0 (*)
│   ├── aws-smithy-json v0.60.0 (*)
│   ├── aws-smithy-runtime v1.0.1 (*)
│   ├── aws-smithy-runtime-api v1.0.1 (*)
│   ├── aws-smithy-types v1.0.1 (*)
│   ├── aws-types v1.0.1 (*)
├── aws-sdk-sts v1.3.0 (*)
│   ├── aws-sdk-dynamodb v0.39.0
│   │   ├── aws-credential-types v1.0.1 (*)
│   │   ├── aws-http v0.60.0 (*)
│   │   ├── aws-runtime v1.0.1 (*)
│   │   ├── aws-smithy-async v1.0.1 (*)
│   │   ├── aws-smithy-http v0.60.0 (*)
│   │   ├── aws-smithy-json v0.60.0 (*)
│   │   ├── aws-smithy-runtime v1.0.1 (*)
│   │   ├── aws-smithy-runtime-api v1.0.1 (*)
│   │   ├── aws-smithy-types v1.0.1 (*)
│   │   ├── aws-types v1.0.1 (*)

Environment details (OS name and version, etc.)

Custom runtime on Amazon Linux 2 - cargo lambda v1 Rust Function

Logs

No response

jdisanti commented 10 months ago

You need to configure credentials. Unfortunately, the error message is really bad right now. We're working on a fix in #979.