-
Notifications
You must be signed in to change notification settings - Fork 110
Request response workspace pre format #764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
359a793
Checkpoint
bretambrose aa12ba8
Checkpoint
bretambrose 0327dcf
Updates
bretambrose f8567cd
Checkpoint pre gen diff
8f357e1
V2 Codegen Building
4632528
Shadow tests
1548624
Fix and refactor tests
a561ae9
Checkpoint
b6276dd
Regen
7f8dac8
Identity tests
bretambrose c802893
Merge branch 'main' into RequestResponseWorkspace
ba0ef19
Codegen and format updates
e519763
V2ServiceError -> V2ErrorResponse
88889a5
unreferenced params
bretambrose be267e3
Trivial change to invoke fresh CI
bretambrose 20a9fe2
Will this setup the env variables?
bretambrose 634aea8
Manual test invoke of cli
bretambrose ec5fb72
Revert "Manual test invoke of cli"
bretambrose 421baab
Does the build have credentials injected?
bretambrose f04dfd6
Check for session
bretambrose d799ec9
non-change to trigger CI
bretambrose bd03d8a
Updated builder to a version that passes session credentials to the c…
bretambrose 3fd6892
Non-change
bretambrose 1799c1a
Non change
bretambrose 5fa7606
Update CI jobs with CI-test credentials
bretambrose c57dec7
Basic CI Prep
bc9273e
Skip service tests on macs where keychain access/code-signing is nece…
2fb685f
Can't have empty test exe
8876976
Provison second parameter
278a5e1
Temporarily allow mac service testing
272cf93
Device location csr
5881ac3
Builder with fleet provisioning env
31e556d
Use credentials with smoke tests too
0e9dc45
Released CRT
bretambrose ae2d4bc
Merge branch 'main' into RequestResponseWorkspacePreFormat
60b947c
Update submodule
3bfee21
Merge branch 'main' into RequestResponseWorkspacePreFormat
bretambrose 25358b0
Updated codegen
1a0902f
Get some credentials before building
6a800a8
Fix race condition in service tests
sfodagain edaad93
Merge branch 'main' into RequestResponseWorkspacePreFormat
sfodagain ef1a389
More data race fixes
sfodagain 7be99cf
Apply clang-format
sfodagain b44ffb1
Apply changes from RequestResponseWorkspace
sfodagain 1242e24
Remove extra credentials
sfodagain d567f64
Request response samples (#801)
sfod File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule aws-crt-cpp
updated
29 files
+1 −1 | .clang-tidy | |
+0 −1 | .github/workflows/ci.yml | |
+18 −26 | CMakeLists.txt | |
+1 −1 | VERSION | |
+1 −1 | crt/aws-c-auth | |
+1 −1 | crt/aws-c-cal | |
+1 −1 | crt/aws-c-common | |
+1 −1 | crt/aws-c-compression | |
+1 −1 | crt/aws-c-event-stream | |
+1 −1 | crt/aws-c-http | |
+1 −1 | crt/aws-c-io | |
+1 −1 | crt/aws-c-mqtt | |
+1 −1 | crt/aws-c-s3 | |
+1 −1 | crt/aws-c-sdkutils | |
+1 −1 | crt/aws-checksums | |
+1 −1 | crt/aws-lc | |
+1 −1 | crt/s2n | |
+1 −0 | include/aws/crt/Variant.h | |
+2 −0 | include/aws/crt/mqtt/Mqtt5Client.h | |
+1 −1 | include/aws/crt/mqtt/MqttConnection.h | |
+2 −0 | include/aws/crt/mqtt/private/Mqtt5ClientCore.h | |
+1 −1 | include/aws/crt/mqtt/private/MqttConnectionCore.h | |
+550 −0 | include/aws/iot/MqttRequestResponseClient.h | |
+493 −0 | source/iot/MqttRequestResponseClient.cpp | |
+5 −0 | source/mqtt/Mqtt5Client.cpp | |
+1 −1 | source/mqtt/MqttConnection.cpp | |
+1 −1 | source/mqtt/MqttConnectionCore.cpp | |
+32 −0 | tests/CMakeLists.txt | |
+1,099 −0 | tests/MqttRequestResponse.cpp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
#pragma once | ||
|
||
/* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0. | ||
* | ||
* This file is generated | ||
*/ | ||
|
||
#include <aws/iotidentity/Exports.h> | ||
|
||
#include <aws/crt/StlAllocator.h> | ||
#include <aws/crt/Types.h> | ||
#include <aws/iot/MqttRequestResponseClient.h> | ||
|
||
#include <functional> | ||
|
||
namespace Aws | ||
{ | ||
namespace Crt | ||
{ | ||
namespace Mqtt | ||
{ | ||
class MqttConnection; | ||
} | ||
namespace Mqtt5 | ||
{ | ||
class Mqtt5Client; | ||
} | ||
} // namespace Crt | ||
} // namespace Aws | ||
|
||
namespace Aws | ||
{ | ||
namespace Iotidentity | ||
{ | ||
|
||
template <typename E> class ServiceErrorV2 | ||
{ | ||
public: | ||
ServiceErrorV2() = delete; | ||
ServiceErrorV2(const ServiceErrorV2<E> &rhs) = default; | ||
ServiceErrorV2(ServiceErrorV2<E> &&rhs) = default; | ||
|
||
explicit ServiceErrorV2(int errorCode) : m_errorCode(errorCode), m_modeledError() {} | ||
|
||
ServiceErrorV2(int errorCode, E &&modeledError) | ||
: m_errorCode(errorCode), m_modeledError(std::move(modeledError)) | ||
{ | ||
} | ||
|
||
~ServiceErrorV2() = default; | ||
|
||
ServiceErrorV2<E> &operator=(const ServiceErrorV2<E> &rhs) = default; | ||
ServiceErrorV2<E> &operator=(ServiceErrorV2<E> &&rhs) = default; | ||
|
||
int GetErrorCode() const { return m_errorCode; } | ||
|
||
bool HasModeledError() const { return m_modeledError.has_value(); } | ||
const E &GetModeledError() const { return m_modeledError.value(); } | ||
|
||
private: | ||
int m_errorCode; | ||
|
||
Aws::Crt::Optional<E> m_modeledError; | ||
}; | ||
|
||
class CreateCertificateFromCsrRequest; | ||
class CreateCertificateFromCsrResponse; | ||
class CreateKeysAndCertificateRequest; | ||
class CreateKeysAndCertificateResponse; | ||
class RegisterThingRequest; | ||
class RegisterThingResponse; | ||
class V2ServiceError; | ||
|
||
using CreateCertificateFromCsrResult = | ||
Aws::Iot::RequestResponse::Result<CreateCertificateFromCsrResponse, ServiceErrorV2<V2ServiceError>>; | ||
using CreateCertificateFromCsrResultHandler = std::function<void(CreateCertificateFromCsrResult &&)>; | ||
|
||
using CreateKeysAndCertificateResult = | ||
Aws::Iot::RequestResponse::Result<CreateKeysAndCertificateResponse, ServiceErrorV2<V2ServiceError>>; | ||
using CreateKeysAndCertificateResultHandler = std::function<void(CreateKeysAndCertificateResult &&)>; | ||
|
||
using RegisterThingResult = | ||
Aws::Iot::RequestResponse::Result<RegisterThingResponse, ServiceErrorV2<V2ServiceError>>; | ||
using RegisterThingResultHandler = std::function<void(RegisterThingResult &&)>; | ||
|
||
/** | ||
* An AWS IoT service that assists with provisioning a device and installing unique client certificates on it | ||
* | ||
* https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html | ||
* | ||
*/ | ||
class AWS_IOTIDENTITY_API IClientV2 | ||
{ | ||
public: | ||
virtual ~IClientV2() = default; | ||
|
||
/** | ||
* Creates a certificate from a certificate signing request (CSR). AWS IoT provides client certificates that | ||
* are signed by the Amazon Root certificate authority (CA). The new certificate has a PENDING_ACTIVATION | ||
* status. When you call RegisterThing to provision a thing with this certificate, the certificate status | ||
* changes to ACTIVE or INACTIVE as described in the template. | ||
* | ||
* | ||
* AWS documentation: | ||
* https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#fleet-provision-api | ||
* | ||
* @param request operation to perform | ||
* @param handler function object to invoke upon operation completion | ||
* | ||
* @returns success/failure | ||
*/ | ||
virtual bool CreateCertificateFromCsr( | ||
const CreateCertificateFromCsrRequest &request, | ||
const CreateCertificateFromCsrResultHandler &handler) = 0; | ||
|
||
/** | ||
* Creates new keys and a certificate. AWS IoT provides client certificates that are signed by the Amazon | ||
* Root certificate authority (CA). The new certificate has a PENDING_ACTIVATION status. When you call | ||
* RegisterThing to provision a thing with this certificate, the certificate status changes to ACTIVE or | ||
* INACTIVE as described in the template. | ||
* | ||
* | ||
* AWS documentation: | ||
* https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#fleet-provision-api | ||
* | ||
* @param request operation to perform | ||
* @param handler function object to invoke upon operation completion | ||
* | ||
* @returns success/failure | ||
*/ | ||
virtual bool CreateKeysAndCertificate( | ||
const CreateKeysAndCertificateRequest &request, | ||
const CreateKeysAndCertificateResultHandler &handler) = 0; | ||
|
||
/** | ||
* Provisions an AWS IoT thing using a pre-defined template. | ||
* | ||
* | ||
* AWS documentation: | ||
* https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#fleet-provision-api | ||
* | ||
* @param request operation to perform | ||
* @param handler function object to invoke upon operation completion | ||
* | ||
* @returns success/failure | ||
*/ | ||
virtual bool RegisterThing( | ||
const RegisterThingRequest &request, | ||
const RegisterThingResultHandler &handler) = 0; | ||
}; | ||
|
||
/** | ||
* Creates a new service client that uses an SDK MQTT5 client for transport. | ||
* | ||
* @param protocolClient MQTT client to use as transport | ||
* @param options request-response MQTT client configuration options | ||
* @param allocator memory allocator to use for all client functionality | ||
* | ||
* @return a new service client | ||
*/ | ||
AWS_IOTIDENTITY_API std::shared_ptr<IClientV2> NewClientFrom5( | ||
const Aws::Crt::Mqtt5::Mqtt5Client &protocolClient, | ||
const Aws::Iot::RequestResponse::RequestResponseClientOptions &options, | ||
Aws::Crt::Allocator *allocator = Aws::Crt::ApiAllocator()); | ||
|
||
/** | ||
* Creates a new service client that uses an SDK MQTT311 client for transport. | ||
* | ||
* @param protocolClient MQTT client to use as transport | ||
* @param options request-response MQTT client configuration options | ||
* @param allocator memory allocator to use for all client functionality | ||
* | ||
* @return a new service client | ||
*/ | ||
AWS_IOTIDENTITY_API std::shared_ptr<IClientV2> NewClientFrom311( | ||
const Aws::Crt::Mqtt::MqttConnection &protocolClient, | ||
const Aws::Iot::RequestResponse::RequestResponseClientOptions &options, | ||
Aws::Crt::Allocator *allocator = Aws::Crt::ApiAllocator()); | ||
|
||
} // namespace Iotidentity | ||
} // namespace Aws |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#pragma once | ||
|
||
/* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0. | ||
* | ||
* This file is generated | ||
*/ | ||
|
||
#include <aws/iotidentity/Exports.h> | ||
|
||
#include <aws/crt/JsonObject.h> | ||
#include <aws/crt/StlAllocator.h> | ||
|
||
namespace Aws | ||
{ | ||
namespace Iotidentity | ||
{ | ||
|
||
/** | ||
* Response document containing details about a failed request. | ||
* | ||
*/ | ||
class AWS_IOTIDENTITY_API V2ServiceError final | ||
{ | ||
public: | ||
V2ServiceError() = default; | ||
|
||
V2ServiceError(const Crt::JsonView &doc); | ||
V2ServiceError &operator=(const Crt::JsonView &doc); | ||
|
||
void SerializeToObject(Crt::JsonObject &doc) const; | ||
|
||
/** | ||
* Response status code | ||
* | ||
*/ | ||
Aws::Crt::Optional<int32_t> StatusCode; | ||
|
||
/** | ||
* Response error code | ||
* | ||
*/ | ||
Aws::Crt::Optional<Aws::Crt::String> ErrorCode; | ||
|
||
/** | ||
* Response error message | ||
* | ||
*/ | ||
Aws::Crt::Optional<Aws::Crt::String> ErrorMessage; | ||
|
||
private: | ||
static void LoadFromObject(V2ServiceError &obj, const Crt::JsonView &doc); | ||
}; | ||
} // namespace Iotidentity | ||
} // namespace Aws |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.