-
Notifications
You must be signed in to change notification settings - Fork 77
Switch to one participant per context #189
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 22 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
e3e034c
Switch to one participant per context.
ivanpauno 2d8f8d6
Reorganize headers. Correct get_default_init_options functions
ivanpauno 1a741a6
Addressed per review comments
ivanpauno cd1b326
Correct rmw_get_zero_initialized_init_options
ivanpauno ee0b354
Store init options in context
ivanpauno 52c5a4c
Add rmw_security_options_fini and setter for secure_root
ivanpauno a90c367
Add context name and namespace
ivanpauno df2fee1
Correct rebasing error
ivanpauno bcffc6e
Use const rcutils_allocator_t *
ivanpauno 9dbd91c
Delete duplicated source file from CMakeLists.txt
ivanpauno ad17a56
Improve documentation in security_options.h
ivanpauno 46bff30
Modify localhost_only default value
ivanpauno 9f10c0b
Address peer review comments
ivanpauno 73d4f1f
Improve error handling in rmw_security_options_set_root_path
ivanpauno 4f74f6e
Delete const qualifier
ivanpauno d6a9a46
Latest update after discussion about supporting sros2
ivanpauno ea3648c
Delete unused function
ivanpauno 27dcc25
Naming: replace context_name with security_context
ivanpauno 54e0a68
Fix linkage problem
ivanpauno 49613b2
Fix build problem on Windows
ivanpauno 3a2b9ef
More windows build errors
ivanpauno 4747320
Address peer review comments
ivanpauno cbb5fc0
Address peer review comment
ivanpauno 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
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
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,40 @@ | ||
| // Copyright 2019 Open Source Robotics Foundation, Inc. | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| #ifndef RMW__LOCALHOST_H_ | ||
| #define RMW__LOCALHOST_H_ | ||
|
|
||
| #include "rmw/visibility_control.h" | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" | ||
| { | ||
| #endif | ||
|
|
||
| /// Used to specify if the context can only communicate through localhost. | ||
| typedef enum RMW_PUBLIC_TYPE rmw_localhost_only_t | ||
| { | ||
| /// Uses ROS_LOCALHOST_ONLY environment variable. | ||
| RMW_LOCALHOST_ONLY_DEFAULT = 0, | ||
| /// Forces using only localhost. | ||
| RMW_LOCALHOST_ONLY_ENABLED = 1, | ||
| /// Forces disabling localhost only. | ||
| RMW_LOCALHOST_ONLY_DISABLED = 2, | ||
| } rmw_localhost_only_t; | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif // RMW__LOCALHOST_H_ |
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,100 @@ | ||
| // Copyright 2020 Open Source Robotics Foundation, Inc. | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| #ifndef RMW__SECURITY_OPTIONS_H_ | ||
| #define RMW__SECURITY_OPTIONS_H_ | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" | ||
| { | ||
| #endif | ||
|
|
||
| #include <stdbool.h> | ||
|
|
||
| #include "rcutils/allocator.h" | ||
|
|
||
| #include "rmw/ret_types.h" | ||
| #include "rmw/visibility_control.h" | ||
|
|
||
| typedef enum RMW_PUBLIC_TYPE rmw_security_enforcement_policy_t | ||
| { | ||
| RMW_SECURITY_ENFORCEMENT_PERMISSIVE, | ||
| RMW_SECURITY_ENFORCEMENT_ENFORCE, | ||
| } rmw_security_enforcement_policy_t; | ||
|
|
||
| typedef struct RMW_PUBLIC_TYPE rmw_security_options_t | ||
| { | ||
| enum rmw_security_enforcement_policy_t enforce_security; | ||
| char * security_root_path; | ||
| } rmw_security_options_t; | ||
|
|
||
| /// Get zero initialized security options. | ||
| RMW_PUBLIC | ||
| rmw_security_options_t | ||
| rmw_get_zero_initialized_security_options(); | ||
|
|
||
| /// Get default initialized security options. | ||
| RMW_PUBLIC | ||
| rmw_security_options_t | ||
| rmw_get_default_security_options(); | ||
|
|
||
| /// Copy the given security options. | ||
| /** | ||
| * \param src security options to be copied. | ||
| * \param allocator allocator used when copying data to the new security options. | ||
| * \param dst security options to be set. | ||
| * \returns RMW_RET_BAD_ALLOC, or | ||
| * \returns RMW_RET_OK | ||
| */ | ||
| RMW_PUBLIC | ||
| rmw_ret_t | ||
| rmw_security_options_copy( | ||
| const rmw_security_options_t * src, | ||
| const rcutils_allocator_t * allocator, | ||
| rmw_security_options_t * dst); | ||
|
|
||
| /// Set the security root path for the given security options. | ||
| /** | ||
| * The provided `security_root_path` will be copied into allocated memory. | ||
| * | ||
| * \param security_root_path path to be set. | ||
| * \param allocator allocator used to allocate the new path. | ||
| * \param security_options security options to be set. | ||
| * \returns RMW_RET_BAD_ALLOC, or | ||
| * \returns RMW_RET_OK | ||
| */ | ||
| rmw_ret_t | ||
| rmw_security_options_set_root_path( | ||
| const char * security_root_path, | ||
| const rcutils_allocator_t * allocator, | ||
| rmw_security_options_t * security_options); | ||
|
|
||
| /// Finalize the given security_options. | ||
ivanpauno marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| /** | ||
| * \param security_options security options to be finalized. | ||
| * \param allocator allocator used to deallocate the root path. | ||
| * \returns RMW_RET_ERROR, or | ||
| * \returns RMW_RET_OK | ||
| */ | ||
| RMW_PUBLIC | ||
| rmw_ret_t | ||
| rmw_security_options_fini( | ||
| rmw_security_options_t * security_options, | ||
| const rcutils_allocator_t * allocator); | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif // RMW__SECURITY_OPTIONS_H_ | ||
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 was deleted.
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.