| # |
| # Licensed to the Apache Software Foundation (ASF) under one or more |
| # contributor license agreements. See the NOTICE file distributed with |
| # this work for additional information regarding copyright ownership. |
| # The ASF licenses this file to You 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. |
| # |
| CREATE DATABASE encrypt_db; |
| USE encrypt_db; |
| |
| REGISTER STORAGE UNIT ds_0 ( |
| URL='jdbc:mysql://127.0.0.1:3306/demo_encrypt_ds_0?useSSL=false', |
| USER='root', |
| PASSWORD='12345678', |
| PROPERTIES('minPoolSize'='1','connectionTimeoutMilliseconds'='30000','maxLifetimeMilliseconds'='1800000','idleTimeoutMilliseconds'='60000','maxPoolSize'='50') |
| ), ds_1 ( |
| URL='jdbc:mysql://127.0.0.1:3306/demo_encrypt_ds_1?useSSL=false', |
| USER='root', |
| PASSWORD='12345678', |
| PROPERTIES('minPoolSize'='1','connectionTimeoutMilliseconds'='30000','maxLifetimeMilliseconds'='1800000','idleTimeoutMilliseconds'='60000','maxPoolSize'='50') |
| ); |
| |
| CREATE ENCRYPT RULE t_encrypt ( |
| COLUMNS( |
| (NAME=user_id, CIPHER=user_cipher, ASSISTED_QUERY_COLUMN=user_assisted, LIKE_QUERY_COLUMN=user_like, ENCRYPT_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))), ASSISTED_QUERY_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))), LIKE_QUERY_ALGORITHM(TYPE(NAME='core.query_like.fixture'))), |
| (NAME=order_id, CIPHER=order_cipher, ENCRYPT_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1')))) |
| )); |