* Exports the configuration, including all the available settings * specific to the Linux client. The output format is JSON. * * @return Returns a Json::Value object containing the serialized * configuration profile */
| 580 | * configuration profile |
| 581 | */ |
| 582 | Json::Value Configuration::Export() const |
| 583 | { |
| 584 | Json::Value ret; |
| 585 | |
| 586 | ret["object_path"] = GetPath(); |
| 587 | ret["owner"] = (uint32_t)object_acl_->GetOwner(); |
| 588 | ret["name"] = filter_ctrl_chars(prop_name_, true); |
| 589 | |
| 590 | if (prop_tags_.size() > 0) |
| 591 | { |
| 592 | for (const auto &tag : prop_tags_) |
| 593 | { |
| 594 | ret["tags"].append(filter_ctrl_chars(tag, true)); |
| 595 | } |
| 596 | } |
| 597 | |
| 598 | ret["import_timestamp"] = (Json::Value::UInt64)prop_import_timestamp_; |
| 599 | ret["last_used_timestamp"] = (Json::Value::UInt64)prop_last_used_timestamp_; |
| 600 | ret["locked_down"] = prop_locked_down_; |
| 601 | ret["transfer_owner_session"] = prop_transfer_owner_session_; |
| 602 | ret["readonly"] = prop_readonly_; |
| 603 | ret["single_use"] = prop_single_use_; |
| 604 | ret["used_count"] = prop_used_count_; |
| 605 | ret["valid"] = prop_valid_; |
| 606 | ret["profile"] = options_.json_export(); |
| 607 | ret["dco"] = prop_dco_; |
| 608 | |
| 609 | ret["public_access"] = object_acl_->GetPublicAccess(); |
| 610 | |
| 611 | for (const auto &e : object_acl_->GetAccessList()) |
| 612 | { |
| 613 | ret["acl"].append(e); |
| 614 | } |
| 615 | |
| 616 | for (const auto &ov : override_list_) |
| 617 | { |
| 618 | if (std::holds_alternative<bool>(ov.value)) |
| 619 | { |
| 620 | ret["overrides"][ov.key] = std::get<bool>(ov.value); |
| 621 | } |
| 622 | else |
| 623 | { |
| 624 | ret["overrides"][ov.key] = std::get<std::string>(ov.value); |
| 625 | } |
| 626 | } |
| 627 | |
| 628 | return ret; |
| 629 | } |
| 630 | |
| 631 | |
| 632 | void Configuration::TransferOwnership(uid_t new_owner_uid) |
nothing calls this directly
no test coverage detected