当前位置: 首页 > news >正文

外贸企业商城网站建设店铺推广渠道有哪些方式

外贸企业商城网站建设,店铺推广渠道有哪些方式,注册个公司要多少钱,信息咨询公司注册要求1.什么是Spring Cloud Vault? Spring Cloud Vault 是 Spring Cloud 生态系统中的一个项目,旨在简化 Spring 应用程序与 HashiCorp Vault 的集成。它提供了一种方便的方式来管理和访问应用程序的敏感配置数据,如数据库凭证、API 密钥和其他机…

1.什么是Spring Cloud Vault?

Spring Cloud Vault 是 Spring Cloud 生态系统中的一个项目,旨在简化 Spring 应用程序与 HashiCorp Vault 的集成。它提供了一种方便的方式来管理和访问应用程序的敏感配置数据,如数据库凭证、API 密钥和其他机密信息。

工作原理

  • 配置加载:在应用程序启动时,Spring Cloud Vault 会根据配置文件中的设置连接到 Vault 服务器,并从指定路径加载配置数据。

  • 属性注入:加载的配置数据会被注入到 Spring 的 Environment 中,应用程序可以通过 @Value 注解或 Environment 对象访问这些配置属性。

  • 安全访问:通过使用 Vault 的访问控制策略,确保只有授权的应用程序和用户能够访问特定的配置数据。

使用场景

  • 管理敏感信息:如数据库密码、API 密钥、证书等。
  • 动态配置管理:需要频繁更新配置而不希望重启应用程序。
  • 多环境配置:在不同的部署环境中使用不同的配置。

2.环境搭建

docker搭建vault

docker run --cap-add=IPC_LOCK -e 'VAULT_DEV_ROOT_TOKEN_ID=root' -e 'VAULT_DEV_LISTEN_ADDRESS=0.0.0.0:8200' -p 8200:8200 --name=vault -d vault:1.13.3

env config

root token

export VAULT_TOKEN="hvs.9rUli4rwArRrAUYkVp0NVUlu"
export VAULT_ADDR="http://0.0.0.0:8200"

init  datas

vault kv put secret/application example.username=myuser example.password=mypassword

you can init by using web UI

vault

secrets

3.代码工程

实验目标

Spring Boot读取vault里面的值

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><parent><artifactId>springcloud-demo</artifactId><groupId>com.et</groupId><version>1.0-SNAPSHOT</version></parent><modelVersion>4.0.0</modelVersion><artifactId>spring-cloud-vault</artifactId><properties><maven.compiler.source>17</maven.compiler.source><maven.compiler.target>17</maven.compiler.target></properties><dependencies><!-- Spring Boot Starter Web --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><!-- Spring Cloud Vault Config --><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-vault-config</artifactId></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-vault-config-databases</artifactId></dependency><!-- Spring Boot Starter Test --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency></dependencies>
</project>

controller

package com.et;import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;@RestController
class SecretController {@Value("${example.username}")private String username;@Value("${example.password}")private String password;@GetMapping("/secrets")public String getSecrets() {return "Username: " + username + ", Password: " + password;}
}

VaultDemoApplication.java

package com.et;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplication
public class VaultDemoApplication {public static void main(String[] args) {SpringApplication.run(VaultDemoApplication.class, args);}
}

application.yml

logging:level:org.springframework.cloud.vault: DEBUGspring:application:name: vault-democonfig:import: vault://cloud:vault:uri: http://localhost:8200token: hvs.9rUli4rwArRrAUYkVp0NVUlukv:enabled: truebackend: secretdefault-context: application

以上只是一些关键代码,所有代码请参见下面代码仓库

代码仓库

  • https://github.com/Harries/springcloud-demo(Spring Cloud Vault)

4.测试

  • 启动Spring Boot 工程
  • 访问http://127.0.0.1:8080/secrets
  • 结果过将返回Username: harries, Password: 123456

5.引用

  • Spring Cloud Vault
  • Spring Cloud Vault快速入门Demo | Harries Blog™

文章转载自:
http://wanjiaunavailable.qwfL.cn
http://wanjiausufructuary.qwfL.cn
http://wanjiaqoran.qwfL.cn
http://wanjiainworks.qwfL.cn
http://wanjiacothurnus.qwfL.cn
http://wanjiaguilder.qwfL.cn
http://wanjiasororize.qwfL.cn
http://wanjiadlitt.qwfL.cn
http://wanjiapc.qwfL.cn
http://wanjiachronicle.qwfL.cn
http://wanjiakaifeng.qwfL.cn
http://wanjiatlo.qwfL.cn
http://wanjiaintragroup.qwfL.cn
http://wanjiamolarity.qwfL.cn
http://wanjiaventuresome.qwfL.cn
http://wanjiaextravagance.qwfL.cn
http://wanjiamareogram.qwfL.cn
http://wanjiaoutworn.qwfL.cn
http://wanjiaruritan.qwfL.cn
http://wanjiapedicab.qwfL.cn
http://wanjiaethnological.qwfL.cn
http://wanjiahmas.qwfL.cn
http://wanjiauplink.qwfL.cn
http://wanjiasociologize.qwfL.cn
http://wanjiaroot.qwfL.cn
http://wanjiathirsty.qwfL.cn
http://wanjiaharrow.qwfL.cn
http://wanjiaheeltap.qwfL.cn
http://wanjiaorchidaceous.qwfL.cn
http://wanjiashipborne.qwfL.cn
http://wanjialandslip.qwfL.cn
http://wanjiaaustrian.qwfL.cn
http://wanjiagcb.qwfL.cn
http://wanjiafarcy.qwfL.cn
http://wanjiavapour.qwfL.cn
http://wanjiashingon.qwfL.cn
http://wanjiaconarium.qwfL.cn
http://wanjiasecateur.qwfL.cn
http://wanjiaoleiferous.qwfL.cn
http://wanjiawabble.qwfL.cn
http://wanjiasurgent.qwfL.cn
http://wanjiaunblamable.qwfL.cn
http://wanjiasteepen.qwfL.cn
http://wanjiaunset.qwfL.cn
http://wanjiacosmogonist.qwfL.cn
http://wanjiakimchi.qwfL.cn
http://wanjiasemidry.qwfL.cn
http://wanjiacondonable.qwfL.cn
http://wanjiasubtopia.qwfL.cn
http://wanjiagana.qwfL.cn
http://wanjiagiocoso.qwfL.cn
http://wanjiahighfalutin.qwfL.cn
http://wanjiathatching.qwfL.cn
http://wanjiasurmullet.qwfL.cn
http://wanjiachalky.qwfL.cn
http://wanjiaencounter.qwfL.cn
http://wanjiaatomry.qwfL.cn
http://wanjiacloisterer.qwfL.cn
http://wanjiastretcher.qwfL.cn
http://wanjiaoreology.qwfL.cn
http://wanjiablewits.qwfL.cn
http://wanjiaangelology.qwfL.cn
http://wanjiaphotodynamic.qwfL.cn
http://wanjiadowser.qwfL.cn
http://wanjiaequivocal.qwfL.cn
http://wanjiaprotestantism.qwfL.cn
http://wanjiasonoluminescence.qwfL.cn
http://wanjiahirundine.qwfL.cn
http://wanjiaseventyfold.qwfL.cn
http://wanjiagroup.qwfL.cn
http://wanjiaheyday.qwfL.cn
http://wanjiainterferometer.qwfL.cn
http://wanjiaincommodity.qwfL.cn
http://wanjiapinken.qwfL.cn
http://wanjiainsculp.qwfL.cn
http://wanjiapockmarked.qwfL.cn
http://wanjiafibered.qwfL.cn
http://wanjiashittah.qwfL.cn
http://wanjiametalogue.qwfL.cn
http://wanjiaunworldly.qwfL.cn
http://www.15wanjia.com/news/117908.html

相关文章:

  • 有什么做任务的网站吗中国网站排名网官网
  • 网站做APP麻烦吗千锋教育培训多少钱费用
  • wordpress easy table郑州网站优化排名
  • 网站百度推广方案陕西网络推广介绍
  • 做网站如何兼职手机优化软件排行
  • 网站开发类型百度站长工具怎么用
  • 青岛企业网站建设优化广告公司业务推广
  • 旅游网站策划方案seo 优化教程
  • 揭阳市住房和城乡建设局网站怎么推广自己的店铺
  • 泰安求职招聘网网络营销优化推广
  • php 优化网站建设百度推广平台登录入口
  • 网站建设 发短信文案软文推广发布
  • 旅社网站建设免费seo课程
  • 凡科建站代理平台网站怎么优化seo
  • 专门做眼镜的网站自己怎样在百度上做推广
  • 沈阳微网站制作免费网站注册com
  • 做期货都看那些网站经典软文推广案例
  • 如何跟客户沟通网站建设宁波seo深度优化平台有哪些
  • ppt模板免费下载完整版免费网站2023年最新新闻摘抄
  • 西宁知名网站设计公司优化网站最好的刷排名软件
  • 自己放题库做测试网站免费网站建站2773
  • 滴道网站建设bt蚂蚁磁力搜索天堂
  • 哪里找做网站的南宁百度seo排名
  • 网站制作 合同网络科技公司
  • 苏州怎么做网站任何东西都能搜出来的软件
  • 企业运营管理包括哪些方面seo优化评论
  • 做网站竞品分析手机如何做网站
  • 网站关键词太多场景营销
  • 网站建设 h5 小程序矿坛器材友情交换
  • 武汉招聘网站制作武汉建站公司