alia(阿联酋)

牛奶煮萝莉 2023-08-10 06:00:12 网友整理

受鸟类启发打造 Alia绝非只是停留在概念阶段的eVTOL

据外媒报道,虽然大家已经听说了一些可以搭载乘客的eVTOL(电动垂直起降)飞机,但许多仍处于概念阶段。不过Alia却不是这样的,因为它每天都在进行试飞。由位于佛蒙特州的Beta技术公司开发的Alia结合了该航空航天公司从其之前较小的eVTOL原型Ava中学到的经验。

Alia流线型外形的灵感则来自鸟的空气动力学身体,特别是北极燕鸥。然而,跟这种动物完全不同的是,它像直升机一样使用四个水平方向的螺旋桨起飞和降落,在巡航过程中则会切换到一个后方垂直推进支柱以更快、更高效的固定翼飞行。

公司对最终商业产品的计划要求是完全电池驱动、续航里程250英里(402公里)、一个50英尺(15.2米)的翼展、最大起飞重量6000磅(2722公斤)、可载客6名乘客以及200立方英尺(5.7立方米)的载货能力。

这家公司目前在测试的原型机是在2019年建造,今年获得了适航证书。团队成员Kyle C告诉lark媒体,他们每天都有在飞行。

事实上,Alia的研发最初则是由生物技术公司United Therapeutics委托进行的,以此来作为一种零排放的运送方式。美国空军则已经为其Agility Prime项目委托打造原型机,该项目旨在促进空中机动车辆的商业发展。

拟建的充电站之一

此外,Beta还计划为飞机建立一个快速充电站网络。这些设施将由集装箱建造而成,其包括太阳能电池板阵列、并网逆变器、储能模块和发电机,在高峰时间或停电时能够实现离网充电,另还包括休息室和飞行员的睡眠区。

MybatisPlus数据安全,你掌握了吗

MybatisPlus数据安全概述

存在数据库中的数据对于普通用户而言是不可见的,好像是藏起来了一样,但对于开发者,只要知道数据库的连接地址、用户名、密码,则数据不再安全;这也意味着,一旦连接数据库的配置文件暴露出去,则数据不再安全。

应用场景

开发中的数据库配置文件或配置中心中的配置信息

API介绍

MybatisPlus中有个针对配置项加密处理的

代码实现1 创建mp工程

创建maven工程,结构如下:

2 代码编写pom.xml

<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.4.1</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <dependency> <groupId>orgjectlombok</groupId> <artifactId>lombok</artifactId> <scope>provided</scope> </dependency> </dependencies>application.yml

spring: datasource: url: jdbc:mysql://localhost:3306/springboot?useSSL=false&characterEncoding=utf8&serverTimezone=Asia/Shanghai driver-class-name: com.mysql.cj.jdbc.Driver username: root password: rootmybatis-plus: type-aliases-package: com.itheima.pojo启动类

package com.itheima;import org.mybatis.spring.annotation.MapperScan;import org.springframework.boot.SpringApplication;import org.springframework.bootconfigure.SpringBootApplication;/** * @version 1.0 * @description 说明 * @package com.itheima */@SpringBootApplication@MapperScan(basePackages = "com.itheima.mapper")public class App { public static void main(String[] args) { SpringApplication(App.class,args); }}pojo

package com.itheima.pojo;import com.baomidou.mybatisplus.annotation.TableField;import lombok.Data;/** * @version 1.0 * @description 说明 * @package com.itheima.pojo */@Datapublic class User { private Integer id; private String username; @TableField(select = false) private String password; private String salt;}mapper

package com.itheima.mapper;import com.baomidou.mybatisplusre.mapper.BaseMapper;import com.itheima.pojo.User;import org.springframework.stereotype.Repository;/** * @version 1.0 * @description 说明 * @package com.itheima.mapper */@Repositorypublic interface UserMapper extends BaseMapper<User> {}service接口与实现类

package com.itheima.service;import com.baomidou.mybatisplus.extension.service.IService;import com.itheima.pojo.User;/** * @version 1.0 * @description 说明 * @package com.itheima.service */public interface UserService extends IService<User> {}

package com.itheima.service.impl;import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;import com.itheima.mapper.UserMapper;import com.itheima.pojo.User;import com.itheima.service.UserService;import org.springframework.stereotype.Service;/** * @version 1.0 * @description 说明 * @package com.itheima.service.impl */@Servicepublic class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {}controller

package com.itheimantroller;import com.itheima.pojo.User;import com.itheima.service.UserService;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;import java.util.List;/** * @version 1.0 * @description 说明 * @package com.itheimantroller */@RestController@RequestMapping("user")public class UserController { @Autowired private UserService userService; @GetMapping public List<User> listAll(){ return userService.list(); }}启动测试生成加密后的内容

package com.itheima;import com.baomidou.mybatisplusre.toolkit.AES;import org.mybatis.spring.annotation.MapperScan;import org.springframework.boot.SpringApplication;import org.springframework.bootconfigure.SpringBootApplication;/** * @version 1.0 * @description 说明 * @package com.itheima */@SpringBootApplication@MapperScan(basePackages = "com.itheima.mapper")public class App { public static void main(String[] args) { String secretKey = AES.generateRandomKey(); System.out.println("secretKey:" + secretKey); String url = AES.encrypt("jdbc:mysql://localhost:3306/springboot?useSSL=false&characterEncoding=utf8&serverTimezone=Asia/Shanghai", secretKey); String username = AES.encrypt("username", secretKey); String password = AES.encrypt("password", secretKey); System.out.println("url=" +url ); System.out.println("username=" +username ); System.out.println("password=" +password ); SpringApplication(App.class,args); }}

替换配置文件

spring: datasource: url: mpw:wT9PqZ9Hf4VWgXDuZ/Z1JKfdDyS0sSu3+O2qDkJ/Ulnabpq3z1lZbiThWseQ4DQSx3+SWpufsTysjdYhn6Scsa77AzIIaUgv8DZ17gPxAq88AISmxd9OjxidmY50uBVMkGhP9qAted45zuHBzVrw6Q== driver-class-name: com.mysql.cj.jdbc.Driver username: mpw:Pnh++mI45YrC4s6JveJYaA== password: mpw:Pnh++mI45YrC4s6JveJYaA==mybatis-plus: type-aliases-package: com.itheima.pojo添加启动参数

运行效果

3 优化目的

启动时,需要指定密钥 才能使用,如果我们把它封装到一个jar里,让它启动时自动去加载密钥,且密钥可配置,那这样就更灵活了。

分析

通过查看MybatisPlus加载的源码,其做解密处理的类如下:

/* * Copyright (c) 2011-2020, baomidou (jobob@qq). * <p> * 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 * <p> * /d/file/gt/2023-05/i1ac50hh4l5.0 * <p> * 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. */package com.baomidou.mybatisplusconfigure;import com.baomidou.mybatisplusre.toolkit.AES;import com.baomidou.mybatisplusre.toolkit.CollectionUtils;import com.baomidou.mybatisplusre.toolkit.StringUtils;import org.springframework.boot.SpringApplication;import org.springframework.boot.env.EnvironmentPostProcessor;import org.springframework.boot.env.OriginTrackedMapPropertySource;import org.springframeworkre.env.ConfigurableEnvironment;import org.springframeworkre.env.MapPropertySource;import org.springframeworkre.env.PropertySource;import org.springframeworkre.env.SimpleCommandLinePropertySource;import java.util.HashMap;/** * 安全加密处理器 * * @author hubin * @since 2020-05-23 */public class SafetyEncryptProcessor implements EnvironmentPostProcessor { @Override public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { /** * 命令行中获取密钥 */ String mpwKey = null; for (PropertySource<?> ps : environment.getPropertySources()) { if (ps instanceof SimpleCommandLinePropertySource) { SimpleCommandLinePropertySource source = (SimpleCommandLinePropertySource) ps; mpwKey = source.getProperty("mpw.key"); break; } } /** * 处理加密内容 */ if (StringUtils.isNotBlank(mpwKey)) { HashMap<String, Object> map = new HashMap<>(); for (PropertySource<?> ps : environment.getPropertySources()) { if (ps instanceof OriginTrackedMapPropertySource) { OriginTrackedMapPropertySource source = (OriginTrackedMapPropertySource) ps; for (String name : source.getPropertyNames()) { Object value = source.getProperty(name); if (value instanceof String) { String str = (String) value; if (str.startsWith("mpw:")) { map.put(name, AES.decrypt(str.substring(4), mpwKey)); } } } } } // 将解密的数据放入环境变量,并处于第一优先级上 if (CollectionUtils.isNotEmpty(map)) { environment.getPropertySources().addFirst(new MapPropertySource("custom-encrypt", map)); } } }}

其使用了SPI原理,在类所在的jar下的META-INF/spring.factories中配置了这个SafetyEncryptProcessor。那我们能否也来定义一个这样的配置处理器,判断环境配置中是否配置了--mpw.key,如果没有配置,则给它配置上,这样就不用在启动时添加参数来运行了。

实现创建配置工程mysafe

代码清单

pom.xml

<parent> <artifactId>spring-boot-starter-parent</artifactId> <groupId>org.springframework.boot</groupId> <version>2.3.8.RELEASE</version></parent><dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency></dependencies>

SafetyEncryptProcessor

package com.itheima;import org.springframework.boot.SpringApplication;import org.springframework.boot.env.EnvironmentPostProcessor;import org.springframeworkre.Ordered;import org.springframeworkre.env.ConfigurableEnvironment;import org.springframeworkre.env.PropertySource;import org.springframeworkre.env.SimpleCommandLinePropertySource;import org.springframeworkre.io.ClassPathResource;import org.springframework.util.StringUtils;import java.io.IOException;import java.util.Properties;/** * @version 1.0 * @description 说明 * @package com.itheima */public class SafetyEncryptProcessor implements EnvironmentPostProcessor, Ordered { @Override public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { Properties pro = new Properties(); try { pro.load(new ClassPathResource("ertperties").getInputStream()); } catch (IOException e) { e.printStackTrace(); } /** * 命令行中获取密钥 */ String mpwKey = null; for (PropertySource<?> ps : environment.getPropertySources()) { if (ps instanceof SimpleCommandLinePropertySource) { SimpleCommandLinePropertySource source = (SimpleCommandLinePropertySource) ps; mpwKey = source.getProperty("mpw.key"); break; } } if(StringUtils.isEmpty(mpwKey)){ environment.getPropertySources().addFirst(new SimpleCommandLinePropertySource("mySpringApplicationCommandLineArgs", "--mpw.key=" + pro.getProperty("ert.version"))); } } @Override public int getOrder() { return 0; }}

spring.factories

ert.version=b440fe7fd55dbe26org.springframework.boot.env.EnvironmentPostProcessor=\com.itheima.SafetyEncryptProcessor

ertperties

ert.version=2ac6625cb3188f52安装到本地仓库

修改mp工程添加依赖

修改pom.xml,添加mysafe的依赖

<dependency> <groupId>com.itheima</groupId> <artifactId>mysafe</artifactId> <version>1.0-SNAPSHOT</version></dependency>4 测试结果

去除启动时的参数设置。再启动后访问页面、效果如下:

总结MybatisPlus利用了springboot的配置信息增强器与SPI机制来实现对配置文件中敏感数据的解密处理。mysafe工程打成的jar包,将来就上传到企业的内部服务器上,当密钥变更时,重新打包即可。而我们将来布署项目到服务器上时,也肯定存在配置文件,一旦配置信息暴露,则数据库就危险了。通过加密手段能够让破解者增加破解阻碍。此次练习仅做抛砖引玉作用,关于加密与解密是没有做到那么严谨的,需要结合自己公司实际情况去调整。

65000吨液化气人民币结算,阿联酋对华送大礼,美国的威胁马上到

文/君剑

17日据央视报道,满载65000吨阿联酋液化天然气的“马尔文”轮,在经过将近一个月的航行之后,已经抵达中国港口,并完成了卸货工作。而这笔订单的重要看点,在于交易模式首次以人民币结算,这也是人民币结算国际LNG采购项目的里程碑式项目。

(央视报道)

阿联酋最近接连对华送大礼,除了能源领域合作、人民币结算之外,还有军工项目的合作,在不久前的阿布扎比防展期间,阿方决定签下12架L-15“猎鹰”飞机,未来可能会将数量追加到48架。显然在军事领域,中阿合作也正在不断深化。

(中国装备在阿联酋防展大放异彩)

然而阿联酋显然是戳到美国的肺管子了,据俄媒报道,白宫高官已经代表拜登政府向阿联酋发出威胁,阿总统穆罕穆德受到了来自美国的“警告”。美国高官声称,如果阿方继续与中国和俄罗斯展开军事情报合作,那么阿美关系将受到“波及”。

(穆罕穆德)

美国已经不止一次指责阿联酋与中俄的往来了,之前美国就曾怀疑“中国在阿联酋建军事基地”,最终强行迫使阿方停止港口工程,而阿方邀请中企华为参与5G工程,也令美国“十分不爽”。同样地,阿联酋与俄罗斯的合作,也遭受美国妒忌。尤其阿方对俄方的投资,以及其拒绝在乌克兰问题上响应美国的立场,更是被美国视为“不听话”。正是在这一大背景下,美国公开威胁阿联酋,要阿联酋“做出选择”。

(拜登在沙特和穆罕穆德见面)

不过,美国的这种威胁,似乎没有吓到阿联酋。虽然阿方也就与中俄的关系,和美国保持沟通。但阿方拒绝被美国支配,穆罕穆德的顾问加尔加什就明确表示,不会被“大国竞争”定义。阿方强调,该国会重视和美国的关系,但肯定也要和中俄来往。

其实不仅是阿联酋,沙特也在明显地“向东看”,沙特对人民币结算能源持开放支持态度,而且在中国的帮助下,沙特还结束了和伊朗的“恩怨史”,这对中东局势的稳定有至关重要的意义。

美国总是觉得别人“不听话”,但美国却没有考虑自己的嘴脸。沙特和阿联酋为什么会转向,第一是他们确实有更好的选择,没必要被美国支配;第二是美国的承诺就跟废纸一样,所谓的安全保证更是说了等于没说;第三就是美国自己的吃相确实难看,美国到处算计别人,现在整个国际社会,基本上都在防着美国。

(沙特石油设施经常遇袭,美国提供的“爱国者”也不起作用)

所以这也就解释了,为什么现在就算美国再怎么发出威胁,其他国家也不会惯着美国了。美国天天想着“孤立”中俄,结果却是美国被孤立。个中原因,美国自己得好好反省一下。

免责声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,请发送邮件举报,一经查实,本站将立刻删除。

扫一扫在手机阅读、分享本文