Skip to content

Commit 850a304

Browse files
merging fixes
1 parent e40aff6 commit 850a304

File tree

6 files changed

+43
-44
lines changed

6 files changed

+43
-44
lines changed

api/src/main/java/org/apache/cloudstack/api/command/admin/user/RegisterUserKeyCmd.java

Whitespace-only changes.

engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -757,45 +757,3 @@ SET `cs`.`domain_id` = (
757757

758758
-- Re-apply VPC: update default network offering for vpc tier to conserve_mode=1 (#8309)
759759
UPDATE `cloud`.`network_offerings` SET conserve_mode = 1 WHERE name = 'DefaultIsolatedNetworkOfferingForVpcNetworks';
760-
761-
-- Create "api_keypair" table for api and secret keys
762-
CREATE TABLE IF NOT EXISTS `cloud`.`api_keypair` (
763-
`id` bigint(20) unsigned NOT NULL auto_increment,
764-
`uuid` varchar(40) UNIQUE NOT NULL,
765-
`name` varchar(255) NOT NULL,
766-
`domain_id` bigint(20) unsigned NOT NULL,
767-
`account_id` bigint(20) unsigned NOT NULL,
768-
`user_id` bigint(20) unsigned NOT NULL,
769-
`start_date` datetime,
770-
`end_date` datetime,
771-
`description` varchar(100),
772-
`api_key` varchar(255) NOT NULL,
773-
`secret_key` varchar(255) NOT NULL,
774-
`created` datetime NOT NULL,
775-
`removed` datetime,
776-
PRIMARY KEY (`id`),
777-
CONSTRAINT `fk_api_keypair__user_id` FOREIGN KEY(`user_id`) REFERENCES `cloud`.`user`(`id`),
778-
CONSTRAINT `fk_api_keypair__account_id` FOREIGN KEY(`account_id`) REFERENCES `cloud`.`account`(`id`),
779-
CONSTRAINT `fk_api_keypair__domain_id` FOREIGN KEY(`domain_id`) REFERENCES `cloud`.`domain`(`id`)
780-
);
781-
782-
CREATE TABLE IF NOT EXISTS `cloud`.`api_keypair_permissions` (
783-
`id` bigint(20) unsigned NOT NULL auto_increment,
784-
`uuid` varchar(40) UNIQUE,
785-
`sort_order` bigint(20) unsigned NOT NULL DEFAULT 0,
786-
`rule` varchar(255) NOT NULL,
787-
`api_keypair_id` bigint(20) unsigned NOT NULL,
788-
`permission` varchar(255) NOT NULL,
789-
`description` varchar(255),
790-
PRIMARY KEY (`id`),
791-
CONSTRAINT `fk_keypair_permissions__api_keypair_id` FOREIGN KEY(`api_keypair_id`) REFERENCES `cloud`.`api_keypair`(`id`)
792-
);
793-
794-
INSERT INTO `cloud`.`api_keypair` (uuid, user_id, domain_id, account_id, api_key, secret_key, created, name)
795-
SELECT uuid(), user.id, account.domain_id, account.id, user.api_key, user.secret_key, now(), 'Active key pair'
796-
FROM `cloud`.`user` AS user
797-
JOIN `cloud`.`account` AS account ON user.account_id = account.id
798-
WHERE user.api_key IS NOT NULL
799-
AND user.secret_key IS NOT NULL;
800-
801-
ALTER TABLE `cloud`.`user` DROP COLUMN api_key, DROP COLUMN secret_key;

engine/schema/src/main/resources/META-INF/db/schema-42210to42300.sql

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,45 @@ CREATE TABLE IF NOT EXISTS `cloud`.`webhook_filter` (
3939
INDEX `i_webhook_filter__webhook_id`(`webhook_id`),
4040
CONSTRAINT `fk_webhook_filter__webhook_id` FOREIGN KEY(`webhook_id`) REFERENCES `webhook`(`id`) ON DELETE CASCADE
4141
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
42+
43+
-- Create "api_keypair" table for api and secret keys
44+
CREATE TABLE IF NOT EXISTS `cloud`.`api_keypair` (
45+
`id` bigint(20) unsigned NOT NULL auto_increment,
46+
`uuid` varchar(40) UNIQUE NOT NULL,
47+
`name` varchar(255) NOT NULL,
48+
`domain_id` bigint(20) unsigned NOT NULL,
49+
`account_id` bigint(20) unsigned NOT NULL,
50+
`user_id` bigint(20) unsigned NOT NULL,
51+
`start_date` datetime,
52+
`end_date` datetime,
53+
`description` varchar(100),
54+
`api_key` varchar(255) NOT NULL,
55+
`secret_key` varchar(255) NOT NULL,
56+
`created` datetime NOT NULL,
57+
`removed` datetime,
58+
PRIMARY KEY (`id`),
59+
CONSTRAINT `fk_api_keypair__user_id` FOREIGN KEY(`user_id`) REFERENCES `cloud`.`user`(`id`),
60+
CONSTRAINT `fk_api_keypair__account_id` FOREIGN KEY(`account_id`) REFERENCES `cloud`.`account`(`id`),
61+
CONSTRAINT `fk_api_keypair__domain_id` FOREIGN KEY(`domain_id`) REFERENCES `cloud`.`domain`(`id`)
62+
);
63+
64+
CREATE TABLE IF NOT EXISTS `cloud`.`api_keypair_permissions` (
65+
`id` bigint(20) unsigned NOT NULL auto_increment,
66+
`uuid` varchar(40) UNIQUE,
67+
`sort_order` bigint(20) unsigned NOT NULL DEFAULT 0,
68+
`rule` varchar(255) NOT NULL,
69+
`api_keypair_id` bigint(20) unsigned NOT NULL,
70+
`permission` varchar(255) NOT NULL,
71+
`description` varchar(255),
72+
PRIMARY KEY (`id`),
73+
CONSTRAINT `fk_keypair_permissions__api_keypair_id` FOREIGN KEY(`api_keypair_id`) REFERENCES `cloud`.`api_keypair`(`id`)
74+
);
75+
76+
INSERT INTO `cloud`.`api_keypair` (uuid, user_id, domain_id, account_id, api_key, secret_key, created, name)
77+
SELECT uuid(), user.id, account.domain_id, account.id, user.api_key, user.secret_key, now(), 'Active key pair'
78+
FROM `cloud`.`user` AS user
79+
JOIN `cloud`.`account` AS account ON user.account_id = account.id
80+
WHERE user.api_key IS NOT NULL
81+
AND user.secret_key IS NOT NULL;
82+
83+
ALTER TABLE `cloud`.`user` DROP COLUMN api_key, DROP COLUMN secret_key;

server/src/main/java/com/cloud/network/as/AutoScaleManagerImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@
114114
import com.cloud.network.Network;
115115
import com.cloud.network.Network.Capability;
116116
import com.cloud.network.Network.IpAddresses;
117-
import com.cloud.network.NetworkModel;
118117
import com.cloud.network.as.AutoScaleCounter.AutoScaleCounterParam;
119118
import com.cloud.network.as.dao.AutoScalePolicyConditionMapDao;
120119
import com.cloud.network.as.dao.AutoScalePolicyDao;

server/src/main/java/com/cloud/user/AccountManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
import org.apache.cloudstack.api.command.admin.user.ListUserKeyRulesCmd;
8282
import org.apache.cloudstack.api.command.admin.user.ListUserKeysCmd;
8383
import org.apache.cloudstack.api.command.admin.user.MoveUserCmd;
84-
import org.apache.cloudstack.api.command.admin.user.RegisterUserKeyCmd;
84+
import org.apache.cloudstack.api.command.admin.user.RegisterUserKeysCmd;
8585
import org.apache.cloudstack.api.command.admin.user.UpdateUserCmd;
8686
import org.apache.cloudstack.api.response.ApiKeyPairResponse;
8787
import org.apache.cloudstack.api.response.BaseRolePermissionResponse;

server/src/test/java/com/cloud/user/MockAccountManagerImpl.java

Whitespace-only changes.

0 commit comments

Comments
 (0)