repo_name
stringclasses
5 values
pr_number
int64
1.52k
15.5k
pr_title
stringlengths
8
143
pr_description
stringlengths
0
10.2k
author
stringlengths
3
18
date_created
unknown
date_merged
unknown
previous_commit
stringlengths
40
40
pr_commit
stringlengths
40
40
query
stringlengths
11
10.2k
filepath
stringlengths
6
220
before_content
stringlengths
0
597M
after_content
stringlengths
0
597M
label
int64
-1
1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/component/txtresolver/FileTextResolverTest.java
package com.ctrip.framework.apollo.portal.component.txtresolver; import com.ctrip.framework.apollo.common.dto.ItemChangeSets; import com.ctrip.framework.apollo.common.dto.ItemDTO; import com.ctrip.framework.apollo.core.ConfigConsts; import com.ctrip.framework.apollo.portal.AbstractUnitTest; import org.junit.Assert; import org.junit.Test; import org.mockito.InjectMocks; import java.util.Arrays; import java.util.Collections; public class FileTextResolverTest extends AbstractUnitTest { @InjectMocks private FileTextResolver resolver; private final String CONFIG_TEXT = "config_text"; private final long NAMESPACE = 1000; @Test public void testCreateItem(){ ItemChangeSets changeSets = resolver.resolve(NAMESPACE, CONFIG_TEXT, Collections.emptyList()); Assert.assertEquals(1, changeSets.getCreateItems().size()); Assert.assertEquals(0, changeSets.getUpdateItems().size()); Assert.assertEquals(0, changeSets.getDeleteItems().size()); ItemDTO createdItem = changeSets.getCreateItems().get(0); Assert.assertEquals(CONFIG_TEXT, createdItem.getValue()); } @Test public void testUpdateItem(){ ItemDTO existedItem = new ItemDTO(); existedItem.setId(1000); existedItem.setKey(ConfigConsts.CONFIG_FILE_CONTENT_KEY); existedItem.setValue("before"); ItemChangeSets changeSets = resolver.resolve(NAMESPACE, CONFIG_TEXT, Collections.singletonList(existedItem)); Assert.assertEquals(0, changeSets.getCreateItems().size()); Assert.assertEquals(1, changeSets.getUpdateItems().size()); Assert.assertEquals(0, changeSets.getDeleteItems().size()); ItemDTO updatedItem = changeSets.getUpdateItems().get(0); Assert.assertEquals(CONFIG_TEXT, updatedItem.getValue()); } }
package com.ctrip.framework.apollo.portal.component.txtresolver; import com.ctrip.framework.apollo.common.dto.ItemChangeSets; import com.ctrip.framework.apollo.common.dto.ItemDTO; import com.ctrip.framework.apollo.core.ConfigConsts; import com.ctrip.framework.apollo.portal.AbstractUnitTest; import org.junit.Assert; import org.junit.Test; import org.mockito.InjectMocks; import java.util.Arrays; import java.util.Collections; public class FileTextResolverTest extends AbstractUnitTest { @InjectMocks private FileTextResolver resolver; private final String CONFIG_TEXT = "config_text"; private final long NAMESPACE = 1000; @Test public void testCreateItem(){ ItemChangeSets changeSets = resolver.resolve(NAMESPACE, CONFIG_TEXT, Collections.emptyList()); Assert.assertEquals(1, changeSets.getCreateItems().size()); Assert.assertEquals(0, changeSets.getUpdateItems().size()); Assert.assertEquals(0, changeSets.getDeleteItems().size()); ItemDTO createdItem = changeSets.getCreateItems().get(0); Assert.assertEquals(CONFIG_TEXT, createdItem.getValue()); } @Test public void testUpdateItem(){ ItemDTO existedItem = new ItemDTO(); existedItem.setId(1000); existedItem.setKey(ConfigConsts.CONFIG_FILE_CONTENT_KEY); existedItem.setValue("before"); ItemChangeSets changeSets = resolver.resolve(NAMESPACE, CONFIG_TEXT, Collections.singletonList(existedItem)); Assert.assertEquals(0, changeSets.getCreateItems().size()); Assert.assertEquals(1, changeSets.getUpdateItems().size()); Assert.assertEquals(0, changeSets.getDeleteItems().size()); ItemDTO updatedItem = changeSets.getUpdateItems().get(0); Assert.assertEquals(CONFIG_TEXT, updatedItem.getValue()); } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-biz/src/test/java/com/ctrip/framework/apollo/biz/service/AdminServiceTransactionTest.java
package com.ctrip.framework.apollo.biz.service; import com.ctrip.framework.apollo.biz.AbstractIntegrationTest; import com.ctrip.framework.apollo.biz.repository.AppNamespaceRepository; import com.ctrip.framework.apollo.biz.repository.AppRepository; import com.ctrip.framework.apollo.biz.repository.ClusterRepository; import com.ctrip.framework.apollo.biz.repository.NamespaceRepository; import com.ctrip.framework.apollo.common.entity.App; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.transaction.AfterTransaction; import org.springframework.test.context.transaction.BeforeTransaction; import java.util.Date; public class AdminServiceTransactionTest extends AbstractIntegrationTest { @Autowired AdminService adminService; @Autowired private AppRepository appRepository; @Autowired private AppNamespaceRepository appNamespaceRepository; @Autowired private NamespaceRepository namespaceRepository; @Autowired private ClusterRepository clusterRepository; @BeforeTransaction public void verifyInitialDatabaseState() { for (App app : appRepository.findAll()) { System.out.println(app.getAppId()); } Assert.assertEquals(0, appRepository.count()); Assert.assertEquals(7, appNamespaceRepository.count()); Assert.assertEquals(0, namespaceRepository.count()); Assert.assertEquals(0, clusterRepository.count()); } @Before public void setUpTestDataWithinTransaction() { Assert.assertEquals(0, appRepository.count()); Assert.assertEquals(7, appNamespaceRepository.count()); Assert.assertEquals(0, namespaceRepository.count()); Assert.assertEquals(0, clusterRepository.count()); } @Test @Rollback public void modifyDatabaseWithinTransaction() { String appId = "someAppId"; App app = new App(); app.setAppId(appId); app.setName("someAppName"); String owner = "someOwnerName"; app.setOwnerName(owner); app.setOwnerEmail("[email protected]"); app.setDataChangeCreatedBy(owner); app.setDataChangeLastModifiedBy(owner); app.setDataChangeCreatedTime(new Date()); adminService.createNewApp(app); } @After public void tearDownWithinTransaction() { Assert.assertEquals(1, appRepository.count()); Assert.assertEquals(8, appNamespaceRepository.count()); Assert.assertEquals(1, namespaceRepository.count()); Assert.assertEquals(1, clusterRepository.count()); } @AfterTransaction public void verifyFinalDatabaseState() { Assert.assertEquals(0, appRepository.count()); Assert.assertEquals(7, appNamespaceRepository.count()); Assert.assertEquals(0, namespaceRepository.count()); Assert.assertEquals(0, clusterRepository.count()); } }
package com.ctrip.framework.apollo.biz.service; import com.ctrip.framework.apollo.biz.AbstractIntegrationTest; import com.ctrip.framework.apollo.biz.repository.AppNamespaceRepository; import com.ctrip.framework.apollo.biz.repository.AppRepository; import com.ctrip.framework.apollo.biz.repository.ClusterRepository; import com.ctrip.framework.apollo.biz.repository.NamespaceRepository; import com.ctrip.framework.apollo.common.entity.App; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.transaction.AfterTransaction; import org.springframework.test.context.transaction.BeforeTransaction; import java.util.Date; public class AdminServiceTransactionTest extends AbstractIntegrationTest { @Autowired AdminService adminService; @Autowired private AppRepository appRepository; @Autowired private AppNamespaceRepository appNamespaceRepository; @Autowired private NamespaceRepository namespaceRepository; @Autowired private ClusterRepository clusterRepository; @BeforeTransaction public void verifyInitialDatabaseState() { for (App app : appRepository.findAll()) { System.out.println(app.getAppId()); } Assert.assertEquals(0, appRepository.count()); Assert.assertEquals(7, appNamespaceRepository.count()); Assert.assertEquals(0, namespaceRepository.count()); Assert.assertEquals(0, clusterRepository.count()); } @Before public void setUpTestDataWithinTransaction() { Assert.assertEquals(0, appRepository.count()); Assert.assertEquals(7, appNamespaceRepository.count()); Assert.assertEquals(0, namespaceRepository.count()); Assert.assertEquals(0, clusterRepository.count()); } @Test @Rollback public void modifyDatabaseWithinTransaction() { String appId = "someAppId"; App app = new App(); app.setAppId(appId); app.setName("someAppName"); String owner = "someOwnerName"; app.setOwnerName(owner); app.setOwnerEmail("[email protected]"); app.setDataChangeCreatedBy(owner); app.setDataChangeLastModifiedBy(owner); app.setDataChangeCreatedTime(new Date()); adminService.createNewApp(app); } @After public void tearDownWithinTransaction() { Assert.assertEquals(1, appRepository.count()); Assert.assertEquals(8, appNamespaceRepository.count()); Assert.assertEquals(1, namespaceRepository.count()); Assert.assertEquals(1, clusterRepository.count()); } @AfterTransaction public void verifyFinalDatabaseState() { Assert.assertEquals(0, appRepository.count()); Assert.assertEquals(7, appNamespaceRepository.count()); Assert.assertEquals(0, namespaceRepository.count()); Assert.assertEquals(0, clusterRepository.count()); } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/ctrip/CtripSsoHeartbeatHandler.java
package com.ctrip.framework.apollo.portal.spi.ctrip; import com.ctrip.framework.apollo.portal.spi.SsoHeartbeatHandler; import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * @author Jason Song([email protected]) */ public class CtripSsoHeartbeatHandler implements SsoHeartbeatHandler { @Override public void doHeartbeat(HttpServletRequest request, HttpServletResponse response) { try { response.sendRedirect("ctrip_sso_heartbeat.html"); } catch (IOException e) { } } }
package com.ctrip.framework.apollo.portal.spi.ctrip; import com.ctrip.framework.apollo.portal.spi.SsoHeartbeatHandler; import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * @author Jason Song([email protected]) */ public class CtripSsoHeartbeatHandler implements SsoHeartbeatHandler { @Override public void doHeartbeat(HttpServletRequest request, HttpServletResponse response) { try { response.sendRedirect("ctrip_sso_heartbeat.html"); } catch (IOException e) { } } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-client/src/main/java/com/ctrip/framework/apollo/spring/spi/DefaultConfigPropertySourcesProcessorHelper.java
package com.ctrip.framework.apollo.spring.spi; import com.ctrip.framework.apollo.core.spi.Ordered; import com.ctrip.framework.apollo.spring.annotation.ApolloAnnotationProcessor; import com.ctrip.framework.apollo.spring.annotation.SpringValueProcessor; import com.ctrip.framework.apollo.spring.property.SpringValueDefinitionProcessor; import com.ctrip.framework.apollo.spring.util.BeanRegistrationUtil; import java.util.HashMap; import java.util.Map; import org.springframework.beans.BeansException; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; public class DefaultConfigPropertySourcesProcessorHelper implements ConfigPropertySourcesProcessorHelper { @Override public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException { Map<String, Object> propertySourcesPlaceholderPropertyValues = new HashMap<>(); // to make sure the default PropertySourcesPlaceholderConfigurer's priority is higher than PropertyPlaceholderConfigurer propertySourcesPlaceholderPropertyValues.put("order", 0); BeanRegistrationUtil.registerBeanDefinitionIfNotExists(registry, PropertySourcesPlaceholderConfigurer.class.getName(), PropertySourcesPlaceholderConfigurer.class, propertySourcesPlaceholderPropertyValues); BeanRegistrationUtil.registerBeanDefinitionIfNotExists(registry, ApolloAnnotationProcessor.class.getName(), ApolloAnnotationProcessor.class); BeanRegistrationUtil.registerBeanDefinitionIfNotExists(registry, SpringValueProcessor.class.getName(), SpringValueProcessor.class); processSpringValueDefinition(registry); } /** * For Spring 3.x versions, the BeanDefinitionRegistryPostProcessor would not be instantiated if * it is added in postProcessBeanDefinitionRegistry phase, so we have to manually call the * postProcessBeanDefinitionRegistry method of SpringValueDefinitionProcessor here... */ private void processSpringValueDefinition(BeanDefinitionRegistry registry) { SpringValueDefinitionProcessor springValueDefinitionProcessor = new SpringValueDefinitionProcessor(); springValueDefinitionProcessor.postProcessBeanDefinitionRegistry(registry); } @Override public int getOrder() { return Ordered.LOWEST_PRECEDENCE; } }
package com.ctrip.framework.apollo.spring.spi; import com.ctrip.framework.apollo.core.spi.Ordered; import com.ctrip.framework.apollo.spring.annotation.ApolloAnnotationProcessor; import com.ctrip.framework.apollo.spring.annotation.SpringValueProcessor; import com.ctrip.framework.apollo.spring.property.SpringValueDefinitionProcessor; import com.ctrip.framework.apollo.spring.util.BeanRegistrationUtil; import java.util.HashMap; import java.util.Map; import org.springframework.beans.BeansException; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; public class DefaultConfigPropertySourcesProcessorHelper implements ConfigPropertySourcesProcessorHelper { @Override public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException { Map<String, Object> propertySourcesPlaceholderPropertyValues = new HashMap<>(); // to make sure the default PropertySourcesPlaceholderConfigurer's priority is higher than PropertyPlaceholderConfigurer propertySourcesPlaceholderPropertyValues.put("order", 0); BeanRegistrationUtil.registerBeanDefinitionIfNotExists(registry, PropertySourcesPlaceholderConfigurer.class.getName(), PropertySourcesPlaceholderConfigurer.class, propertySourcesPlaceholderPropertyValues); BeanRegistrationUtil.registerBeanDefinitionIfNotExists(registry, ApolloAnnotationProcessor.class.getName(), ApolloAnnotationProcessor.class); BeanRegistrationUtil.registerBeanDefinitionIfNotExists(registry, SpringValueProcessor.class.getName(), SpringValueProcessor.class); processSpringValueDefinition(registry); } /** * For Spring 3.x versions, the BeanDefinitionRegistryPostProcessor would not be instantiated if * it is added in postProcessBeanDefinitionRegistry phase, so we have to manually call the * postProcessBeanDefinitionRegistry method of SpringValueDefinitionProcessor here... */ private void processSpringValueDefinition(BeanDefinitionRegistry registry) { SpringValueDefinitionProcessor springValueDefinitionProcessor = new SpringValueDefinitionProcessor(); springValueDefinitionProcessor.postProcessBeanDefinitionRegistry(registry); } @Override public int getOrder() { return Ordered.LOWEST_PRECEDENCE; } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/PortalDBPropertySource.java
package com.ctrip.framework.apollo.portal.service; import com.google.common.collect.Maps; import com.ctrip.framework.apollo.common.config.RefreshablePropertySource; import com.ctrip.framework.apollo.portal.entity.po.ServerConfig; import com.ctrip.framework.apollo.portal.repository.ServerConfigRepository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.Map; import java.util.Objects; /** * @author Jason Song([email protected]) */ @Component public class PortalDBPropertySource extends RefreshablePropertySource { private static final Logger logger = LoggerFactory.getLogger(PortalDBPropertySource.class); @Autowired private ServerConfigRepository serverConfigRepository; public PortalDBPropertySource(String name, Map<String, Object> source) { super(name, source); } public PortalDBPropertySource() { super("DBConfig", Maps.newConcurrentMap()); } @Override protected void refresh() { Iterable<ServerConfig> dbConfigs = serverConfigRepository.findAll(); for (ServerConfig config: dbConfigs) { String key = config.getKey(); Object value = config.getValue(); if (this.source.isEmpty()) { logger.info("Load config from DB : {} = {}", key, value); } else if (!Objects.equals(this.source.get(key), value)) { logger.info("Load config from DB : {} = {}. Old value = {}", key, value, this.source.get(key)); } this.source.put(key, value); } } }
package com.ctrip.framework.apollo.portal.service; import com.google.common.collect.Maps; import com.ctrip.framework.apollo.common.config.RefreshablePropertySource; import com.ctrip.framework.apollo.portal.entity.po.ServerConfig; import com.ctrip.framework.apollo.portal.repository.ServerConfigRepository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.Map; import java.util.Objects; /** * @author Jason Song([email protected]) */ @Component public class PortalDBPropertySource extends RefreshablePropertySource { private static final Logger logger = LoggerFactory.getLogger(PortalDBPropertySource.class); @Autowired private ServerConfigRepository serverConfigRepository; public PortalDBPropertySource(String name, Map<String, Object> source) { super(name, source); } public PortalDBPropertySource() { super("DBConfig", Maps.newConcurrentMap()); } @Override protected void refresh() { Iterable<ServerConfig> dbConfigs = serverConfigRepository.findAll(); for (ServerConfig config: dbConfigs) { String key = config.getKey(); Object value = config.getValue(); if (this.source.isEmpty()) { logger.info("Load config from DB : {} = {}", key, value); } else if (!Objects.equals(this.source.get(key), value)) { logger.info("Load config from DB : {} = {}. Old value = {}", key, value, this.source.get(key)); } this.source.put(key, value); } } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/entity/Consumer.java
package com.ctrip.framework.apollo.openapi.entity; import com.ctrip.framework.apollo.common.entity.BaseEntity; import org.hibernate.annotations.SQLDelete; import org.hibernate.annotations.Where; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; @Entity @Table(name = "Consumer") @SQLDelete(sql = "Update Consumer set isDeleted = 1 where id = ?") @Where(clause = "isDeleted = 0") public class Consumer extends BaseEntity { @Column(name = "Name", nullable = false) private String name; @Column(name = "AppId", nullable = false) private String appId; @Column(name = "OrgId", nullable = false) private String orgId; @Column(name = "OrgName", nullable = false) private String orgName; @Column(name = "OwnerName", nullable = false) private String ownerName; @Column(name = "OwnerEmail", nullable = false) private String ownerEmail; public String getAppId() { return appId; } public String getName() { return name; } public String getOrgId() { return orgId; } public String getOrgName() { return orgName; } public String getOwnerEmail() { return ownerEmail; } public String getOwnerName() { return ownerName; } public void setAppId(String appId) { this.appId = appId; } public void setName(String name) { this.name = name; } public void setOrgId(String orgId) { this.orgId = orgId; } public void setOrgName(String orgName) { this.orgName = orgName; } public void setOwnerEmail(String ownerEmail) { this.ownerEmail = ownerEmail; } public void setOwnerName(String ownerName) { this.ownerName = ownerName; } @Override public String toString() { return toStringHelper().add("name", name).add("appId", appId) .add("orgId", orgId) .add("orgName", orgName) .add("ownerName", ownerName) .add("ownerEmail", ownerEmail).toString(); } }
package com.ctrip.framework.apollo.openapi.entity; import com.ctrip.framework.apollo.common.entity.BaseEntity; import org.hibernate.annotations.SQLDelete; import org.hibernate.annotations.Where; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; @Entity @Table(name = "Consumer") @SQLDelete(sql = "Update Consumer set isDeleted = 1 where id = ?") @Where(clause = "isDeleted = 0") public class Consumer extends BaseEntity { @Column(name = "Name", nullable = false) private String name; @Column(name = "AppId", nullable = false) private String appId; @Column(name = "OrgId", nullable = false) private String orgId; @Column(name = "OrgName", nullable = false) private String orgName; @Column(name = "OwnerName", nullable = false) private String ownerName; @Column(name = "OwnerEmail", nullable = false) private String ownerEmail; public String getAppId() { return appId; } public String getName() { return name; } public String getOrgId() { return orgId; } public String getOrgName() { return orgName; } public String getOwnerEmail() { return ownerEmail; } public String getOwnerName() { return ownerName; } public void setAppId(String appId) { this.appId = appId; } public void setName(String name) { this.name = name; } public void setOrgId(String orgId) { this.orgId = orgId; } public void setOrgName(String orgName) { this.orgName = orgName; } public void setOwnerEmail(String ownerEmail) { this.ownerEmail = ownerEmail; } public void setOwnerName(String ownerName) { this.ownerName = ownerName; } @Override public String toString() { return toStringHelper().add("name", name).add("appId", appId) .add("orgId", orgId) .add("orgName", orgName) .add("ownerName", ownerName) .add("ownerEmail", ownerEmail).toString(); } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ReleaseController.java
package com.ctrip.framework.apollo.portal.controller; import com.ctrip.framework.apollo.common.dto.ReleaseDTO; import com.ctrip.framework.apollo.common.exception.BadRequestException; import com.ctrip.framework.apollo.common.exception.NotFoundException; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.component.PermissionValidator; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import com.ctrip.framework.apollo.portal.entity.bo.ReleaseBO; import com.ctrip.framework.apollo.portal.entity.model.NamespaceReleaseModel; import com.ctrip.framework.apollo.portal.entity.vo.ReleaseCompareResult; import com.ctrip.framework.apollo.portal.listener.ConfigPublishEvent; import com.ctrip.framework.apollo.portal.service.ReleaseService; import com.ctrip.framework.apollo.portal.spi.UserInfoHolder; import javax.validation.Valid; import javax.validation.constraints.Positive; import javax.validation.constraints.PositiveOrZero; import org.springframework.context.ApplicationEventPublisher; import org.springframework.security.access.AccessDeniedException; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.Collections; import java.util.List; @Validated @RestController public class ReleaseController { private final ReleaseService releaseService; private final ApplicationEventPublisher publisher; private final PortalConfig portalConfig; private final PermissionValidator permissionValidator; private final UserInfoHolder userInfoHolder; public ReleaseController( final ReleaseService releaseService, final ApplicationEventPublisher publisher, final PortalConfig portalConfig, final PermissionValidator permissionValidator, final UserInfoHolder userInfoHolder) { this.releaseService = releaseService; this.publisher = publisher; this.portalConfig = portalConfig; this.permissionValidator = permissionValidator; this.userInfoHolder = userInfoHolder; } @PreAuthorize(value = "@permissionValidator.hasReleaseNamespacePermission(#appId, #namespaceName, #env)") @PostMapping(value = "/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/releases") public ReleaseDTO createRelease(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName, @RequestBody NamespaceReleaseModel model) { model.setAppId(appId); model.setEnv(env); model.setClusterName(clusterName); model.setNamespaceName(namespaceName); if (model.isEmergencyPublish() && !portalConfig.isEmergencyPublishAllowed(Env.valueOf(env))) { throw new BadRequestException(String.format("Env: %s is not supported emergency publish now", env)); } ReleaseDTO createdRelease = releaseService.publish(model); ConfigPublishEvent event = ConfigPublishEvent.instance(); event.withAppId(appId) .withCluster(clusterName) .withNamespace(namespaceName) .withReleaseId(createdRelease.getId()) .setNormalPublishEvent(true) .setEnv(Env.valueOf(env)); publisher.publishEvent(event); return createdRelease; } @PreAuthorize(value = "@permissionValidator.hasReleaseNamespacePermission(#appId, #namespaceName, #env)") @PostMapping(value = "/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/releases") public ReleaseDTO createGrayRelease(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName, @PathVariable String branchName, @RequestBody NamespaceReleaseModel model) { model.setAppId(appId); model.setEnv(env); model.setClusterName(branchName); model.setNamespaceName(namespaceName); if (model.isEmergencyPublish() && !portalConfig.isEmergencyPublishAllowed(Env.valueOf(env))) { throw new BadRequestException(String.format("Env: %s is not supported emergency publish now", env)); } ReleaseDTO createdRelease = releaseService.publish(model); ConfigPublishEvent event = ConfigPublishEvent.instance(); event.withAppId(appId) .withCluster(clusterName) .withNamespace(namespaceName) .withReleaseId(createdRelease.getId()) .setGrayPublishEvent(true) .setEnv(Env.valueOf(env)); publisher.publishEvent(event); return createdRelease; } @GetMapping("/envs/{env}/releases/{releaseId}") public ReleaseDTO get(@PathVariable String env, @PathVariable long releaseId) { ReleaseDTO release = releaseService.findReleaseById(Env.valueOf(env), releaseId); if (release == null) { throw new NotFoundException("release not found"); } return release; } @GetMapping(value = "/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all") public List<ReleaseBO> findAllReleases(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName, @Valid @PositiveOrZero(message = "page should be positive or 0") @RequestParam(defaultValue = "0") int page, @Valid @Positive(message = "size should be positive number") @RequestParam(defaultValue = "5") int size) { if (permissionValidator.shouldHideConfigToCurrentUser(appId, env, namespaceName)) { return Collections.emptyList(); } return releaseService.findAllReleases(appId, Env.valueOf(env), clusterName, namespaceName, page, size); } @GetMapping(value = "/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active") public List<ReleaseDTO> findActiveReleases(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName, @Valid @PositiveOrZero(message = "page should be positive or 0") @RequestParam(defaultValue = "0") int page, @Valid @Positive(message = "size should be positive number") @RequestParam(defaultValue = "5") int size) { if (permissionValidator.shouldHideConfigToCurrentUser(appId, env, namespaceName)) { return Collections.emptyList(); } return releaseService.findActiveReleases(appId, Env.valueOf(env), clusterName, namespaceName, page, size); } @GetMapping(value = "/envs/{env}/releases/compare") public ReleaseCompareResult compareRelease(@PathVariable String env, @RequestParam long baseReleaseId, @RequestParam long toCompareReleaseId) { return releaseService.compare(Env.valueOf(env), baseReleaseId, toCompareReleaseId); } @PutMapping(path = "/envs/{env}/releases/{releaseId}/rollback") public void rollback(@PathVariable String env, @PathVariable long releaseId, @RequestParam(defaultValue = "-1") long toReleaseId) { ReleaseDTO release = releaseService.findReleaseById(Env.valueOf(env), releaseId); if (release == null) { throw new NotFoundException("release not found"); } if (!permissionValidator.hasReleaseNamespacePermission(release.getAppId(), release.getNamespaceName(), env)) { throw new AccessDeniedException("Access is denied"); } if (toReleaseId > -1) { releaseService.rollbackTo(Env.valueOf(env), releaseId, toReleaseId, userInfoHolder.getUser().getUserId()); } else { releaseService.rollback(Env.valueOf(env), releaseId, userInfoHolder.getUser().getUserId()); } ConfigPublishEvent event = ConfigPublishEvent.instance(); event.withAppId(release.getAppId()) .withCluster(release.getClusterName()) .withNamespace(release.getNamespaceName()) .withPreviousReleaseId(releaseId) .setRollbackEvent(true) .setEnv(Env.valueOf(env)); publisher.publishEvent(event); } }
package com.ctrip.framework.apollo.portal.controller; import com.ctrip.framework.apollo.common.dto.ReleaseDTO; import com.ctrip.framework.apollo.common.exception.BadRequestException; import com.ctrip.framework.apollo.common.exception.NotFoundException; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.component.PermissionValidator; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import com.ctrip.framework.apollo.portal.entity.bo.ReleaseBO; import com.ctrip.framework.apollo.portal.entity.model.NamespaceReleaseModel; import com.ctrip.framework.apollo.portal.entity.vo.ReleaseCompareResult; import com.ctrip.framework.apollo.portal.listener.ConfigPublishEvent; import com.ctrip.framework.apollo.portal.service.ReleaseService; import com.ctrip.framework.apollo.portal.spi.UserInfoHolder; import javax.validation.Valid; import javax.validation.constraints.Positive; import javax.validation.constraints.PositiveOrZero; import org.springframework.context.ApplicationEventPublisher; import org.springframework.security.access.AccessDeniedException; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.Collections; import java.util.List; @Validated @RestController public class ReleaseController { private final ReleaseService releaseService; private final ApplicationEventPublisher publisher; private final PortalConfig portalConfig; private final PermissionValidator permissionValidator; private final UserInfoHolder userInfoHolder; public ReleaseController( final ReleaseService releaseService, final ApplicationEventPublisher publisher, final PortalConfig portalConfig, final PermissionValidator permissionValidator, final UserInfoHolder userInfoHolder) { this.releaseService = releaseService; this.publisher = publisher; this.portalConfig = portalConfig; this.permissionValidator = permissionValidator; this.userInfoHolder = userInfoHolder; } @PreAuthorize(value = "@permissionValidator.hasReleaseNamespacePermission(#appId, #namespaceName, #env)") @PostMapping(value = "/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/releases") public ReleaseDTO createRelease(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName, @RequestBody NamespaceReleaseModel model) { model.setAppId(appId); model.setEnv(env); model.setClusterName(clusterName); model.setNamespaceName(namespaceName); if (model.isEmergencyPublish() && !portalConfig.isEmergencyPublishAllowed(Env.valueOf(env))) { throw new BadRequestException(String.format("Env: %s is not supported emergency publish now", env)); } ReleaseDTO createdRelease = releaseService.publish(model); ConfigPublishEvent event = ConfigPublishEvent.instance(); event.withAppId(appId) .withCluster(clusterName) .withNamespace(namespaceName) .withReleaseId(createdRelease.getId()) .setNormalPublishEvent(true) .setEnv(Env.valueOf(env)); publisher.publishEvent(event); return createdRelease; } @PreAuthorize(value = "@permissionValidator.hasReleaseNamespacePermission(#appId, #namespaceName, #env)") @PostMapping(value = "/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/releases") public ReleaseDTO createGrayRelease(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName, @PathVariable String branchName, @RequestBody NamespaceReleaseModel model) { model.setAppId(appId); model.setEnv(env); model.setClusterName(branchName); model.setNamespaceName(namespaceName); if (model.isEmergencyPublish() && !portalConfig.isEmergencyPublishAllowed(Env.valueOf(env))) { throw new BadRequestException(String.format("Env: %s is not supported emergency publish now", env)); } ReleaseDTO createdRelease = releaseService.publish(model); ConfigPublishEvent event = ConfigPublishEvent.instance(); event.withAppId(appId) .withCluster(clusterName) .withNamespace(namespaceName) .withReleaseId(createdRelease.getId()) .setGrayPublishEvent(true) .setEnv(Env.valueOf(env)); publisher.publishEvent(event); return createdRelease; } @GetMapping("/envs/{env}/releases/{releaseId}") public ReleaseDTO get(@PathVariable String env, @PathVariable long releaseId) { ReleaseDTO release = releaseService.findReleaseById(Env.valueOf(env), releaseId); if (release == null) { throw new NotFoundException("release not found"); } return release; } @GetMapping(value = "/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all") public List<ReleaseBO> findAllReleases(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName, @Valid @PositiveOrZero(message = "page should be positive or 0") @RequestParam(defaultValue = "0") int page, @Valid @Positive(message = "size should be positive number") @RequestParam(defaultValue = "5") int size) { if (permissionValidator.shouldHideConfigToCurrentUser(appId, env, namespaceName)) { return Collections.emptyList(); } return releaseService.findAllReleases(appId, Env.valueOf(env), clusterName, namespaceName, page, size); } @GetMapping(value = "/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active") public List<ReleaseDTO> findActiveReleases(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName, @Valid @PositiveOrZero(message = "page should be positive or 0") @RequestParam(defaultValue = "0") int page, @Valid @Positive(message = "size should be positive number") @RequestParam(defaultValue = "5") int size) { if (permissionValidator.shouldHideConfigToCurrentUser(appId, env, namespaceName)) { return Collections.emptyList(); } return releaseService.findActiveReleases(appId, Env.valueOf(env), clusterName, namespaceName, page, size); } @GetMapping(value = "/envs/{env}/releases/compare") public ReleaseCompareResult compareRelease(@PathVariable String env, @RequestParam long baseReleaseId, @RequestParam long toCompareReleaseId) { return releaseService.compare(Env.valueOf(env), baseReleaseId, toCompareReleaseId); } @PutMapping(path = "/envs/{env}/releases/{releaseId}/rollback") public void rollback(@PathVariable String env, @PathVariable long releaseId, @RequestParam(defaultValue = "-1") long toReleaseId) { ReleaseDTO release = releaseService.findReleaseById(Env.valueOf(env), releaseId); if (release == null) { throw new NotFoundException("release not found"); } if (!permissionValidator.hasReleaseNamespacePermission(release.getAppId(), release.getNamespaceName(), env)) { throw new AccessDeniedException("Access is denied"); } if (toReleaseId > -1) { releaseService.rollbackTo(Env.valueOf(env), releaseId, toReleaseId, userInfoHolder.getUser().getUserId()); } else { releaseService.rollback(Env.valueOf(env), releaseId, userInfoHolder.getUser().getUserId()); } ConfigPublishEvent event = ConfigPublishEvent.instance(); event.withAppId(release.getAppId()) .withCluster(release.getClusterName()) .withNamespace(release.getNamespaceName()) .withPreviousReleaseId(releaseId) .setRollbackEvent(true) .setEnv(Env.valueOf(env)); publisher.publishEvent(event); } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/repository/ConsumerAuditRepository.java
package com.ctrip.framework.apollo.openapi.repository; import com.ctrip.framework.apollo.openapi.entity.ConsumerAudit; import org.springframework.data.repository.PagingAndSortingRepository; /** * @author Jason Song([email protected]) */ public interface ConsumerAuditRepository extends PagingAndSortingRepository<ConsumerAudit, Long> { }
package com.ctrip.framework.apollo.openapi.repository; import com.ctrip.framework.apollo.openapi.entity.ConsumerAudit; import org.springframework.data.repository.PagingAndSortingRepository; /** * @author Jason Song([email protected]) */ public interface ConsumerAuditRepository extends PagingAndSortingRepository<ConsumerAudit, Long> { }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/common/bean/AnnotatedBean.java
package com.ctrip.framework.apollo.demo.spring.common.bean; import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; /** * @author Jason Song([email protected]) */ @Component("annotatedBean") public class AnnotatedBean { private static final Logger logger = LoggerFactory.getLogger(AnnotatedBean.class); private int timeout; private int batch; private List<JsonBean> jsonBeans; /** * ApolloJsonValue annotated on fields example, the default value is specified as empty list - [] * <br /> * jsonBeanProperty=[{"someString":"hello","someInt":100},{"someString":"world!","someInt":200}] */ @ApolloJsonValue("${jsonBeanProperty:[]}") private List<JsonBean> anotherJsonBeans; @Value("${batch:100}") public void setBatch(int batch) { logger.info("updating batch, old value: {}, new value: {}", this.batch, batch); this.batch = batch; } @Value("${timeout:200}") public void setTimeout(int timeout) { logger.info("updating timeout, old value: {}, new value: {}", this.timeout, timeout); this.timeout = timeout; } /** * ApolloJsonValue annotated on methods example, the default value is specified as empty list - [] * <br /> * jsonBeanProperty=[{"someString":"hello","someInt":100},{"someString":"world!","someInt":200}] */ @ApolloJsonValue("${jsonBeanProperty:[]}") public void setJsonBeans(List<JsonBean> jsonBeans) { logger.info("updating json beans, old value: {}, new value: {}", this.jsonBeans, jsonBeans); this.jsonBeans = jsonBeans; } @Override public String toString() { return String.format("[AnnotatedBean] timeout: %d, batch: %d, jsonBeans: %s", timeout, batch, jsonBeans); } private static class JsonBean{ private String someString; private int someInt; @Override public String toString() { return "JsonBean{" + "someString='" + someString + '\'' + ", someInt=" + someInt + '}'; } } }
package com.ctrip.framework.apollo.demo.spring.common.bean; import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; /** * @author Jason Song([email protected]) */ @Component("annotatedBean") public class AnnotatedBean { private static final Logger logger = LoggerFactory.getLogger(AnnotatedBean.class); private int timeout; private int batch; private List<JsonBean> jsonBeans; /** * ApolloJsonValue annotated on fields example, the default value is specified as empty list - [] * <br /> * jsonBeanProperty=[{"someString":"hello","someInt":100},{"someString":"world!","someInt":200}] */ @ApolloJsonValue("${jsonBeanProperty:[]}") private List<JsonBean> anotherJsonBeans; @Value("${batch:100}") public void setBatch(int batch) { logger.info("updating batch, old value: {}, new value: {}", this.batch, batch); this.batch = batch; } @Value("${timeout:200}") public void setTimeout(int timeout) { logger.info("updating timeout, old value: {}, new value: {}", this.timeout, timeout); this.timeout = timeout; } /** * ApolloJsonValue annotated on methods example, the default value is specified as empty list - [] * <br /> * jsonBeanProperty=[{"someString":"hello","someInt":100},{"someString":"world!","someInt":200}] */ @ApolloJsonValue("${jsonBeanProperty:[]}") public void setJsonBeans(List<JsonBean> jsonBeans) { logger.info("updating json beans, old value: {}, new value: {}", this.jsonBeans, jsonBeans); this.jsonBeans = jsonBeans; } @Override public String toString() { return String.format("[AnnotatedBean] timeout: %d, batch: %d, jsonBeans: %s", timeout, batch, jsonBeans); } private static class JsonBean{ private String someString; private int someInt; @Override public String toString() { return "JsonBean{" + "someString='" + someString + '\'' + ", someInt=" + someInt + '}'; } } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-client/src/main/java/com/ctrip/framework/apollo/spi/DefaultConfigFactoryManager.java
package com.ctrip.framework.apollo.spi; import java.util.Map; import com.ctrip.framework.apollo.build.ApolloInjector; import com.google.common.collect.Maps; /** * @author Jason Song([email protected]) */ public class DefaultConfigFactoryManager implements ConfigFactoryManager { private ConfigRegistry m_registry; private Map<String, ConfigFactory> m_factories = Maps.newConcurrentMap(); public DefaultConfigFactoryManager() { m_registry = ApolloInjector.getInstance(ConfigRegistry.class); } @Override public ConfigFactory getFactory(String namespace) { // step 1: check hacked factory ConfigFactory factory = m_registry.getFactory(namespace); if (factory != null) { return factory; } // step 2: check cache factory = m_factories.get(namespace); if (factory != null) { return factory; } // step 3: check declared config factory factory = ApolloInjector.getInstance(ConfigFactory.class, namespace); if (factory != null) { return factory; } // step 4: check default config factory factory = ApolloInjector.getInstance(ConfigFactory.class); m_factories.put(namespace, factory); // factory should not be null return factory; } }
package com.ctrip.framework.apollo.spi; import java.util.Map; import com.ctrip.framework.apollo.build.ApolloInjector; import com.google.common.collect.Maps; /** * @author Jason Song([email protected]) */ public class DefaultConfigFactoryManager implements ConfigFactoryManager { private ConfigRegistry m_registry; private Map<String, ConfigFactory> m_factories = Maps.newConcurrentMap(); public DefaultConfigFactoryManager() { m_registry = ApolloInjector.getInstance(ConfigRegistry.class); } @Override public ConfigFactory getFactory(String namespace) { // step 1: check hacked factory ConfigFactory factory = m_registry.getFactory(namespace); if (factory != null) { return factory; } // step 2: check cache factory = m_factories.get(namespace); if (factory != null) { return factory; } // step 3: check declared config factory factory = ApolloInjector.getInstance(ConfigFactory.class, namespace); if (factory != null) { return factory; } // step 4: check default config factory factory = ApolloInjector.getInstance(ConfigFactory.class); m_factories.put(namespace, factory); // factory should not be null return factory; } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/vo/LockInfo.java
package com.ctrip.framework.apollo.portal.entity.vo; public class LockInfo { private String lockOwner; private boolean isEmergencyPublishAllowed; public String getLockOwner() { return lockOwner; } public void setLockOwner(String lockOwner) { this.lockOwner = lockOwner; } public boolean isEmergencyPublishAllowed() { return isEmergencyPublishAllowed; } public void setEmergencyPublishAllowed(boolean emergencyPublishAllowed) { isEmergencyPublishAllowed = emergencyPublishAllowed; } }
package com.ctrip.framework.apollo.portal.entity.vo; public class LockInfo { private String lockOwner; private boolean isEmergencyPublishAllowed; public String getLockOwner() { return lockOwner; } public void setLockOwner(String lockOwner) { this.lockOwner = lockOwner; } public boolean isEmergencyPublishAllowed() { return isEmergencyPublishAllowed; } public void setEmergencyPublishAllowed(boolean emergencyPublishAllowed) { isEmergencyPublishAllowed = emergencyPublishAllowed; } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/environment/PortalMetaDomainServiceTest.java
package com.ctrip.framework.apollo.portal.environment; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletResponse; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class PortalMetaDomainServiceTest extends BaseIntegrationTest { private PortalMetaDomainService portalMetaDomainService; @Mock private PortalConfig portalConfig; @Before public void init() { final Map<String, String> map = new HashMap<>(); map.put("nothing", "http://unknown.com"); Mockito.when(portalConfig.getMetaServers()).thenReturn(map); portalMetaDomainService = new PortalMetaDomainService(portalConfig); } @Test public void testGetMetaDomain() { // local String localMetaServerAddress = "http://localhost:8080"; mockMetaServerAddress(Env.LOCAL, localMetaServerAddress); assertEquals(localMetaServerAddress, portalMetaDomainService.getDomain(Env.LOCAL)); // add this environment without meta server address String randomEnvironment = "randomEnvironment"; Env.addEnvironment(randomEnvironment); assertEquals(PortalMetaDomainService.DEFAULT_META_URL, portalMetaDomainService.getDomain(Env.valueOf(randomEnvironment))); } @Test public void testGetValidAddress() throws Exception { String someResponse = "some response"; startServerWithHandlers(mockServerHandler(HttpServletResponse.SC_OK, someResponse)); String validServer = " http://localhost:" + PORT + " "; String invalidServer = "http://localhost:" + findFreePort(); mockMetaServerAddress(Env.FAT, validServer + "," + invalidServer); mockMetaServerAddress(Env.UAT, invalidServer + "," + validServer); portalMetaDomainService.reload(); assertEquals(validServer.trim(), portalMetaDomainService.getDomain(Env.FAT)); assertEquals(validServer.trim(), portalMetaDomainService.getDomain(Env.UAT)); } @Test public void testInvalidAddress() { String invalidServer = "http://localhost:" + findFreePort() + " "; String anotherInvalidServer = "http://localhost:" + findFreePort() + " "; mockMetaServerAddress(Env.LPT, invalidServer + "," + anotherInvalidServer); portalMetaDomainService.reload(); String metaServer = portalMetaDomainService.getDomain(Env.LPT); assertTrue(metaServer.equals(invalidServer.trim()) || metaServer.equals(anotherInvalidServer.trim())); } private void mockMetaServerAddress(Env env, String metaServerAddress) { // add it to system's property System.setProperty(env.getName() + "_meta", metaServerAddress); } }
package com.ctrip.framework.apollo.portal.environment; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletResponse; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class PortalMetaDomainServiceTest extends BaseIntegrationTest { private PortalMetaDomainService portalMetaDomainService; @Mock private PortalConfig portalConfig; @Before public void init() { final Map<String, String> map = new HashMap<>(); map.put("nothing", "http://unknown.com"); Mockito.when(portalConfig.getMetaServers()).thenReturn(map); portalMetaDomainService = new PortalMetaDomainService(portalConfig); } @Test public void testGetMetaDomain() { // local String localMetaServerAddress = "http://localhost:8080"; mockMetaServerAddress(Env.LOCAL, localMetaServerAddress); assertEquals(localMetaServerAddress, portalMetaDomainService.getDomain(Env.LOCAL)); // add this environment without meta server address String randomEnvironment = "randomEnvironment"; Env.addEnvironment(randomEnvironment); assertEquals(PortalMetaDomainService.DEFAULT_META_URL, portalMetaDomainService.getDomain(Env.valueOf(randomEnvironment))); } @Test public void testGetValidAddress() throws Exception { String someResponse = "some response"; startServerWithHandlers(mockServerHandler(HttpServletResponse.SC_OK, someResponse)); String validServer = " http://localhost:" + PORT + " "; String invalidServer = "http://localhost:" + findFreePort(); mockMetaServerAddress(Env.FAT, validServer + "," + invalidServer); mockMetaServerAddress(Env.UAT, invalidServer + "," + validServer); portalMetaDomainService.reload(); assertEquals(validServer.trim(), portalMetaDomainService.getDomain(Env.FAT)); assertEquals(validServer.trim(), portalMetaDomainService.getDomain(Env.UAT)); } @Test public void testInvalidAddress() { String invalidServer = "http://localhost:" + findFreePort() + " "; String anotherInvalidServer = "http://localhost:" + findFreePort() + " "; mockMetaServerAddress(Env.LPT, invalidServer + "," + anotherInvalidServer); portalMetaDomainService.reload(); String metaServer = portalMetaDomainService.getDomain(Env.LPT); assertTrue(metaServer.equals(invalidServer.trim()) || metaServer.equals(anotherInvalidServer.trim())); } private void mockMetaServerAddress(Env env, String metaServerAddress) { // add it to system's property System.setProperty(env.getName() + "_meta", metaServerAddress); } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/service/AppNamespaceServiceTest.java
package com.ctrip.framework.apollo.portal.service; import com.ctrip.framework.apollo.common.entity.AppNamespace; import com.ctrip.framework.apollo.common.exception.BadRequestException; import com.ctrip.framework.apollo.core.ConfigConsts; import com.ctrip.framework.apollo.core.enums.ConfigFileFormat; import com.ctrip.framework.apollo.portal.AbstractIntegrationTest; import org.junit.Assert; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.jdbc.Sql; import java.util.List; public class AppNamespaceServiceTest extends AbstractIntegrationTest { @Autowired private AppNamespaceService appNamespaceService; private final String APP = "app-test"; @Test @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testFindPublicAppNamespace() { List<AppNamespace> appNamespaceList = appNamespaceService.findPublicAppNamespaces(); Assert.assertNotNull(appNamespaceList); Assert.assertEquals(5, appNamespaceList.size()); } @Test @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testFindPublicAppNamespaceByName() { Assert.assertNotNull(appNamespaceService.findPublicAppNamespace("datasourcexml")); Assert.assertNull(appNamespaceService.findPublicAppNamespace("TFF.song0711-02")); } @Test @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testFindPublicAppNamespaceByAppAndName() { Assert.assertNotNull(appNamespaceService.findByAppIdAndName("100003173", "datasourcexml")); Assert.assertNull(appNamespaceService.findByAppIdAndName("100003173", "TFF.song0711-02")); } @Test @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreateDefaultAppNamespace() { appNamespaceService.createDefaultAppNamespace(APP); AppNamespace appNamespace = appNamespaceService.findByAppIdAndName(APP, ConfigConsts.NAMESPACE_APPLICATION); Assert.assertNotNull(appNamespace); Assert.assertEquals(ConfigFileFormat.Properties.getValue(), appNamespace.getFormat()); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePublicAppNamespaceExisted() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(true); appNamespace.setName("old"); appNamespace.setFormat(ConfigFileFormat.Properties.getValue()); appNamespaceService.createAppNamespaceInLocal(appNamespace); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePublicAppNamespaceExistedAsPrivateAppNamespace() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(true); appNamespace.setName("private-01"); appNamespace.setFormat(ConfigFileFormat.Properties.getValue()); appNamespaceService.createAppNamespaceInLocal(appNamespace); } @Test @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePublicAppNamespaceNotExistedWithNoAppendnamespacePrefix() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(true); appNamespace.setName("old"); appNamespace.setFormat(ConfigFileFormat.Properties.getValue()); AppNamespace createdAppNamespace = appNamespaceService.createAppNamespaceInLocal(appNamespace, false); Assert.assertNotNull(createdAppNamespace); Assert.assertEquals(appNamespace.getName(), createdAppNamespace.getName()); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePublicAppNamespaceExistedWithNoAppendnamespacePrefix() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(true); appNamespace.setName("datasource"); appNamespace.setFormat(ConfigFileFormat.Properties.getValue()); appNamespaceService.createAppNamespaceInLocal(appNamespace, false); } @Test @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePublicAppNamespaceNotExisted() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(true); appNamespaceService.createAppNamespaceInLocal(appNamespace); AppNamespace createdAppNamespace = appNamespaceService.findPublicAppNamespace(appNamespace.getName()); Assert.assertNotNull(createdAppNamespace); Assert.assertEquals(appNamespace.getName(), createdAppNamespace.getName()); } @Test @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePublicAppNamespaceWithWrongFormatNotExisted() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(true); appNamespace.setFormat(ConfigFileFormat.YAML.getValue()); appNamespaceService.createAppNamespaceInLocal(appNamespace); AppNamespace createdAppNamespace = appNamespaceService.findPublicAppNamespace(appNamespace.getName()); Assert.assertNotNull(createdAppNamespace); Assert.assertEquals(appNamespace.getName(), createdAppNamespace.getName()); Assert.assertEquals(ConfigFileFormat.Properties.getValue(), createdAppNamespace.getFormat()); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePrivateAppNamespaceExisted() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(false); appNamespace.setName("datasource"); appNamespace.setAppId("100003173"); appNamespaceService.createAppNamespaceInLocal(appNamespace); } @Test @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePrivateAppNamespaceExistedInAnotherAppId() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(false); appNamespace.setName("datasource"); appNamespace.setAppId("song0711-01"); appNamespaceService.createAppNamespaceInLocal(appNamespace); AppNamespace createdAppNamespace = appNamespaceService.findByAppIdAndName(appNamespace.getAppId(), appNamespace.getName()); Assert.assertNotNull(createdAppNamespace); Assert.assertEquals(appNamespace.getName(), createdAppNamespace.getName()); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePrivateAppNamespaceExistedInAnotherAppIdAsPublic() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(false); appNamespace.setName("SCC.song0711-03"); appNamespace.setAppId("100003173"); appNamespace.setFormat(ConfigFileFormat.Properties.getValue()); appNamespaceService.createAppNamespaceInLocal(appNamespace); } @Test @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePrivateAppNamespaceNotExisted() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(false); appNamespaceService.createAppNamespaceInLocal(appNamespace); AppNamespace createdAppNamespace = appNamespaceService.findByAppIdAndName(appNamespace.getAppId(), appNamespace.getName()); Assert.assertNotNull(createdAppNamespace); Assert.assertEquals(appNamespace.getName(), createdAppNamespace.getName()); } private AppNamespace assembleBaseAppNamespace() { AppNamespace appNamespace = new AppNamespace(); appNamespace.setName("appNamespace"); appNamespace.setAppId("1000"); appNamespace.setFormat(ConfigFileFormat.XML.getValue()); return appNamespace; } }
package com.ctrip.framework.apollo.portal.service; import com.ctrip.framework.apollo.common.entity.AppNamespace; import com.ctrip.framework.apollo.common.exception.BadRequestException; import com.ctrip.framework.apollo.core.ConfigConsts; import com.ctrip.framework.apollo.core.enums.ConfigFileFormat; import com.ctrip.framework.apollo.portal.AbstractIntegrationTest; import org.junit.Assert; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.jdbc.Sql; import java.util.List; public class AppNamespaceServiceTest extends AbstractIntegrationTest { @Autowired private AppNamespaceService appNamespaceService; private final String APP = "app-test"; @Test @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testFindPublicAppNamespace() { List<AppNamespace> appNamespaceList = appNamespaceService.findPublicAppNamespaces(); Assert.assertNotNull(appNamespaceList); Assert.assertEquals(5, appNamespaceList.size()); } @Test @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testFindPublicAppNamespaceByName() { Assert.assertNotNull(appNamespaceService.findPublicAppNamespace("datasourcexml")); Assert.assertNull(appNamespaceService.findPublicAppNamespace("TFF.song0711-02")); } @Test @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testFindPublicAppNamespaceByAppAndName() { Assert.assertNotNull(appNamespaceService.findByAppIdAndName("100003173", "datasourcexml")); Assert.assertNull(appNamespaceService.findByAppIdAndName("100003173", "TFF.song0711-02")); } @Test @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreateDefaultAppNamespace() { appNamespaceService.createDefaultAppNamespace(APP); AppNamespace appNamespace = appNamespaceService.findByAppIdAndName(APP, ConfigConsts.NAMESPACE_APPLICATION); Assert.assertNotNull(appNamespace); Assert.assertEquals(ConfigFileFormat.Properties.getValue(), appNamespace.getFormat()); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePublicAppNamespaceExisted() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(true); appNamespace.setName("old"); appNamespace.setFormat(ConfigFileFormat.Properties.getValue()); appNamespaceService.createAppNamespaceInLocal(appNamespace); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePublicAppNamespaceExistedAsPrivateAppNamespace() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(true); appNamespace.setName("private-01"); appNamespace.setFormat(ConfigFileFormat.Properties.getValue()); appNamespaceService.createAppNamespaceInLocal(appNamespace); } @Test @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePublicAppNamespaceNotExistedWithNoAppendnamespacePrefix() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(true); appNamespace.setName("old"); appNamespace.setFormat(ConfigFileFormat.Properties.getValue()); AppNamespace createdAppNamespace = appNamespaceService.createAppNamespaceInLocal(appNamespace, false); Assert.assertNotNull(createdAppNamespace); Assert.assertEquals(appNamespace.getName(), createdAppNamespace.getName()); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePublicAppNamespaceExistedWithNoAppendnamespacePrefix() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(true); appNamespace.setName("datasource"); appNamespace.setFormat(ConfigFileFormat.Properties.getValue()); appNamespaceService.createAppNamespaceInLocal(appNamespace, false); } @Test @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePublicAppNamespaceNotExisted() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(true); appNamespaceService.createAppNamespaceInLocal(appNamespace); AppNamespace createdAppNamespace = appNamespaceService.findPublicAppNamespace(appNamespace.getName()); Assert.assertNotNull(createdAppNamespace); Assert.assertEquals(appNamespace.getName(), createdAppNamespace.getName()); } @Test @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePublicAppNamespaceWithWrongFormatNotExisted() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(true); appNamespace.setFormat(ConfigFileFormat.YAML.getValue()); appNamespaceService.createAppNamespaceInLocal(appNamespace); AppNamespace createdAppNamespace = appNamespaceService.findPublicAppNamespace(appNamespace.getName()); Assert.assertNotNull(createdAppNamespace); Assert.assertEquals(appNamespace.getName(), createdAppNamespace.getName()); Assert.assertEquals(ConfigFileFormat.Properties.getValue(), createdAppNamespace.getFormat()); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePrivateAppNamespaceExisted() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(false); appNamespace.setName("datasource"); appNamespace.setAppId("100003173"); appNamespaceService.createAppNamespaceInLocal(appNamespace); } @Test @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePrivateAppNamespaceExistedInAnotherAppId() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(false); appNamespace.setName("datasource"); appNamespace.setAppId("song0711-01"); appNamespaceService.createAppNamespaceInLocal(appNamespace); AppNamespace createdAppNamespace = appNamespaceService.findByAppIdAndName(appNamespace.getAppId(), appNamespace.getName()); Assert.assertNotNull(createdAppNamespace); Assert.assertEquals(appNamespace.getName(), createdAppNamespace.getName()); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePrivateAppNamespaceExistedInAnotherAppIdAsPublic() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(false); appNamespace.setName("SCC.song0711-03"); appNamespace.setAppId("100003173"); appNamespace.setFormat(ConfigFileFormat.Properties.getValue()); appNamespaceService.createAppNamespaceInLocal(appNamespace); } @Test @Sql(scripts = "/sql/appnamespaceservice/init-appnamespace.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testCreatePrivateAppNamespaceNotExisted() { AppNamespace appNamespace = assembleBaseAppNamespace(); appNamespace.setPublic(false); appNamespaceService.createAppNamespaceInLocal(appNamespace); AppNamespace createdAppNamespace = appNamespaceService.findByAppIdAndName(appNamespace.getAppId(), appNamespace.getName()); Assert.assertNotNull(createdAppNamespace); Assert.assertEquals(appNamespace.getName(), createdAppNamespace.getName()); } private AppNamespace assembleBaseAppNamespace() { AppNamespace appNamespace = new AppNamespace(); appNamespace.setName("appNamespace"); appNamespace.setAppId("1000"); appNamespace.setFormat(ConfigFileFormat.XML.getValue()); return appNamespace; } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-openapi/src/test/java/com/ctrip/framework/apollo/openapi/client/service/ReleaseOpenApiServiceTest.java
package com.ctrip.framework.apollo.openapi.client.service; import static org.junit.Assert.*; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import com.ctrip.framework.apollo.openapi.dto.NamespaceReleaseDTO; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; import org.apache.http.entity.StringEntity; import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; public class ReleaseOpenApiServiceTest extends AbstractOpenApiServiceTest { private ReleaseOpenApiService releaseOpenApiService; private String someAppId; private String someEnv; private String someCluster; private String someNamespace; @Override @Before public void setUp() throws Exception { super.setUp(); someAppId = "someAppId"; someEnv = "someEnv"; someCluster = "someCluster"; someNamespace = "someNamespace"; StringEntity responseEntity = new StringEntity("{}"); when(someHttpResponse.getEntity()).thenReturn(responseEntity); releaseOpenApiService = new ReleaseOpenApiService(httpClient, someBaseUrl, gson); } @Test public void testPublishNamespace() throws Exception { String someReleaseTitle = "someReleaseTitle"; String someReleasedBy = "someReleasedBy"; NamespaceReleaseDTO namespaceReleaseDTO = new NamespaceReleaseDTO(); namespaceReleaseDTO.setReleaseTitle(someReleaseTitle); namespaceReleaseDTO.setReleasedBy(someReleasedBy); final ArgumentCaptor<HttpPost> request = ArgumentCaptor.forClass(HttpPost.class); releaseOpenApiService.publishNamespace(someAppId, someEnv, someCluster, someNamespace, namespaceReleaseDTO); verify(httpClient, times(1)).execute(request.capture()); HttpPost post = request.getValue(); assertEquals(String .format("%s/envs/%s/apps/%s/clusters/%s/namespaces/%s/releases", someBaseUrl, someEnv, someAppId, someCluster, someNamespace), post.getURI().toString()); } @Test(expected = RuntimeException.class) public void testPublishNamespaceWithError() throws Exception { String someReleaseTitle = "someReleaseTitle"; String someReleasedBy = "someReleasedBy"; NamespaceReleaseDTO namespaceReleaseDTO = new NamespaceReleaseDTO(); namespaceReleaseDTO.setReleaseTitle(someReleaseTitle); namespaceReleaseDTO.setReleasedBy(someReleasedBy); when(statusLine.getStatusCode()).thenReturn(400); releaseOpenApiService.publishNamespace(someAppId, someEnv, someCluster, someNamespace, namespaceReleaseDTO); } @Test public void testGetLatestActiveRelease() throws Exception { final ArgumentCaptor<HttpGet> request = ArgumentCaptor.forClass(HttpGet.class); releaseOpenApiService.getLatestActiveRelease(someAppId, someEnv, someCluster, someNamespace); verify(httpClient, times(1)).execute(request.capture()); HttpGet get = request.getValue(); assertEquals(String .format("%s/envs/%s/apps/%s/clusters/%s/namespaces/%s/releases/latest", someBaseUrl, someEnv, someAppId, someCluster, someNamespace), get.getURI().toString()); } @Test(expected = RuntimeException.class) public void testGetLatestActiveReleaseWithError() throws Exception { when(statusLine.getStatusCode()).thenReturn(400); releaseOpenApiService.getLatestActiveRelease(someAppId, someEnv, someCluster, someNamespace); } @Test public void testRollbackRelease() throws Exception { long someReleaseId = 1L; String someOperator = "someOperator"; final ArgumentCaptor<HttpPut> request = ArgumentCaptor.forClass(HttpPut.class); releaseOpenApiService.rollbackRelease(someEnv, someReleaseId, someOperator); verify(httpClient, times(1)).execute(request.capture()); HttpPut put = request.getValue(); assertEquals( String.format("%s/envs/%s/releases/%s/rollback?operator=%s", someBaseUrl, someEnv, someReleaseId, someOperator), put.getURI().toString()); } @Test(expected = RuntimeException.class) public void testRollbackReleaseWithError() throws Exception { long someReleaseId = 1L; String someOperator = "someOperator"; when(statusLine.getStatusCode()).thenReturn(400); releaseOpenApiService.rollbackRelease(someEnv, someReleaseId, someOperator); } }
package com.ctrip.framework.apollo.openapi.client.service; import static org.junit.Assert.*; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import com.ctrip.framework.apollo.openapi.dto.NamespaceReleaseDTO; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; import org.apache.http.entity.StringEntity; import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; public class ReleaseOpenApiServiceTest extends AbstractOpenApiServiceTest { private ReleaseOpenApiService releaseOpenApiService; private String someAppId; private String someEnv; private String someCluster; private String someNamespace; @Override @Before public void setUp() throws Exception { super.setUp(); someAppId = "someAppId"; someEnv = "someEnv"; someCluster = "someCluster"; someNamespace = "someNamespace"; StringEntity responseEntity = new StringEntity("{}"); when(someHttpResponse.getEntity()).thenReturn(responseEntity); releaseOpenApiService = new ReleaseOpenApiService(httpClient, someBaseUrl, gson); } @Test public void testPublishNamespace() throws Exception { String someReleaseTitle = "someReleaseTitle"; String someReleasedBy = "someReleasedBy"; NamespaceReleaseDTO namespaceReleaseDTO = new NamespaceReleaseDTO(); namespaceReleaseDTO.setReleaseTitle(someReleaseTitle); namespaceReleaseDTO.setReleasedBy(someReleasedBy); final ArgumentCaptor<HttpPost> request = ArgumentCaptor.forClass(HttpPost.class); releaseOpenApiService.publishNamespace(someAppId, someEnv, someCluster, someNamespace, namespaceReleaseDTO); verify(httpClient, times(1)).execute(request.capture()); HttpPost post = request.getValue(); assertEquals(String .format("%s/envs/%s/apps/%s/clusters/%s/namespaces/%s/releases", someBaseUrl, someEnv, someAppId, someCluster, someNamespace), post.getURI().toString()); } @Test(expected = RuntimeException.class) public void testPublishNamespaceWithError() throws Exception { String someReleaseTitle = "someReleaseTitle"; String someReleasedBy = "someReleasedBy"; NamespaceReleaseDTO namespaceReleaseDTO = new NamespaceReleaseDTO(); namespaceReleaseDTO.setReleaseTitle(someReleaseTitle); namespaceReleaseDTO.setReleasedBy(someReleasedBy); when(statusLine.getStatusCode()).thenReturn(400); releaseOpenApiService.publishNamespace(someAppId, someEnv, someCluster, someNamespace, namespaceReleaseDTO); } @Test public void testGetLatestActiveRelease() throws Exception { final ArgumentCaptor<HttpGet> request = ArgumentCaptor.forClass(HttpGet.class); releaseOpenApiService.getLatestActiveRelease(someAppId, someEnv, someCluster, someNamespace); verify(httpClient, times(1)).execute(request.capture()); HttpGet get = request.getValue(); assertEquals(String .format("%s/envs/%s/apps/%s/clusters/%s/namespaces/%s/releases/latest", someBaseUrl, someEnv, someAppId, someCluster, someNamespace), get.getURI().toString()); } @Test(expected = RuntimeException.class) public void testGetLatestActiveReleaseWithError() throws Exception { when(statusLine.getStatusCode()).thenReturn(400); releaseOpenApiService.getLatestActiveRelease(someAppId, someEnv, someCluster, someNamespace); } @Test public void testRollbackRelease() throws Exception { long someReleaseId = 1L; String someOperator = "someOperator"; final ArgumentCaptor<HttpPut> request = ArgumentCaptor.forClass(HttpPut.class); releaseOpenApiService.rollbackRelease(someEnv, someReleaseId, someOperator); verify(httpClient, times(1)).execute(request.capture()); HttpPut put = request.getValue(); assertEquals( String.format("%s/envs/%s/releases/%s/rollback?operator=%s", someBaseUrl, someEnv, someReleaseId, someOperator), put.getURI().toString()); } @Test(expected = RuntimeException.class) public void testRollbackReleaseWithError() throws Exception { long someReleaseId = 1L; String someOperator = "someOperator"; when(statusLine.getStatusCode()).thenReturn(400); releaseOpenApiService.rollbackRelease(someEnv, someReleaseId, someOperator); } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/entity/ConsumerRole.java
package com.ctrip.framework.apollo.openapi.entity; import com.ctrip.framework.apollo.common.entity.BaseEntity; import org.hibernate.annotations.SQLDelete; import org.hibernate.annotations.Where; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; /** * @author Jason Song([email protected]) */ @Entity @Table(name = "ConsumerRole") @SQLDelete(sql = "Update ConsumerRole set isDeleted = 1 where id = ?") @Where(clause = "isDeleted = 0") public class ConsumerRole extends BaseEntity { @Column(name = "ConsumerId", nullable = false) private long consumerId; @Column(name = "RoleId", nullable = false) private long roleId; public long getConsumerId() { return consumerId; } public void setConsumerId(long consumerId) { this.consumerId = consumerId; } public long getRoleId() { return roleId; } public void setRoleId(long roleId) { this.roleId = roleId; } @Override public String toString() { return toStringHelper().add("consumerId", consumerId).add("roleId", roleId).toString(); } }
package com.ctrip.framework.apollo.openapi.entity; import com.ctrip.framework.apollo.common.entity.BaseEntity; import org.hibernate.annotations.SQLDelete; import org.hibernate.annotations.Where; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; /** * @author Jason Song([email protected]) */ @Entity @Table(name = "ConsumerRole") @SQLDelete(sql = "Update ConsumerRole set isDeleted = 1 where id = ?") @Where(clause = "isDeleted = 0") public class ConsumerRole extends BaseEntity { @Column(name = "ConsumerId", nullable = false) private long consumerId; @Column(name = "RoleId", nullable = false) private long roleId; public long getConsumerId() { return consumerId; } public void setConsumerId(long consumerId) { this.consumerId = consumerId; } public long getRoleId() { return roleId; } public void setRoleId(long roleId) { this.roleId = roleId; } @Override public String toString() { return toStringHelper().add("consumerId", consumerId).add("roleId", roleId).toString(); } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/LdapMappingProperties.java
package com.ctrip.framework.apollo.portal.spi.configuration; /** * the LdapMappingProperties description. * * @author wuzishu */ public class LdapMappingProperties { /** * user ldap objectClass */ private String objectClass; /** * user login Id */ private String loginId; /** * user rdn key */ private String rdnKey; /** * user display name */ private String userDisplayName; /** * email */ private String email; public String getObjectClass() { return objectClass; } public void setObjectClass(String objectClass) { this.objectClass = objectClass; } public String getLoginId() { return loginId; } public void setLoginId(String loginId) { this.loginId = loginId; } public String getRdnKey() { return rdnKey; } public void setRdnKey(String rdnKey) { this.rdnKey = rdnKey; } public String getUserDisplayName() { return userDisplayName; } public void setUserDisplayName(String userDisplayName) { this.userDisplayName = userDisplayName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } }
package com.ctrip.framework.apollo.portal.spi.configuration; /** * the LdapMappingProperties description. * * @author wuzishu */ public class LdapMappingProperties { /** * user ldap objectClass */ private String objectClass; /** * user login Id */ private String loginId; /** * user rdn key */ private String rdnKey; /** * user display name */ private String userDisplayName; /** * email */ private String email; public String getObjectClass() { return objectClass; } public void setObjectClass(String objectClass) { this.objectClass = objectClass; } public String getLoginId() { return loginId; } public void setLoginId(String loginId) { this.loginId = loginId; } public String getRdnKey() { return rdnKey; } public void setRdnKey(String rdnKey) { this.rdnKey = rdnKey; } public String getUserDisplayName() { return userDisplayName; } public void setUserDisplayName(String userDisplayName) { this.userDisplayName = userDisplayName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-common/src/main/java/com/ctrip/framework/apollo/common/dto/CommitDTO.java
package com.ctrip.framework.apollo.common.dto; public class CommitDTO extends BaseDTO{ private String changeSets; private String appId; private String clusterName; private String namespaceName; private String comment; public String getChangeSets() { return changeSets; } public void setChangeSets(String changeSets) { this.changeSets = changeSets; } public String getAppId() { return appId; } public void setAppId(String appId) { this.appId = appId; } public String getClusterName() { return clusterName; } public void setClusterName(String clusterName) { this.clusterName = clusterName; } public String getNamespaceName() { return namespaceName; } public void setNamespaceName(String namespaceName) { this.namespaceName = namespaceName; } public String getComment() { return comment; } public void setComment(String comment) { this.comment = comment; } }
package com.ctrip.framework.apollo.common.dto; public class CommitDTO extends BaseDTO{ private String changeSets; private String appId; private String clusterName; private String namespaceName; private String comment; public String getChangeSets() { return changeSets; } public void setChangeSets(String changeSets) { this.changeSets = changeSets; } public String getAppId() { return appId; } public void setAppId(String appId) { this.appId = appId; } public String getClusterName() { return clusterName; } public void setClusterName(String clusterName) { this.clusterName = clusterName; } public String getNamespaceName() { return namespaceName; } public void setNamespaceName(String namespaceName) { this.namespaceName = namespaceName; } public String getComment() { return comment; } public void setComment(String comment) { this.comment = comment; } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-biz/src/test/java/com/ctrip/framework/apollo/biz/message/DatabaseMessageSenderTest.java
package com.ctrip.framework.apollo.biz.message; import com.ctrip.framework.apollo.biz.AbstractUnitTest; import com.ctrip.framework.apollo.biz.entity.ReleaseMessage; import com.ctrip.framework.apollo.biz.repository.ReleaseMessageRepository; import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.*; /** * @author Jason Song([email protected]) */ public class DatabaseMessageSenderTest extends AbstractUnitTest{ private DatabaseMessageSender messageSender; @Mock private ReleaseMessageRepository releaseMessageRepository; @Before public void setUp() throws Exception { messageSender = new DatabaseMessageSender(releaseMessageRepository); } @Test public void testSendMessage() throws Exception { String someMessage = "some-message"; long someId = 1; ReleaseMessage someReleaseMessage = mock(ReleaseMessage.class); when(someReleaseMessage.getId()).thenReturn(someId); when(releaseMessageRepository.save(any(ReleaseMessage.class))).thenReturn(someReleaseMessage); ArgumentCaptor<ReleaseMessage> captor = ArgumentCaptor.forClass(ReleaseMessage.class); messageSender.sendMessage(someMessage, Topics.APOLLO_RELEASE_TOPIC); verify(releaseMessageRepository, times(1)).save(captor.capture()); assertEquals(someMessage, captor.getValue().getMessage()); } @Test public void testSendUnsupportedMessage() throws Exception { String someMessage = "some-message"; String someUnsupportedTopic = "some-invalid-topic"; messageSender.sendMessage(someMessage, someUnsupportedTopic); verify(releaseMessageRepository, never()).save(any(ReleaseMessage.class)); } @Test(expected = RuntimeException.class) public void testSendMessageFailed() throws Exception { String someMessage = "some-message"; when(releaseMessageRepository.save(any(ReleaseMessage.class))).thenThrow(new RuntimeException()); messageSender.sendMessage(someMessage, Topics.APOLLO_RELEASE_TOPIC); } }
package com.ctrip.framework.apollo.biz.message; import com.ctrip.framework.apollo.biz.AbstractUnitTest; import com.ctrip.framework.apollo.biz.entity.ReleaseMessage; import com.ctrip.framework.apollo.biz.repository.ReleaseMessageRepository; import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.*; /** * @author Jason Song([email protected]) */ public class DatabaseMessageSenderTest extends AbstractUnitTest{ private DatabaseMessageSender messageSender; @Mock private ReleaseMessageRepository releaseMessageRepository; @Before public void setUp() throws Exception { messageSender = new DatabaseMessageSender(releaseMessageRepository); } @Test public void testSendMessage() throws Exception { String someMessage = "some-message"; long someId = 1; ReleaseMessage someReleaseMessage = mock(ReleaseMessage.class); when(someReleaseMessage.getId()).thenReturn(someId); when(releaseMessageRepository.save(any(ReleaseMessage.class))).thenReturn(someReleaseMessage); ArgumentCaptor<ReleaseMessage> captor = ArgumentCaptor.forClass(ReleaseMessage.class); messageSender.sendMessage(someMessage, Topics.APOLLO_RELEASE_TOPIC); verify(releaseMessageRepository, times(1)).save(captor.capture()); assertEquals(someMessage, captor.getValue().getMessage()); } @Test public void testSendUnsupportedMessage() throws Exception { String someMessage = "some-message"; String someUnsupportedTopic = "some-invalid-topic"; messageSender.sendMessage(someMessage, someUnsupportedTopic); verify(releaseMessageRepository, never()).save(any(ReleaseMessage.class)); } @Test(expected = RuntimeException.class) public void testSendMessageFailed() throws Exception { String someMessage = "some-message"; when(releaseMessageRepository.save(any(ReleaseMessage.class))).thenThrow(new RuntimeException()); messageSender.sendMessage(someMessage, Topics.APOLLO_RELEASE_TOPIC); } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/ctrip/WebContextConfiguration.java
package com.ctrip.framework.apollo.portal.spi.ctrip; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import com.ctrip.framework.apollo.portal.spi.UserInfoHolder; import com.ctrip.framework.apollo.portal.spi.ctrip.filters.UserAccessFilter; import com.google.common.base.Strings; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; @Configuration @Profile("ctrip") public class WebContextConfiguration { private final PortalConfig portalConfig; private final UserInfoHolder userInfoHolder; public WebContextConfiguration(final PortalConfig portalConfig, final UserInfoHolder userInfoHolder) { this.portalConfig = portalConfig; this.userInfoHolder = userInfoHolder; } @Bean public ServletContextInitializer servletContextInitializer() { return servletContext -> { String loggingServerIP = portalConfig.cloggingUrl(); String loggingServerPort = portalConfig.cloggingPort(); String credisServiceUrl = portalConfig.credisServiceUrl(); servletContext.setInitParameter("loggingServerIP", Strings.isNullOrEmpty(loggingServerIP) ? "" : loggingServerIP); servletContext.setInitParameter("loggingServerPort", Strings.isNullOrEmpty(loggingServerPort) ? "" : loggingServerPort); servletContext.setInitParameter("credisServiceUrl", Strings.isNullOrEmpty(credisServiceUrl) ? "" : credisServiceUrl); }; } @Bean public FilterRegistrationBean userAccessFilter() { FilterRegistrationBean filter = new FilterRegistrationBean(); filter.setFilter(new UserAccessFilter(userInfoHolder)); filter.addUrlPatterns("/*"); return filter; } }
package com.ctrip.framework.apollo.portal.spi.ctrip; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import com.ctrip.framework.apollo.portal.spi.UserInfoHolder; import com.ctrip.framework.apollo.portal.spi.ctrip.filters.UserAccessFilter; import com.google.common.base.Strings; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; @Configuration @Profile("ctrip") public class WebContextConfiguration { private final PortalConfig portalConfig; private final UserInfoHolder userInfoHolder; public WebContextConfiguration(final PortalConfig portalConfig, final UserInfoHolder userInfoHolder) { this.portalConfig = portalConfig; this.userInfoHolder = userInfoHolder; } @Bean public ServletContextInitializer servletContextInitializer() { return servletContext -> { String loggingServerIP = portalConfig.cloggingUrl(); String loggingServerPort = portalConfig.cloggingPort(); String credisServiceUrl = portalConfig.credisServiceUrl(); servletContext.setInitParameter("loggingServerIP", Strings.isNullOrEmpty(loggingServerIP) ? "" : loggingServerIP); servletContext.setInitParameter("loggingServerPort", Strings.isNullOrEmpty(loggingServerPort) ? "" : loggingServerPort); servletContext.setInitParameter("credisServiceUrl", Strings.isNullOrEmpty(credisServiceUrl) ? "" : credisServiceUrl); }; } @Bean public FilterRegistrationBean userAccessFilter() { FilterRegistrationBean filter = new FilterRegistrationBean(); filter.setFilter(new UserAccessFilter(userInfoHolder)); filter.addUrlPatterns("/*"); return filter; } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/NamespaceService.java
package com.ctrip.framework.apollo.biz.service; import com.ctrip.framework.apollo.biz.entity.Audit; import com.ctrip.framework.apollo.biz.entity.Cluster; import com.ctrip.framework.apollo.biz.entity.Item; import com.ctrip.framework.apollo.biz.entity.Namespace; import com.ctrip.framework.apollo.biz.entity.Release; import com.ctrip.framework.apollo.biz.message.MessageSender; import com.ctrip.framework.apollo.biz.message.Topics; import com.ctrip.framework.apollo.biz.repository.NamespaceRepository; import com.ctrip.framework.apollo.biz.utils.ReleaseMessageKeyGenerator; import com.ctrip.framework.apollo.common.constants.GsonType; import com.ctrip.framework.apollo.common.constants.NamespaceBranchStatus; import com.ctrip.framework.apollo.common.entity.AppNamespace; import com.ctrip.framework.apollo.common.exception.BadRequestException; import com.ctrip.framework.apollo.common.exception.ServiceException; import com.ctrip.framework.apollo.common.utils.BeanUtils; import com.ctrip.framework.apollo.core.ConfigConsts; import com.google.common.collect.Maps; import com.google.gson.Gson; import org.springframework.context.annotation.Lazy; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.Collections; import java.util.Date; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; @Service public class NamespaceService { private static final Gson GSON = new Gson(); private final NamespaceRepository namespaceRepository; private final AuditService auditService; private final AppNamespaceService appNamespaceService; private final ItemService itemService; private final CommitService commitService; private final ReleaseService releaseService; private final ClusterService clusterService; private final NamespaceBranchService namespaceBranchService; private final ReleaseHistoryService releaseHistoryService; private final NamespaceLockService namespaceLockService; private final InstanceService instanceService; private final MessageSender messageSender; public NamespaceService( final ReleaseHistoryService releaseHistoryService, final NamespaceRepository namespaceRepository, final AuditService auditService, final @Lazy AppNamespaceService appNamespaceService, final MessageSender messageSender, final @Lazy ItemService itemService, final CommitService commitService, final @Lazy ReleaseService releaseService, final @Lazy ClusterService clusterService, final @Lazy NamespaceBranchService namespaceBranchService, final NamespaceLockService namespaceLockService, final InstanceService instanceService) { this.releaseHistoryService = releaseHistoryService; this.namespaceRepository = namespaceRepository; this.auditService = auditService; this.appNamespaceService = appNamespaceService; this.messageSender = messageSender; this.itemService = itemService; this.commitService = commitService; this.releaseService = releaseService; this.clusterService = clusterService; this.namespaceBranchService = namespaceBranchService; this.namespaceLockService = namespaceLockService; this.instanceService = instanceService; } public Namespace findOne(Long namespaceId) { return namespaceRepository.findById(namespaceId).orElse(null); } public Namespace findOne(String appId, String clusterName, String namespaceName) { return namespaceRepository.findByAppIdAndClusterNameAndNamespaceName(appId, clusterName, namespaceName); } public Namespace findPublicNamespaceForAssociatedNamespace(String clusterName, String namespaceName) { AppNamespace appNamespace = appNamespaceService.findPublicNamespaceByName(namespaceName); if (appNamespace == null) { throw new BadRequestException("namespace not exist"); } String appId = appNamespace.getAppId(); Namespace namespace = findOne(appId, clusterName, namespaceName); //default cluster's namespace if (Objects.equals(clusterName, ConfigConsts.CLUSTER_NAME_DEFAULT)) { return namespace; } //custom cluster's namespace not exist. //return default cluster's namespace if (namespace == null) { return findOne(appId, ConfigConsts.CLUSTER_NAME_DEFAULT, namespaceName); } //custom cluster's namespace exist and has published. //return custom cluster's namespace Release latestActiveRelease = releaseService.findLatestActiveRelease(namespace); if (latestActiveRelease != null) { return namespace; } Namespace defaultNamespace = findOne(appId, ConfigConsts.CLUSTER_NAME_DEFAULT, namespaceName); //custom cluster's namespace exist but never published. //and default cluster's namespace not exist. //return custom cluster's namespace if (defaultNamespace == null) { return namespace; } //custom cluster's namespace exist but never published. //and default cluster's namespace exist and has published. //return default cluster's namespace Release defaultNamespaceLatestActiveRelease = releaseService.findLatestActiveRelease(defaultNamespace); if (defaultNamespaceLatestActiveRelease != null) { return defaultNamespace; } //custom cluster's namespace exist but never published. //and default cluster's namespace exist but never published. //return custom cluster's namespace return namespace; } public List<Namespace> findPublicAppNamespaceAllNamespaces(String namespaceName, Pageable page) { AppNamespace publicAppNamespace = appNamespaceService.findPublicNamespaceByName(namespaceName); if (publicAppNamespace == null) { throw new BadRequestException( String.format("Public appNamespace not exists. NamespaceName = %s", namespaceName)); } List<Namespace> namespaces = namespaceRepository.findByNamespaceName(namespaceName, page); return filterChildNamespace(namespaces); } private List<Namespace> filterChildNamespace(List<Namespace> namespaces) { List<Namespace> result = new LinkedList<>(); if (CollectionUtils.isEmpty(namespaces)) { return result; } for (Namespace namespace : namespaces) { if (!isChildNamespace(namespace)) { result.add(namespace); } } return result; } public int countPublicAppNamespaceAssociatedNamespaces(String publicNamespaceName) { AppNamespace publicAppNamespace = appNamespaceService.findPublicNamespaceByName(publicNamespaceName); if (publicAppNamespace == null) { throw new BadRequestException( String.format("Public appNamespace not exists. NamespaceName = %s", publicNamespaceName)); } return namespaceRepository.countByNamespaceNameAndAppIdNot(publicNamespaceName, publicAppNamespace.getAppId()); } public List<Namespace> findNamespaces(String appId, String clusterName) { List<Namespace> namespaces = namespaceRepository.findByAppIdAndClusterNameOrderByIdAsc(appId, clusterName); if (namespaces == null) { return Collections.emptyList(); } return namespaces; } public List<Namespace> findByAppIdAndNamespaceName(String appId, String namespaceName) { return namespaceRepository.findByAppIdAndNamespaceNameOrderByIdAsc(appId, namespaceName); } public Namespace findChildNamespace(String appId, String parentClusterName, String namespaceName) { List<Namespace> namespaces = findByAppIdAndNamespaceName(appId, namespaceName); if (CollectionUtils.isEmpty(namespaces) || namespaces.size() == 1) { return null; } List<Cluster> childClusters = clusterService.findChildClusters(appId, parentClusterName); if (CollectionUtils.isEmpty(childClusters)) { return null; } Set<String> childClusterNames = childClusters.stream().map(Cluster::getName).collect(Collectors.toSet()); //the child namespace is the intersection of the child clusters and child namespaces for (Namespace namespace : namespaces) { if (childClusterNames.contains(namespace.getClusterName())) { return namespace; } } return null; } public Namespace findChildNamespace(Namespace parentNamespace) { String appId = parentNamespace.getAppId(); String parentClusterName = parentNamespace.getClusterName(); String namespaceName = parentNamespace.getNamespaceName(); return findChildNamespace(appId, parentClusterName, namespaceName); } public Namespace findParentNamespace(String appId, String clusterName, String namespaceName) { return findParentNamespace(new Namespace(appId, clusterName, namespaceName)); } public Namespace findParentNamespace(Namespace namespace) { String appId = namespace.getAppId(); String namespaceName = namespace.getNamespaceName(); Cluster cluster = clusterService.findOne(appId, namespace.getClusterName()); if (cluster != null && cluster.getParentClusterId() > 0) { Cluster parentCluster = clusterService.findOne(cluster.getParentClusterId()); return findOne(appId, parentCluster.getName(), namespaceName); } return null; } public boolean isChildNamespace(String appId, String clusterName, String namespaceName) { return isChildNamespace(new Namespace(appId, clusterName, namespaceName)); } public boolean isChildNamespace(Namespace namespace) { return findParentNamespace(namespace) != null; } public boolean isNamespaceUnique(String appId, String cluster, String namespace) { Objects.requireNonNull(appId, "AppId must not be null"); Objects.requireNonNull(cluster, "Cluster must not be null"); Objects.requireNonNull(namespace, "Namespace must not be null"); return Objects.isNull( namespaceRepository.findByAppIdAndClusterNameAndNamespaceName(appId, cluster, namespace)); } @Transactional public void deleteByAppIdAndClusterName(String appId, String clusterName, String operator) { List<Namespace> toDeleteNamespaces = findNamespaces(appId, clusterName); for (Namespace namespace : toDeleteNamespaces) { deleteNamespace(namespace, operator); } } @Transactional public Namespace deleteNamespace(Namespace namespace, String operator) { String appId = namespace.getAppId(); String clusterName = namespace.getClusterName(); String namespaceName = namespace.getNamespaceName(); itemService.batchDelete(namespace.getId(), operator); commitService.batchDelete(appId, clusterName, namespace.getNamespaceName(), operator); // Child namespace releases should retain as long as the parent namespace exists, because parent namespaces' release // histories need them if (!isChildNamespace(namespace)) { releaseService.batchDelete(appId, clusterName, namespace.getNamespaceName(), operator); } //delete child namespace Namespace childNamespace = findChildNamespace(namespace); if (childNamespace != null) { namespaceBranchService.deleteBranch(appId, clusterName, namespaceName, childNamespace.getClusterName(), NamespaceBranchStatus.DELETED, operator); //delete child namespace's releases. Notice: delete child namespace will not delete child namespace's releases releaseService.batchDelete(appId, childNamespace.getClusterName(), namespaceName, operator); } releaseHistoryService.batchDelete(appId, clusterName, namespaceName, operator); instanceService.batchDeleteInstanceConfig(appId, clusterName, namespaceName); namespaceLockService.unlock(namespace.getId()); namespace.setDeleted(true); namespace.setDataChangeLastModifiedBy(operator); auditService.audit(Namespace.class.getSimpleName(), namespace.getId(), Audit.OP.DELETE, operator); Namespace deleted = namespaceRepository.save(namespace); //Publish release message to do some clean up in config service, such as updating the cache messageSender.sendMessage(ReleaseMessageKeyGenerator.generate(appId, clusterName, namespaceName), Topics.APOLLO_RELEASE_TOPIC); return deleted; } @Transactional public Namespace save(Namespace entity) { if (!isNamespaceUnique(entity.getAppId(), entity.getClusterName(), entity.getNamespaceName())) { throw new ServiceException("namespace not unique"); } entity.setId(0);//protection Namespace namespace = namespaceRepository.save(entity); auditService.audit(Namespace.class.getSimpleName(), namespace.getId(), Audit.OP.INSERT, namespace.getDataChangeCreatedBy()); return namespace; } @Transactional public Namespace update(Namespace namespace) { Namespace managedNamespace = namespaceRepository.findByAppIdAndClusterNameAndNamespaceName( namespace.getAppId(), namespace.getClusterName(), namespace.getNamespaceName()); BeanUtils.copyEntityProperties(namespace, managedNamespace); managedNamespace = namespaceRepository.save(managedNamespace); auditService.audit(Namespace.class.getSimpleName(), managedNamespace.getId(), Audit.OP.UPDATE, managedNamespace.getDataChangeLastModifiedBy()); return managedNamespace; } @Transactional public void instanceOfAppNamespaces(String appId, String clusterName, String createBy) { List<AppNamespace> appNamespaces = appNamespaceService.findByAppId(appId); for (AppNamespace appNamespace : appNamespaces) { Namespace ns = new Namespace(); ns.setAppId(appId); ns.setClusterName(clusterName); ns.setNamespaceName(appNamespace.getName()); ns.setDataChangeCreatedBy(createBy); ns.setDataChangeLastModifiedBy(createBy); namespaceRepository.save(ns); auditService.audit(Namespace.class.getSimpleName(), ns.getId(), Audit.OP.INSERT, createBy); } } public Map<String, Boolean> namespacePublishInfo(String appId) { List<Cluster> clusters = clusterService.findParentClusters(appId); if (CollectionUtils.isEmpty(clusters)) { throw new BadRequestException("app not exist"); } Map<String, Boolean> clusterHasNotPublishedItems = Maps.newHashMap(); for (Cluster cluster : clusters) { String clusterName = cluster.getName(); List<Namespace> namespaces = findNamespaces(appId, clusterName); for (Namespace namespace : namespaces) { boolean isNamespaceNotPublished = isNamespaceNotPublished(namespace); if (isNamespaceNotPublished) { clusterHasNotPublishedItems.put(clusterName, true); break; } } clusterHasNotPublishedItems.putIfAbsent(clusterName, false); } return clusterHasNotPublishedItems; } private boolean isNamespaceNotPublished(Namespace namespace) { Release latestRelease = releaseService.findLatestActiveRelease(namespace); long namespaceId = namespace.getId(); if (latestRelease == null) { Item lastItem = itemService.findLastOne(namespaceId); return lastItem != null; } Date lastPublishTime = latestRelease.getDataChangeLastModifiedTime(); List<Item> itemsModifiedAfterLastPublish = itemService.findItemsModifiedAfterDate(namespaceId, lastPublishTime); if (CollectionUtils.isEmpty(itemsModifiedAfterLastPublish)) { return false; } Map<String, String> publishedConfiguration = GSON.fromJson(latestRelease.getConfigurations(), GsonType.CONFIG); for (Item item : itemsModifiedAfterLastPublish) { if (!Objects.equals(item.getValue(), publishedConfiguration.get(item.getKey()))) { return true; } } return false; } }
package com.ctrip.framework.apollo.biz.service; import com.ctrip.framework.apollo.biz.entity.Audit; import com.ctrip.framework.apollo.biz.entity.Cluster; import com.ctrip.framework.apollo.biz.entity.Item; import com.ctrip.framework.apollo.biz.entity.Namespace; import com.ctrip.framework.apollo.biz.entity.Release; import com.ctrip.framework.apollo.biz.message.MessageSender; import com.ctrip.framework.apollo.biz.message.Topics; import com.ctrip.framework.apollo.biz.repository.NamespaceRepository; import com.ctrip.framework.apollo.biz.utils.ReleaseMessageKeyGenerator; import com.ctrip.framework.apollo.common.constants.GsonType; import com.ctrip.framework.apollo.common.constants.NamespaceBranchStatus; import com.ctrip.framework.apollo.common.entity.AppNamespace; import com.ctrip.framework.apollo.common.exception.BadRequestException; import com.ctrip.framework.apollo.common.exception.ServiceException; import com.ctrip.framework.apollo.common.utils.BeanUtils; import com.ctrip.framework.apollo.core.ConfigConsts; import com.google.common.collect.Maps; import com.google.gson.Gson; import org.springframework.context.annotation.Lazy; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.Collections; import java.util.Date; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; @Service public class NamespaceService { private static final Gson GSON = new Gson(); private final NamespaceRepository namespaceRepository; private final AuditService auditService; private final AppNamespaceService appNamespaceService; private final ItemService itemService; private final CommitService commitService; private final ReleaseService releaseService; private final ClusterService clusterService; private final NamespaceBranchService namespaceBranchService; private final ReleaseHistoryService releaseHistoryService; private final NamespaceLockService namespaceLockService; private final InstanceService instanceService; private final MessageSender messageSender; public NamespaceService( final ReleaseHistoryService releaseHistoryService, final NamespaceRepository namespaceRepository, final AuditService auditService, final @Lazy AppNamespaceService appNamespaceService, final MessageSender messageSender, final @Lazy ItemService itemService, final CommitService commitService, final @Lazy ReleaseService releaseService, final @Lazy ClusterService clusterService, final @Lazy NamespaceBranchService namespaceBranchService, final NamespaceLockService namespaceLockService, final InstanceService instanceService) { this.releaseHistoryService = releaseHistoryService; this.namespaceRepository = namespaceRepository; this.auditService = auditService; this.appNamespaceService = appNamespaceService; this.messageSender = messageSender; this.itemService = itemService; this.commitService = commitService; this.releaseService = releaseService; this.clusterService = clusterService; this.namespaceBranchService = namespaceBranchService; this.namespaceLockService = namespaceLockService; this.instanceService = instanceService; } public Namespace findOne(Long namespaceId) { return namespaceRepository.findById(namespaceId).orElse(null); } public Namespace findOne(String appId, String clusterName, String namespaceName) { return namespaceRepository.findByAppIdAndClusterNameAndNamespaceName(appId, clusterName, namespaceName); } public Namespace findPublicNamespaceForAssociatedNamespace(String clusterName, String namespaceName) { AppNamespace appNamespace = appNamespaceService.findPublicNamespaceByName(namespaceName); if (appNamespace == null) { throw new BadRequestException("namespace not exist"); } String appId = appNamespace.getAppId(); Namespace namespace = findOne(appId, clusterName, namespaceName); //default cluster's namespace if (Objects.equals(clusterName, ConfigConsts.CLUSTER_NAME_DEFAULT)) { return namespace; } //custom cluster's namespace not exist. //return default cluster's namespace if (namespace == null) { return findOne(appId, ConfigConsts.CLUSTER_NAME_DEFAULT, namespaceName); } //custom cluster's namespace exist and has published. //return custom cluster's namespace Release latestActiveRelease = releaseService.findLatestActiveRelease(namespace); if (latestActiveRelease != null) { return namespace; } Namespace defaultNamespace = findOne(appId, ConfigConsts.CLUSTER_NAME_DEFAULT, namespaceName); //custom cluster's namespace exist but never published. //and default cluster's namespace not exist. //return custom cluster's namespace if (defaultNamespace == null) { return namespace; } //custom cluster's namespace exist but never published. //and default cluster's namespace exist and has published. //return default cluster's namespace Release defaultNamespaceLatestActiveRelease = releaseService.findLatestActiveRelease(defaultNamespace); if (defaultNamespaceLatestActiveRelease != null) { return defaultNamespace; } //custom cluster's namespace exist but never published. //and default cluster's namespace exist but never published. //return custom cluster's namespace return namespace; } public List<Namespace> findPublicAppNamespaceAllNamespaces(String namespaceName, Pageable page) { AppNamespace publicAppNamespace = appNamespaceService.findPublicNamespaceByName(namespaceName); if (publicAppNamespace == null) { throw new BadRequestException( String.format("Public appNamespace not exists. NamespaceName = %s", namespaceName)); } List<Namespace> namespaces = namespaceRepository.findByNamespaceName(namespaceName, page); return filterChildNamespace(namespaces); } private List<Namespace> filterChildNamespace(List<Namespace> namespaces) { List<Namespace> result = new LinkedList<>(); if (CollectionUtils.isEmpty(namespaces)) { return result; } for (Namespace namespace : namespaces) { if (!isChildNamespace(namespace)) { result.add(namespace); } } return result; } public int countPublicAppNamespaceAssociatedNamespaces(String publicNamespaceName) { AppNamespace publicAppNamespace = appNamespaceService.findPublicNamespaceByName(publicNamespaceName); if (publicAppNamespace == null) { throw new BadRequestException( String.format("Public appNamespace not exists. NamespaceName = %s", publicNamespaceName)); } return namespaceRepository.countByNamespaceNameAndAppIdNot(publicNamespaceName, publicAppNamespace.getAppId()); } public List<Namespace> findNamespaces(String appId, String clusterName) { List<Namespace> namespaces = namespaceRepository.findByAppIdAndClusterNameOrderByIdAsc(appId, clusterName); if (namespaces == null) { return Collections.emptyList(); } return namespaces; } public List<Namespace> findByAppIdAndNamespaceName(String appId, String namespaceName) { return namespaceRepository.findByAppIdAndNamespaceNameOrderByIdAsc(appId, namespaceName); } public Namespace findChildNamespace(String appId, String parentClusterName, String namespaceName) { List<Namespace> namespaces = findByAppIdAndNamespaceName(appId, namespaceName); if (CollectionUtils.isEmpty(namespaces) || namespaces.size() == 1) { return null; } List<Cluster> childClusters = clusterService.findChildClusters(appId, parentClusterName); if (CollectionUtils.isEmpty(childClusters)) { return null; } Set<String> childClusterNames = childClusters.stream().map(Cluster::getName).collect(Collectors.toSet()); //the child namespace is the intersection of the child clusters and child namespaces for (Namespace namespace : namespaces) { if (childClusterNames.contains(namespace.getClusterName())) { return namespace; } } return null; } public Namespace findChildNamespace(Namespace parentNamespace) { String appId = parentNamespace.getAppId(); String parentClusterName = parentNamespace.getClusterName(); String namespaceName = parentNamespace.getNamespaceName(); return findChildNamespace(appId, parentClusterName, namespaceName); } public Namespace findParentNamespace(String appId, String clusterName, String namespaceName) { return findParentNamespace(new Namespace(appId, clusterName, namespaceName)); } public Namespace findParentNamespace(Namespace namespace) { String appId = namespace.getAppId(); String namespaceName = namespace.getNamespaceName(); Cluster cluster = clusterService.findOne(appId, namespace.getClusterName()); if (cluster != null && cluster.getParentClusterId() > 0) { Cluster parentCluster = clusterService.findOne(cluster.getParentClusterId()); return findOne(appId, parentCluster.getName(), namespaceName); } return null; } public boolean isChildNamespace(String appId, String clusterName, String namespaceName) { return isChildNamespace(new Namespace(appId, clusterName, namespaceName)); } public boolean isChildNamespace(Namespace namespace) { return findParentNamespace(namespace) != null; } public boolean isNamespaceUnique(String appId, String cluster, String namespace) { Objects.requireNonNull(appId, "AppId must not be null"); Objects.requireNonNull(cluster, "Cluster must not be null"); Objects.requireNonNull(namespace, "Namespace must not be null"); return Objects.isNull( namespaceRepository.findByAppIdAndClusterNameAndNamespaceName(appId, cluster, namespace)); } @Transactional public void deleteByAppIdAndClusterName(String appId, String clusterName, String operator) { List<Namespace> toDeleteNamespaces = findNamespaces(appId, clusterName); for (Namespace namespace : toDeleteNamespaces) { deleteNamespace(namespace, operator); } } @Transactional public Namespace deleteNamespace(Namespace namespace, String operator) { String appId = namespace.getAppId(); String clusterName = namespace.getClusterName(); String namespaceName = namespace.getNamespaceName(); itemService.batchDelete(namespace.getId(), operator); commitService.batchDelete(appId, clusterName, namespace.getNamespaceName(), operator); // Child namespace releases should retain as long as the parent namespace exists, because parent namespaces' release // histories need them if (!isChildNamespace(namespace)) { releaseService.batchDelete(appId, clusterName, namespace.getNamespaceName(), operator); } //delete child namespace Namespace childNamespace = findChildNamespace(namespace); if (childNamespace != null) { namespaceBranchService.deleteBranch(appId, clusterName, namespaceName, childNamespace.getClusterName(), NamespaceBranchStatus.DELETED, operator); //delete child namespace's releases. Notice: delete child namespace will not delete child namespace's releases releaseService.batchDelete(appId, childNamespace.getClusterName(), namespaceName, operator); } releaseHistoryService.batchDelete(appId, clusterName, namespaceName, operator); instanceService.batchDeleteInstanceConfig(appId, clusterName, namespaceName); namespaceLockService.unlock(namespace.getId()); namespace.setDeleted(true); namespace.setDataChangeLastModifiedBy(operator); auditService.audit(Namespace.class.getSimpleName(), namespace.getId(), Audit.OP.DELETE, operator); Namespace deleted = namespaceRepository.save(namespace); //Publish release message to do some clean up in config service, such as updating the cache messageSender.sendMessage(ReleaseMessageKeyGenerator.generate(appId, clusterName, namespaceName), Topics.APOLLO_RELEASE_TOPIC); return deleted; } @Transactional public Namespace save(Namespace entity) { if (!isNamespaceUnique(entity.getAppId(), entity.getClusterName(), entity.getNamespaceName())) { throw new ServiceException("namespace not unique"); } entity.setId(0);//protection Namespace namespace = namespaceRepository.save(entity); auditService.audit(Namespace.class.getSimpleName(), namespace.getId(), Audit.OP.INSERT, namespace.getDataChangeCreatedBy()); return namespace; } @Transactional public Namespace update(Namespace namespace) { Namespace managedNamespace = namespaceRepository.findByAppIdAndClusterNameAndNamespaceName( namespace.getAppId(), namespace.getClusterName(), namespace.getNamespaceName()); BeanUtils.copyEntityProperties(namespace, managedNamespace); managedNamespace = namespaceRepository.save(managedNamespace); auditService.audit(Namespace.class.getSimpleName(), managedNamespace.getId(), Audit.OP.UPDATE, managedNamespace.getDataChangeLastModifiedBy()); return managedNamespace; } @Transactional public void instanceOfAppNamespaces(String appId, String clusterName, String createBy) { List<AppNamespace> appNamespaces = appNamespaceService.findByAppId(appId); for (AppNamespace appNamespace : appNamespaces) { Namespace ns = new Namespace(); ns.setAppId(appId); ns.setClusterName(clusterName); ns.setNamespaceName(appNamespace.getName()); ns.setDataChangeCreatedBy(createBy); ns.setDataChangeLastModifiedBy(createBy); namespaceRepository.save(ns); auditService.audit(Namespace.class.getSimpleName(), ns.getId(), Audit.OP.INSERT, createBy); } } public Map<String, Boolean> namespacePublishInfo(String appId) { List<Cluster> clusters = clusterService.findParentClusters(appId); if (CollectionUtils.isEmpty(clusters)) { throw new BadRequestException("app not exist"); } Map<String, Boolean> clusterHasNotPublishedItems = Maps.newHashMap(); for (Cluster cluster : clusters) { String clusterName = cluster.getName(); List<Namespace> namespaces = findNamespaces(appId, clusterName); for (Namespace namespace : namespaces) { boolean isNamespaceNotPublished = isNamespaceNotPublished(namespace); if (isNamespaceNotPublished) { clusterHasNotPublishedItems.put(clusterName, true); break; } } clusterHasNotPublishedItems.putIfAbsent(clusterName, false); } return clusterHasNotPublishedItems; } private boolean isNamespaceNotPublished(Namespace namespace) { Release latestRelease = releaseService.findLatestActiveRelease(namespace); long namespaceId = namespace.getId(); if (latestRelease == null) { Item lastItem = itemService.findLastOne(namespaceId); return lastItem != null; } Date lastPublishTime = latestRelease.getDataChangeLastModifiedTime(); List<Item> itemsModifiedAfterLastPublish = itemService.findItemsModifiedAfterDate(namespaceId, lastPublishTime); if (CollectionUtils.isEmpty(itemsModifiedAfterLastPublish)) { return false; } Map<String, String> publishedConfiguration = GSON.fromJson(latestRelease.getConfigurations(), GsonType.CONFIG); for (Item item : itemsModifiedAfterLastPublish) { if (!Objects.equals(item.getValue(), publishedConfiguration.get(item.getKey()))) { return true; } } return false; } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-core/src/main/java/com/ctrip/framework/apollo/core/signature/Signature.java
package com.ctrip.framework.apollo.core.signature; import com.google.common.collect.Maps; import com.google.common.net.HttpHeaders; import java.net.MalformedURLException; import java.net.URL; import java.util.Map; /** * @author nisiyong */ public class Signature { /** * Authorization=Apollo {appId}:{sign} */ private static final String AUTHORIZATION_FORMAT = "Apollo %s:%s"; private static final String DELIMITER = "\n"; public static final String HTTP_HEADER_TIMESTAMP = "Timestamp"; public static String signature(String timestamp, String pathWithQuery, String secret) { String stringToSign = timestamp + DELIMITER + pathWithQuery; return HmacSha1Utils.signString(stringToSign, secret); } public static Map<String, String> buildHttpHeaders(String url, String appId, String secret) { long currentTimeMillis = System.currentTimeMillis(); String timestamp = String.valueOf(currentTimeMillis); String pathWithQuery = url2PathWithQuery(url); String signature = signature(timestamp, pathWithQuery, secret); Map<String, String> headers = Maps.newHashMap(); headers.put(HttpHeaders.AUTHORIZATION, String.format(AUTHORIZATION_FORMAT, appId, signature)); headers.put(HTTP_HEADER_TIMESTAMP, timestamp); return headers; } private static String url2PathWithQuery(String urlString) { try { URL url = new URL(urlString); String path = url.getPath(); String query = url.getQuery(); String pathWithQuery = path; if (query != null && query.length() > 0) { pathWithQuery += "?" + query; } return pathWithQuery; } catch (MalformedURLException e) { throw new IllegalArgumentException("Invalid url pattern: " + urlString, e); } } }
package com.ctrip.framework.apollo.core.signature; import com.google.common.collect.Maps; import com.google.common.net.HttpHeaders; import java.net.MalformedURLException; import java.net.URL; import java.util.Map; /** * @author nisiyong */ public class Signature { /** * Authorization=Apollo {appId}:{sign} */ private static final String AUTHORIZATION_FORMAT = "Apollo %s:%s"; private static final String DELIMITER = "\n"; public static final String HTTP_HEADER_TIMESTAMP = "Timestamp"; public static String signature(String timestamp, String pathWithQuery, String secret) { String stringToSign = timestamp + DELIMITER + pathWithQuery; return HmacSha1Utils.signString(stringToSign, secret); } public static Map<String, String> buildHttpHeaders(String url, String appId, String secret) { long currentTimeMillis = System.currentTimeMillis(); String timestamp = String.valueOf(currentTimeMillis); String pathWithQuery = url2PathWithQuery(url); String signature = signature(timestamp, pathWithQuery, secret); Map<String, String> headers = Maps.newHashMap(); headers.put(HttpHeaders.AUTHORIZATION, String.format(AUTHORIZATION_FORMAT, appId, signature)); headers.put(HTTP_HEADER_TIMESTAMP, timestamp); return headers; } private static String url2PathWithQuery(String urlString) { try { URL url = new URL(urlString); String path = url.getPath(); String query = url.getQuery(); String pathWithQuery = path; if (query != null && query.length() > 0) { pathWithQuery += "?" + query; } return pathWithQuery; } catch (MalformedURLException e) { throw new IllegalArgumentException("Invalid url pattern: " + urlString, e); } } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/test/resources/yaml/case1.yaml
root: key1: "someValue" key2: 100 key3: key4: key5: '(%sender%) %message%' key6: '* %sender% %message%' # commented: "xxx" list: - 'item 1' - 'item 2' intList: - 100 - 200 listOfMap: - key: '#mychannel' value: '' - key: '#myprivatechannel' value: 'mypassword' listOfList: - - 'a1' - 'a2' - - 'b1' - 'b2' listOfList2: [ ['a1', 'a2'], ['b1', 'b2'] ]
root: key1: "someValue" key2: 100 key3: key4: key5: '(%sender%) %message%' key6: '* %sender% %message%' # commented: "xxx" list: - 'item 1' - 'item 2' intList: - 100 - 200 listOfMap: - key: '#mychannel' value: '' - key: '#myprivatechannel' value: 'mypassword' listOfList: - - 'a1' - 'a2' - - 'b1' - 'b2' listOfList2: [ ['a1', 'a2'], ['b1', 'b2'] ]
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./scripts/apollo-on-kubernetes/apollo-config-server/Dockerfile
# Dockerfile for apollo-config-server # Build with: # docker build -t apollo-config-server:v1.0.0 . FROM openjdk:8-jre-alpine3.8 RUN \ echo "http://mirrors.aliyun.com/alpine/v3.8/main" > /etc/apk/repositories && \ echo "http://mirrors.aliyun.com/alpine/v3.8/community" >> /etc/apk/repositories && \ apk update upgrade && \ apk add --no-cache procps curl bash tzdata && \ ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ echo "Asia/Shanghai" > /etc/timezone && \ mkdir -p /apollo-config-server ADD . /apollo-config-server/ ENV APOLLO_CONFIG_SERVICE_NAME="service-apollo-config-server.sre" EXPOSE 8080 CMD ["/apollo-config-server/scripts/startup-kubernetes.sh"]
# Dockerfile for apollo-config-server # Build with: # docker build -t apollo-config-server:v1.0.0 . FROM openjdk:8-jre-alpine3.8 RUN \ echo "http://mirrors.aliyun.com/alpine/v3.8/main" > /etc/apk/repositories && \ echo "http://mirrors.aliyun.com/alpine/v3.8/community" >> /etc/apk/repositories && \ apk update upgrade && \ apk add --no-cache procps curl bash tzdata && \ ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ echo "Asia/Shanghai" > /etc/timezone && \ mkdir -p /apollo-config-server ADD . /apollo-config-server/ ENV APOLLO_CONFIG_SERVICE_NAME="service-apollo-config-server.sre" EXPOSE 8080 CMD ["/apollo-config-server/scripts/startup-kubernetes.sh"]
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-common/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/maven-v4_0_0.xsd"> <parent> <groupId>com.ctrip.framework.apollo</groupId> <artifactId>apollo</artifactId> <version>${revision}</version> <relativePath>../pom.xml</relativePath> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>apollo-common</artifactId> <name>Apollo Common</name> <properties> <github.path>${project.artifactId}</github.path> </properties> <dependencies> <dependency> <groupId>com.ctrip.framework.apollo</groupId> <artifactId>apollo-core</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-commons</artifactId> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <exclusions> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> </exclusions> </dependency> <!-- logback dependencies--> <dependency> <groupId>org.codehaus.janino</groupId> <artifactId>janino</artifactId> </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> </dependency> <!-- Micrometer core dependecy --> <dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-core</artifactId> </dependency> <dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-registry-prometheus</artifactId> </dependency> </dependencies> </project>
<?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/maven-v4_0_0.xsd"> <parent> <groupId>com.ctrip.framework.apollo</groupId> <artifactId>apollo</artifactId> <version>${revision}</version> <relativePath>../pom.xml</relativePath> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>apollo-common</artifactId> <name>Apollo Common</name> <properties> <github.path>${project.artifactId}</github.path> </properties> <dependencies> <dependency> <groupId>com.ctrip.framework.apollo</groupId> <artifactId>apollo-core</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-commons</artifactId> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <exclusions> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> </exclusions> </dependency> <!-- logback dependencies--> <dependency> <groupId>org.codehaus.janino</groupId> <artifactId>janino</artifactId> </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> </dependency> <!-- Micrometer core dependecy --> <dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-core</artifactId> </dependency> <dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-registry-prometheus</artifactId> </dependency> </dependencies> </project>
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/App.java
package com.ctrip.framework.apollo.common.entity; import com.ctrip.framework.apollo.common.utils.InputValidator; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Pattern; import org.hibernate.annotations.SQLDelete; import org.hibernate.annotations.Where; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; @Entity @Table(name = "App") @SQLDelete(sql = "Update App set isDeleted = 1 where id = ?") @Where(clause = "isDeleted = 0") public class App extends BaseEntity { @NotBlank(message = "Name cannot be blank") @Column(name = "Name", nullable = false) private String name; @NotBlank(message = "AppId cannot be blank") @Pattern( regexp = InputValidator.CLUSTER_NAMESPACE_VALIDATOR, message = InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE ) @Column(name = "AppId", nullable = false) private String appId; @Column(name = "OrgId", nullable = false) private String orgId; @Column(name = "OrgName", nullable = false) private String orgName; @NotBlank(message = "OwnerName cannot be blank") @Column(name = "OwnerName", nullable = false) private String ownerName; @NotBlank(message = "OwnerEmail cannot be blank") @Column(name = "OwnerEmail", nullable = false) private String ownerEmail; public String getAppId() { return appId; } public String getName() { return name; } public String getOrgId() { return orgId; } public String getOrgName() { return orgName; } public String getOwnerEmail() { return ownerEmail; } public String getOwnerName() { return ownerName; } public void setAppId(String appId) { this.appId = appId; } public void setName(String name) { this.name = name; } public void setOrgId(String orgId) { this.orgId = orgId; } public void setOrgName(String orgName) { this.orgName = orgName; } public void setOwnerEmail(String ownerEmail) { this.ownerEmail = ownerEmail; } public void setOwnerName(String ownerName) { this.ownerName = ownerName; } public String toString() { return toStringHelper().add("name", name).add("appId", appId) .add("orgId", orgId) .add("orgName", orgName) .add("ownerName", ownerName) .add("ownerEmail", ownerEmail).toString(); } public static class Builder { public Builder() { } private App app = new App(); public Builder name(String name) { app.setName(name); return this; } public Builder appId(String appId) { app.setAppId(appId); return this; } public Builder orgId(String orgId) { app.setOrgId(orgId); return this; } public Builder orgName(String orgName) { app.setOrgName(orgName); return this; } public Builder ownerName(String ownerName) { app.setOwnerName(ownerName); return this; } public Builder ownerEmail(String ownerEmail) { app.setOwnerEmail(ownerEmail); return this; } public App build() { return app; } } public static Builder builder() { return new Builder(); } }
package com.ctrip.framework.apollo.common.entity; import com.ctrip.framework.apollo.common.utils.InputValidator; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Pattern; import org.hibernate.annotations.SQLDelete; import org.hibernate.annotations.Where; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; @Entity @Table(name = "App") @SQLDelete(sql = "Update App set isDeleted = 1 where id = ?") @Where(clause = "isDeleted = 0") public class App extends BaseEntity { @NotBlank(message = "Name cannot be blank") @Column(name = "Name", nullable = false) private String name; @NotBlank(message = "AppId cannot be blank") @Pattern( regexp = InputValidator.CLUSTER_NAMESPACE_VALIDATOR, message = InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE ) @Column(name = "AppId", nullable = false) private String appId; @Column(name = "OrgId", nullable = false) private String orgId; @Column(name = "OrgName", nullable = false) private String orgName; @NotBlank(message = "OwnerName cannot be blank") @Column(name = "OwnerName", nullable = false) private String ownerName; @NotBlank(message = "OwnerEmail cannot be blank") @Column(name = "OwnerEmail", nullable = false) private String ownerEmail; public String getAppId() { return appId; } public String getName() { return name; } public String getOrgId() { return orgId; } public String getOrgName() { return orgName; } public String getOwnerEmail() { return ownerEmail; } public String getOwnerName() { return ownerName; } public void setAppId(String appId) { this.appId = appId; } public void setName(String name) { this.name = name; } public void setOrgId(String orgId) { this.orgId = orgId; } public void setOrgName(String orgName) { this.orgName = orgName; } public void setOwnerEmail(String ownerEmail) { this.ownerEmail = ownerEmail; } public void setOwnerName(String ownerName) { this.ownerName = ownerName; } public String toString() { return toStringHelper().add("name", name).add("appId", appId) .add("orgId", orgId) .add("orgName", orgName) .add("ownerName", ownerName) .add("ownerEmail", ownerEmail).toString(); } public static class Builder { public Builder() { } private App app = new App(); public Builder name(String name) { app.setName(name); return this; } public Builder appId(String appId) { app.setAppId(appId); return this; } public Builder orgId(String orgId) { app.setOrgId(orgId); return this; } public Builder orgName(String orgName) { app.setOrgName(orgName); return this; } public Builder ownerName(String ownerName) { app.setOwnerName(ownerName); return this; } public Builder ownerEmail(String ownerEmail) { app.setOwnerEmail(ownerEmail); return this; } public App build() { return app; } } public static Builder builder() { return new Builder(); } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-core/src/test/java/com/ctrip/framework/apollo/core/signature/HmacSha1UtilsTest.java
package com.ctrip.framework.apollo.core.signature; import static org.junit.Assert.assertEquals; import org.junit.Test; /** * @author nisiyong */ public class HmacSha1UtilsTest { @Test public void testSignString() { String stringToSign = "1576478257344\n/configs/100004458/default/application?ip=10.0.0.1"; String accessKeySecret = "df23df3f59884980844ff3dada30fa97"; String actualSignature = HmacSha1Utils.signString(stringToSign, accessKeySecret); String expectedSignature = "EoKyziXvKqzHgwx+ijDJwgVTDgE="; assertEquals(expectedSignature, actualSignature); } }
package com.ctrip.framework.apollo.core.signature; import static org.junit.Assert.assertEquals; import org.junit.Test; /** * @author nisiyong */ public class HmacSha1UtilsTest { @Test public void testSignString() { String stringToSign = "1576478257344\n/configs/100004458/default/application?ip=10.0.0.1"; String accessKeySecret = "df23df3f59884980844ff3dada30fa97"; String actualSignature = HmacSha1Utils.signString(stringToSign, accessKeySecret); String expectedSignature = "EoKyziXvKqzHgwx+ijDJwgVTDgE="; assertEquals(expectedSignature, actualSignature); } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-client/src/main/java/com/ctrip/framework/apollo/internals/LocalFileConfigRepository.java
package com.ctrip.framework.apollo.internals; import com.ctrip.framework.apollo.enums.ConfigSourceType; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Properties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.ctrip.framework.apollo.build.ApolloInjector; import com.ctrip.framework.apollo.core.ConfigConsts; import com.ctrip.framework.apollo.core.utils.ClassLoaderUtil; import com.ctrip.framework.apollo.exceptions.ApolloConfigException; import com.ctrip.framework.apollo.tracer.Tracer; import com.ctrip.framework.apollo.tracer.spi.Transaction; import com.ctrip.framework.apollo.util.ConfigUtil; import com.ctrip.framework.apollo.util.ExceptionUtil; import com.google.common.base.Joiner; import com.google.common.base.Preconditions; /** * @author Jason Song([email protected]) */ public class LocalFileConfigRepository extends AbstractConfigRepository implements RepositoryChangeListener { private static final Logger logger = LoggerFactory.getLogger(LocalFileConfigRepository.class); private static final String CONFIG_DIR = "/config-cache"; private final String m_namespace; private File m_baseDir; private final ConfigUtil m_configUtil; private volatile Properties m_fileProperties; private volatile ConfigRepository m_upstream; private volatile ConfigSourceType m_sourceType = ConfigSourceType.LOCAL; /** * Constructor. * * @param namespace the namespace */ public LocalFileConfigRepository(String namespace) { this(namespace, null); } public LocalFileConfigRepository(String namespace, ConfigRepository upstream) { m_namespace = namespace; m_configUtil = ApolloInjector.getInstance(ConfigUtil.class); this.setLocalCacheDir(findLocalCacheDir(), false); this.setUpstreamRepository(upstream); this.trySync(); } void setLocalCacheDir(File baseDir, boolean syncImmediately) { m_baseDir = baseDir; this.checkLocalConfigCacheDir(m_baseDir); if (syncImmediately) { this.trySync(); } } private File findLocalCacheDir() { try { String defaultCacheDir = m_configUtil.getDefaultLocalCacheDir(); Path path = Paths.get(defaultCacheDir); if (!Files.exists(path)) { Files.createDirectories(path); } if (Files.exists(path) && Files.isWritable(path)) { return new File(defaultCacheDir, CONFIG_DIR); } } catch (Throwable ex) { //ignore } return new File(ClassLoaderUtil.getClassPath(), CONFIG_DIR); } @Override public Properties getConfig() { if (m_fileProperties == null) { sync(); } Properties result = propertiesFactory.getPropertiesInstance(); result.putAll(m_fileProperties); return result; } @Override public void setUpstreamRepository(ConfigRepository upstreamConfigRepository) { if (upstreamConfigRepository == null) { return; } //clear previous listener if (m_upstream != null) { m_upstream.removeChangeListener(this); } m_upstream = upstreamConfigRepository; trySyncFromUpstream(); upstreamConfigRepository.addChangeListener(this); } @Override public ConfigSourceType getSourceType() { return m_sourceType; } @Override public void onRepositoryChange(String namespace, Properties newProperties) { if (newProperties.equals(m_fileProperties)) { return; } Properties newFileProperties = propertiesFactory.getPropertiesInstance(); newFileProperties.putAll(newProperties); updateFileProperties(newFileProperties, m_upstream.getSourceType()); this.fireRepositoryChange(namespace, newProperties); } @Override protected void sync() { //sync with upstream immediately boolean syncFromUpstreamResultSuccess = trySyncFromUpstream(); if (syncFromUpstreamResultSuccess) { return; } Transaction transaction = Tracer.newTransaction("Apollo.ConfigService", "syncLocalConfig"); Throwable exception = null; try { transaction.addData("Basedir", m_baseDir.getAbsolutePath()); m_fileProperties = this.loadFromLocalCacheFile(m_baseDir, m_namespace); m_sourceType = ConfigSourceType.LOCAL; transaction.setStatus(Transaction.SUCCESS); } catch (Throwable ex) { Tracer.logEvent("ApolloConfigException", ExceptionUtil.getDetailMessage(ex)); transaction.setStatus(ex); exception = ex; //ignore } finally { transaction.complete(); } if (m_fileProperties == null) { m_sourceType = ConfigSourceType.NONE; throw new ApolloConfigException( "Load config from local config failed!", exception); } } private boolean trySyncFromUpstream() { if (m_upstream == null) { return false; } try { updateFileProperties(m_upstream.getConfig(), m_upstream.getSourceType()); return true; } catch (Throwable ex) { Tracer.logError(ex); logger .warn("Sync config from upstream repository {} failed, reason: {}", m_upstream.getClass(), ExceptionUtil.getDetailMessage(ex)); } return false; } private synchronized void updateFileProperties(Properties newProperties, ConfigSourceType sourceType) { this.m_sourceType = sourceType; if (newProperties.equals(m_fileProperties)) { return; } this.m_fileProperties = newProperties; persistLocalCacheFile(m_baseDir, m_namespace); } private Properties loadFromLocalCacheFile(File baseDir, String namespace) throws IOException { Preconditions.checkNotNull(baseDir, "Basedir cannot be null"); File file = assembleLocalCacheFile(baseDir, namespace); Properties properties = null; if (file.isFile() && file.canRead()) { InputStream in = null; try { in = new FileInputStream(file); properties = propertiesFactory.getPropertiesInstance(); properties.load(in); logger.debug("Loading local config file {} successfully!", file.getAbsolutePath()); } catch (IOException ex) { Tracer.logError(ex); throw new ApolloConfigException(String .format("Loading config from local cache file %s failed", file.getAbsolutePath()), ex); } finally { try { if (in != null) { in.close(); } } catch (IOException ex) { // ignore } } } else { throw new ApolloConfigException( String.format("Cannot read from local cache file %s", file.getAbsolutePath())); } return properties; } void persistLocalCacheFile(File baseDir, String namespace) { if (baseDir == null) { return; } File file = assembleLocalCacheFile(baseDir, namespace); OutputStream out = null; Transaction transaction = Tracer.newTransaction("Apollo.ConfigService", "persistLocalConfigFile"); transaction.addData("LocalConfigFile", file.getAbsolutePath()); try { out = new FileOutputStream(file); m_fileProperties.store(out, "Persisted by DefaultConfig"); transaction.setStatus(Transaction.SUCCESS); } catch (IOException ex) { ApolloConfigException exception = new ApolloConfigException( String.format("Persist local cache file %s failed", file.getAbsolutePath()), ex); Tracer.logError(exception); transaction.setStatus(exception); logger.warn("Persist local cache file {} failed, reason: {}.", file.getAbsolutePath(), ExceptionUtil.getDetailMessage(ex)); } finally { if (out != null) { try { out.close(); } catch (IOException ex) { //ignore } } transaction.complete(); } } private void checkLocalConfigCacheDir(File baseDir) { if (baseDir.exists()) { return; } Transaction transaction = Tracer.newTransaction("Apollo.ConfigService", "createLocalConfigDir"); transaction.addData("BaseDir", baseDir.getAbsolutePath()); try { Files.createDirectory(baseDir.toPath()); transaction.setStatus(Transaction.SUCCESS); } catch (IOException ex) { ApolloConfigException exception = new ApolloConfigException( String.format("Create local config directory %s failed", baseDir.getAbsolutePath()), ex); Tracer.logError(exception); transaction.setStatus(exception); logger.warn( "Unable to create local config cache directory {}, reason: {}. Will not able to cache config file.", baseDir.getAbsolutePath(), ExceptionUtil.getDetailMessage(ex)); } finally { transaction.complete(); } } File assembleLocalCacheFile(File baseDir, String namespace) { String fileName = String.format("%s.properties", Joiner.on(ConfigConsts.CLUSTER_NAMESPACE_SEPARATOR) .join(m_configUtil.getAppId(), m_configUtil.getCluster(), namespace)); return new File(baseDir, fileName); } }
package com.ctrip.framework.apollo.internals; import com.ctrip.framework.apollo.enums.ConfigSourceType; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Properties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.ctrip.framework.apollo.build.ApolloInjector; import com.ctrip.framework.apollo.core.ConfigConsts; import com.ctrip.framework.apollo.core.utils.ClassLoaderUtil; import com.ctrip.framework.apollo.exceptions.ApolloConfigException; import com.ctrip.framework.apollo.tracer.Tracer; import com.ctrip.framework.apollo.tracer.spi.Transaction; import com.ctrip.framework.apollo.util.ConfigUtil; import com.ctrip.framework.apollo.util.ExceptionUtil; import com.google.common.base.Joiner; import com.google.common.base.Preconditions; /** * @author Jason Song([email protected]) */ public class LocalFileConfigRepository extends AbstractConfigRepository implements RepositoryChangeListener { private static final Logger logger = LoggerFactory.getLogger(LocalFileConfigRepository.class); private static final String CONFIG_DIR = "/config-cache"; private final String m_namespace; private File m_baseDir; private final ConfigUtil m_configUtil; private volatile Properties m_fileProperties; private volatile ConfigRepository m_upstream; private volatile ConfigSourceType m_sourceType = ConfigSourceType.LOCAL; /** * Constructor. * * @param namespace the namespace */ public LocalFileConfigRepository(String namespace) { this(namespace, null); } public LocalFileConfigRepository(String namespace, ConfigRepository upstream) { m_namespace = namespace; m_configUtil = ApolloInjector.getInstance(ConfigUtil.class); this.setLocalCacheDir(findLocalCacheDir(), false); this.setUpstreamRepository(upstream); this.trySync(); } void setLocalCacheDir(File baseDir, boolean syncImmediately) { m_baseDir = baseDir; this.checkLocalConfigCacheDir(m_baseDir); if (syncImmediately) { this.trySync(); } } private File findLocalCacheDir() { try { String defaultCacheDir = m_configUtil.getDefaultLocalCacheDir(); Path path = Paths.get(defaultCacheDir); if (!Files.exists(path)) { Files.createDirectories(path); } if (Files.exists(path) && Files.isWritable(path)) { return new File(defaultCacheDir, CONFIG_DIR); } } catch (Throwable ex) { //ignore } return new File(ClassLoaderUtil.getClassPath(), CONFIG_DIR); } @Override public Properties getConfig() { if (m_fileProperties == null) { sync(); } Properties result = propertiesFactory.getPropertiesInstance(); result.putAll(m_fileProperties); return result; } @Override public void setUpstreamRepository(ConfigRepository upstreamConfigRepository) { if (upstreamConfigRepository == null) { return; } //clear previous listener if (m_upstream != null) { m_upstream.removeChangeListener(this); } m_upstream = upstreamConfigRepository; trySyncFromUpstream(); upstreamConfigRepository.addChangeListener(this); } @Override public ConfigSourceType getSourceType() { return m_sourceType; } @Override public void onRepositoryChange(String namespace, Properties newProperties) { if (newProperties.equals(m_fileProperties)) { return; } Properties newFileProperties = propertiesFactory.getPropertiesInstance(); newFileProperties.putAll(newProperties); updateFileProperties(newFileProperties, m_upstream.getSourceType()); this.fireRepositoryChange(namespace, newProperties); } @Override protected void sync() { //sync with upstream immediately boolean syncFromUpstreamResultSuccess = trySyncFromUpstream(); if (syncFromUpstreamResultSuccess) { return; } Transaction transaction = Tracer.newTransaction("Apollo.ConfigService", "syncLocalConfig"); Throwable exception = null; try { transaction.addData("Basedir", m_baseDir.getAbsolutePath()); m_fileProperties = this.loadFromLocalCacheFile(m_baseDir, m_namespace); m_sourceType = ConfigSourceType.LOCAL; transaction.setStatus(Transaction.SUCCESS); } catch (Throwable ex) { Tracer.logEvent("ApolloConfigException", ExceptionUtil.getDetailMessage(ex)); transaction.setStatus(ex); exception = ex; //ignore } finally { transaction.complete(); } if (m_fileProperties == null) { m_sourceType = ConfigSourceType.NONE; throw new ApolloConfigException( "Load config from local config failed!", exception); } } private boolean trySyncFromUpstream() { if (m_upstream == null) { return false; } try { updateFileProperties(m_upstream.getConfig(), m_upstream.getSourceType()); return true; } catch (Throwable ex) { Tracer.logError(ex); logger .warn("Sync config from upstream repository {} failed, reason: {}", m_upstream.getClass(), ExceptionUtil.getDetailMessage(ex)); } return false; } private synchronized void updateFileProperties(Properties newProperties, ConfigSourceType sourceType) { this.m_sourceType = sourceType; if (newProperties.equals(m_fileProperties)) { return; } this.m_fileProperties = newProperties; persistLocalCacheFile(m_baseDir, m_namespace); } private Properties loadFromLocalCacheFile(File baseDir, String namespace) throws IOException { Preconditions.checkNotNull(baseDir, "Basedir cannot be null"); File file = assembleLocalCacheFile(baseDir, namespace); Properties properties = null; if (file.isFile() && file.canRead()) { InputStream in = null; try { in = new FileInputStream(file); properties = propertiesFactory.getPropertiesInstance(); properties.load(in); logger.debug("Loading local config file {} successfully!", file.getAbsolutePath()); } catch (IOException ex) { Tracer.logError(ex); throw new ApolloConfigException(String .format("Loading config from local cache file %s failed", file.getAbsolutePath()), ex); } finally { try { if (in != null) { in.close(); } } catch (IOException ex) { // ignore } } } else { throw new ApolloConfigException( String.format("Cannot read from local cache file %s", file.getAbsolutePath())); } return properties; } void persistLocalCacheFile(File baseDir, String namespace) { if (baseDir == null) { return; } File file = assembleLocalCacheFile(baseDir, namespace); OutputStream out = null; Transaction transaction = Tracer.newTransaction("Apollo.ConfigService", "persistLocalConfigFile"); transaction.addData("LocalConfigFile", file.getAbsolutePath()); try { out = new FileOutputStream(file); m_fileProperties.store(out, "Persisted by DefaultConfig"); transaction.setStatus(Transaction.SUCCESS); } catch (IOException ex) { ApolloConfigException exception = new ApolloConfigException( String.format("Persist local cache file %s failed", file.getAbsolutePath()), ex); Tracer.logError(exception); transaction.setStatus(exception); logger.warn("Persist local cache file {} failed, reason: {}.", file.getAbsolutePath(), ExceptionUtil.getDetailMessage(ex)); } finally { if (out != null) { try { out.close(); } catch (IOException ex) { //ignore } } transaction.complete(); } } private void checkLocalConfigCacheDir(File baseDir) { if (baseDir.exists()) { return; } Transaction transaction = Tracer.newTransaction("Apollo.ConfigService", "createLocalConfigDir"); transaction.addData("BaseDir", baseDir.getAbsolutePath()); try { Files.createDirectory(baseDir.toPath()); transaction.setStatus(Transaction.SUCCESS); } catch (IOException ex) { ApolloConfigException exception = new ApolloConfigException( String.format("Create local config directory %s failed", baseDir.getAbsolutePath()), ex); Tracer.logError(exception); transaction.setStatus(exception); logger.warn( "Unable to create local config cache directory {}, reason: {}. Will not able to cache config file.", baseDir.getAbsolutePath(), ExceptionUtil.getDetailMessage(ex)); } finally { transaction.complete(); } } File assembleLocalCacheFile(File baseDir, String namespace) { String fileName = String.format("%s.properties", Joiner.on(ConfigConsts.CLUSTER_NAMESPACE_SEPARATOR) .join(m_configUtil.getAppId(), m_configUtil.getCluster(), namespace)); return new File(baseDir, fileName); } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/resources/application-ctrip.yml
ctrip: appid: 100003173 email: send: code: 37030033 template: id: 37030033 survival: duration: 5
ctrip: appid: 100003173 email: send: code: 37030033 template: id: 37030033 survival: duration: 5
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/resources/static/scripts/directive/item-modal-directive.js
directive_module.directive('itemmodal', itemModalDirective); function itemModalDirective($translate, toastr, $sce, AppUtil, EventManager, ConfigService) { return { restrict: 'E', templateUrl: AppUtil.prefixPath() + '/views/component/item-modal.html', transclude: true, replace: true, scope: { appId: '=', env: '=', cluster: '=', toOperationNamespace: '=', item: '=' }, link: function (scope) { var TABLE_VIEW_OPER_TYPE = { CREATE: 'create', UPDATE: 'update' }; scope.doItem = doItem; scope.collectSelectedClusters = collectSelectedClusters; scope.showHiddenChars = showHiddenChars; $('#itemModal').on('show.bs.modal', function (e) { scope.showHiddenCharsContext = false; scope.hiddenCharCounter = 0; scope.valueWithHiddenChars = $sce.trustAsHtml(''); }); $("#valueEditor").textareafullscreen(); function doItem() { if (!scope.item.value) { scope.item.value = ""; } if (scope.item.tableViewOperType == TABLE_VIEW_OPER_TYPE.CREATE) { //check key unique var hasRepeatKey = false; scope.toOperationNamespace.items.forEach(function (item) { if (!item.isDeleted && scope.item.key == item.item.key) { toastr.error($translate.instant('ItemModal.KeyExists', { key: scope.item.key })); hasRepeatKey = true; } }); if (hasRepeatKey) { return; } scope.item.addItemBtnDisabled = true; if (scope.toOperationNamespace.isBranch) { ConfigService.create_item(scope.appId, scope.env, scope.toOperationNamespace.baseInfo.clusterName, scope.toOperationNamespace.baseInfo.namespaceName, scope.item).then( function (result) { toastr.success($translate.instant('ItemModal.AddedTips')); scope.item.addItemBtnDisabled = false; AppUtil.hideModal('#itemModal'); EventManager.emit(EventManager.EventType.REFRESH_NAMESPACE, { namespace: scope.toOperationNamespace }); }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('ItemModal.AddFailed')); scope.item.addItemBtnDisabled = false; }); } else { if (selectedClusters.length == 0) { toastr.error($translate.instant('ItemModal.PleaseChooseCluster')); scope.item.addItemBtnDisabled = false; return; } selectedClusters.forEach(function (cluster) { ConfigService.create_item(scope.appId, cluster.env, cluster.name, scope.toOperationNamespace.baseInfo.namespaceName, scope.item).then( function (result) { scope.item.addItemBtnDisabled = false; AppUtil.hideModal('#itemModal'); toastr.success(cluster.env + " , " + scope.item.key, $translate.instant('ItemModal.AddedTips')); if (cluster.env == scope.env && cluster.name == scope.cluster) { EventManager.emit(EventManager.EventType.REFRESH_NAMESPACE, { namespace: scope.toOperationNamespace }); } }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('ItemModal.AddFailed')); scope.item.addItemBtnDisabled = false; }); }); } } else { if (!scope.item.comment) { scope.item.comment = ""; } ConfigService.update_item(scope.appId, scope.env, scope.toOperationNamespace.baseInfo.clusterName, scope.toOperationNamespace.baseInfo.namespaceName, scope.item).then( function (result) { EventManager.emit(EventManager.EventType.REFRESH_NAMESPACE, { namespace: scope.toOperationNamespace }); AppUtil.hideModal('#itemModal'); toastr.success($translate.instant('ItemModal.ModifiedTips')); }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('ItemModal.ModifyFailed')); }); } } var selectedClusters = []; function collectSelectedClusters(data) { selectedClusters = data; } function showHiddenChars() { var value = scope.item.value; if (!value) { return; } var hiddenCharCounter = 0, valueWithHiddenChars = _.escape(value); for (var i = 0; i < value.length; i++) { var c = value[i]; if (isHiddenChar(c)) { valueWithHiddenChars = valueWithHiddenChars.replace(c, viewHiddenChar); hiddenCharCounter++; } } scope.showHiddenCharsContext = true; scope.hiddenCharCounter = hiddenCharCounter; scope.valueWithHiddenChars = $sce.trustAsHtml(valueWithHiddenChars); } function isHiddenChar(c) { return c == '\t' || c == '\n' || c == ' '; } function viewHiddenChar(c) { if (c == '\t') { return '<mark>#' + $translate.instant('ItemModal.Tabs') + '#</mark>'; } else if (c == '\n') { return '<mark>#' + $translate.instant('ItemModal.NewLine') + '#</mark>'; } else if (c == ' ') { return '<mark>#' + $translate.instant('ItemModal.Space') + '#</mark>'; } } } } }
directive_module.directive('itemmodal', itemModalDirective); function itemModalDirective($translate, toastr, $sce, AppUtil, EventManager, ConfigService) { return { restrict: 'E', templateUrl: AppUtil.prefixPath() + '/views/component/item-modal.html', transclude: true, replace: true, scope: { appId: '=', env: '=', cluster: '=', toOperationNamespace: '=', item: '=' }, link: function (scope) { var TABLE_VIEW_OPER_TYPE = { CREATE: 'create', UPDATE: 'update' }; scope.doItem = doItem; scope.collectSelectedClusters = collectSelectedClusters; scope.showHiddenChars = showHiddenChars; $('#itemModal').on('show.bs.modal', function (e) { scope.showHiddenCharsContext = false; scope.hiddenCharCounter = 0; scope.valueWithHiddenChars = $sce.trustAsHtml(''); }); $("#valueEditor").textareafullscreen(); function doItem() { if (!scope.item.value) { scope.item.value = ""; } if (scope.item.tableViewOperType == TABLE_VIEW_OPER_TYPE.CREATE) { //check key unique var hasRepeatKey = false; scope.toOperationNamespace.items.forEach(function (item) { if (!item.isDeleted && scope.item.key == item.item.key) { toastr.error($translate.instant('ItemModal.KeyExists', { key: scope.item.key })); hasRepeatKey = true; } }); if (hasRepeatKey) { return; } scope.item.addItemBtnDisabled = true; if (scope.toOperationNamespace.isBranch) { ConfigService.create_item(scope.appId, scope.env, scope.toOperationNamespace.baseInfo.clusterName, scope.toOperationNamespace.baseInfo.namespaceName, scope.item).then( function (result) { toastr.success($translate.instant('ItemModal.AddedTips')); scope.item.addItemBtnDisabled = false; AppUtil.hideModal('#itemModal'); EventManager.emit(EventManager.EventType.REFRESH_NAMESPACE, { namespace: scope.toOperationNamespace }); }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('ItemModal.AddFailed')); scope.item.addItemBtnDisabled = false; }); } else { if (selectedClusters.length == 0) { toastr.error($translate.instant('ItemModal.PleaseChooseCluster')); scope.item.addItemBtnDisabled = false; return; } selectedClusters.forEach(function (cluster) { ConfigService.create_item(scope.appId, cluster.env, cluster.name, scope.toOperationNamespace.baseInfo.namespaceName, scope.item).then( function (result) { scope.item.addItemBtnDisabled = false; AppUtil.hideModal('#itemModal'); toastr.success(cluster.env + " , " + scope.item.key, $translate.instant('ItemModal.AddedTips')); if (cluster.env == scope.env && cluster.name == scope.cluster) { EventManager.emit(EventManager.EventType.REFRESH_NAMESPACE, { namespace: scope.toOperationNamespace }); } }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('ItemModal.AddFailed')); scope.item.addItemBtnDisabled = false; }); }); } } else { if (!scope.item.comment) { scope.item.comment = ""; } ConfigService.update_item(scope.appId, scope.env, scope.toOperationNamespace.baseInfo.clusterName, scope.toOperationNamespace.baseInfo.namespaceName, scope.item).then( function (result) { EventManager.emit(EventManager.EventType.REFRESH_NAMESPACE, { namespace: scope.toOperationNamespace }); AppUtil.hideModal('#itemModal'); toastr.success($translate.instant('ItemModal.ModifiedTips')); }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('ItemModal.ModifyFailed')); }); } } var selectedClusters = []; function collectSelectedClusters(data) { selectedClusters = data; } function showHiddenChars() { var value = scope.item.value; if (!value) { return; } var hiddenCharCounter = 0, valueWithHiddenChars = _.escape(value); for (var i = 0; i < value.length; i++) { var c = value[i]; if (isHiddenChar(c)) { valueWithHiddenChars = valueWithHiddenChars.replace(c, viewHiddenChar); hiddenCharCounter++; } } scope.showHiddenCharsContext = true; scope.hiddenCharCounter = hiddenCharCounter; scope.valueWithHiddenChars = $sce.trustAsHtml(valueWithHiddenChars); } function isHiddenChar(c) { return c == '\t' || c == '\n' || c == ' '; } function viewHiddenChar(c) { if (c == '\t') { return '<mark>#' + $translate.instant('ItemModal.Tabs') + '#</mark>'; } else if (c == '\n') { return '<mark>#' + $translate.instant('ItemModal.NewLine') + '#</mark>'; } else if (c == ' ') { return '<mark>#' + $translate.instant('ItemModal.Space') + '#</mark>'; } } } } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/ServiceExceptionTest.java
package com.ctrip.framework.apollo.portal; import com.ctrip.framework.apollo.common.exception.ServiceException; import com.ctrip.framework.apollo.portal.controller.AppController; import com.ctrip.framework.apollo.portal.entity.model.AppModel; import com.ctrip.framework.apollo.portal.service.AppService; import com.google.gson.Gson; import java.nio.charset.Charset; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.LinkedHashMap; import java.util.Map; import org.junit.Assert; import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.springframework.http.HttpStatus; import org.springframework.web.client.HttpServerErrorException; import org.springframework.web.client.HttpStatusCodeException; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; public class ServiceExceptionTest extends AbstractUnitTest { @InjectMocks private AppController appController; @Mock private AppService appService; private static final Gson GSON = new Gson(); @Test public void testAdminServiceException() { String errorMsg = "No available admin service"; String errorCode = "errorCode"; String status = "500"; Map<String, Object> errorAttributes = new LinkedHashMap<>(); errorAttributes.put("status", status); errorAttributes.put("message", errorMsg); errorAttributes.put("timestamp", LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)); errorAttributes.put("exception", ServiceException.class.getName()); errorAttributes.put("errorCode", errorCode); HttpStatusCodeException adminException = new HttpServerErrorException( HttpStatus.INTERNAL_SERVER_ERROR, "admin server error", GSON.toJson(errorAttributes).getBytes(), Charset.defaultCharset() ); when(appService.createAppInLocal(any())).thenThrow(adminException); AppModel app = generateSampleApp(); try { appController.create(app); } catch (HttpStatusCodeException e) { @SuppressWarnings("unchecked") Map<String, String> attr = new Gson().fromJson(e.getResponseBodyAsString(), Map.class); Assert.assertEquals(errorMsg, attr.get("message")); Assert.assertEquals(errorCode, attr.get("errorCode")); Assert.assertEquals(status, attr.get("status")); } } private AppModel generateSampleApp() { AppModel app = new AppModel(); app.setAppId("someAppId"); app.setName("someName"); app.setOrgId("someOrgId"); app.setOrgName("someOrgNam"); app.setOwnerName("someOwner"); return app; } }
package com.ctrip.framework.apollo.portal; import com.ctrip.framework.apollo.common.exception.ServiceException; import com.ctrip.framework.apollo.portal.controller.AppController; import com.ctrip.framework.apollo.portal.entity.model.AppModel; import com.ctrip.framework.apollo.portal.service.AppService; import com.google.gson.Gson; import java.nio.charset.Charset; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.LinkedHashMap; import java.util.Map; import org.junit.Assert; import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.springframework.http.HttpStatus; import org.springframework.web.client.HttpServerErrorException; import org.springframework.web.client.HttpStatusCodeException; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; public class ServiceExceptionTest extends AbstractUnitTest { @InjectMocks private AppController appController; @Mock private AppService appService; private static final Gson GSON = new Gson(); @Test public void testAdminServiceException() { String errorMsg = "No available admin service"; String errorCode = "errorCode"; String status = "500"; Map<String, Object> errorAttributes = new LinkedHashMap<>(); errorAttributes.put("status", status); errorAttributes.put("message", errorMsg); errorAttributes.put("timestamp", LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)); errorAttributes.put("exception", ServiceException.class.getName()); errorAttributes.put("errorCode", errorCode); HttpStatusCodeException adminException = new HttpServerErrorException( HttpStatus.INTERNAL_SERVER_ERROR, "admin server error", GSON.toJson(errorAttributes).getBytes(), Charset.defaultCharset() ); when(appService.createAppInLocal(any())).thenThrow(adminException); AppModel app = generateSampleApp(); try { appController.create(app); } catch (HttpStatusCodeException e) { @SuppressWarnings("unchecked") Map<String, String> attr = new Gson().fromJson(e.getResponseBodyAsString(), Map.class); Assert.assertEquals(errorMsg, attr.get("message")); Assert.assertEquals(errorCode, attr.get("errorCode")); Assert.assertEquals(status, attr.get("status")); } } private AppModel generateSampleApp() { AppModel app = new AppModel(); app.setAppId("someAppId"); app.setName("someName"); app.setOrgId("someOrgId"); app.setOrgName("someOrgNam"); app.setOwnerName("someOwner"); return app; } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/DNSUtil.java
package com.ctrip.framework.apollo.core.utils; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.ArrayList; import java.util.List; public class DNSUtil { public static List<String> resolve(String domainName) throws UnknownHostException { List<String> result = new ArrayList<>(); InetAddress[] addresses = InetAddress.getAllByName(domainName); if (addresses != null) { for (InetAddress addr : addresses) { result.add(addr.getHostAddress()); } } return result; } }
package com.ctrip.framework.apollo.core.utils; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.ArrayList; import java.util.List; public class DNSUtil { public static List<String> resolve(String domainName) throws UnknownHostException { List<String> result = new ArrayList<>(); InetAddress[] addresses = InetAddress.getAllByName(domainName); if (addresses != null) { for (InetAddress addr : addresses) { result.add(addr.getHostAddress()); } } return result; } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-client/src/main/java/com/ctrip/framework/apollo/spi/ConfigFactoryManager.java
package com.ctrip.framework.apollo.spi; /** * @author Jason Song([email protected]) */ public interface ConfigFactoryManager { /** * Get the config factory for the namespace. * * @param namespace the namespace * @return the config factory for this namespace */ ConfigFactory getFactory(String namespace); }
package com.ctrip.framework.apollo.spi; /** * @author Jason Song([email protected]) */ public interface ConfigFactoryManager { /** * Get the config factory for the namespace. * * @param namespace the namespace * @return the config factory for this namespace */ ConfigFactory getFactory(String namespace); }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./scripts/apollo-on-kubernetes/db/config-db-test-alpha/apolloconfigdb.sql
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; # Create Database # ------------------------------------------------------------ CREATE DATABASE IF NOT EXISTS TestAlphaApolloConfigDB DEFAULT CHARACTER SET = utf8mb4; Use TestAlphaApolloConfigDB; # Dump of table app # ------------------------------------------------------------ DROP TABLE IF EXISTS `App`; CREATE TABLE `App` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', `Name` varchar(500) NOT NULL DEFAULT 'default' COMMENT '应用名', `OrgId` varchar(32) NOT NULL DEFAULT 'default' COMMENT '部门Id', `OrgName` varchar(64) NOT NULL DEFAULT 'default' COMMENT '部门名字', `OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName', `OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `AppId` (`AppId`(191)), KEY `DataChange_LastTime` (`DataChange_LastTime`), KEY `IX_Name` (`Name`(191)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用表'; # Dump of table appnamespace # ------------------------------------------------------------ DROP TABLE IF EXISTS `AppNamespace`; CREATE TABLE `AppNamespace` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', `Name` varchar(32) NOT NULL DEFAULT '' COMMENT 'namespace名字,注意,需要全局唯一', `AppId` varchar(64) NOT NULL DEFAULT '' COMMENT 'app id', `Format` varchar(32) NOT NULL DEFAULT 'properties' COMMENT 'namespace的format类型', `IsPublic` bit(1) NOT NULL DEFAULT b'0' COMMENT 'namespace是否为公共', `Comment` varchar(64) NOT NULL DEFAULT '' COMMENT '注释', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT '' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `IX_AppId` (`AppId`), KEY `Name_AppId` (`Name`,`AppId`), KEY `DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用namespace定义'; # Dump of table audit # ------------------------------------------------------------ DROP TABLE IF EXISTS `Audit`; CREATE TABLE `Audit` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `EntityName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '表名', `EntityId` int(10) unsigned DEFAULT NULL COMMENT '记录ID', `OpName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '操作类型', `Comment` varchar(500) DEFAULT NULL COMMENT '备注', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='日志审计表'; # Dump of table cluster # ------------------------------------------------------------ DROP TABLE IF EXISTS `Cluster`; CREATE TABLE `Cluster` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', `Name` varchar(32) NOT NULL DEFAULT '' COMMENT '集群名字', `AppId` varchar(64) NOT NULL DEFAULT '' COMMENT 'App id', `ParentClusterId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父cluster', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT '' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `IX_AppId_Name` (`AppId`,`Name`), KEY `IX_ParentClusterId` (`ParentClusterId`), KEY `DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集群'; # Dump of table commit # ------------------------------------------------------------ DROP TABLE IF EXISTS `Commit`; CREATE TABLE `Commit` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `ChangeSets` longtext NOT NULL COMMENT '修改变更集', `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName', `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName', `Comment` varchar(500) DEFAULT NULL COMMENT '备注', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `DataChange_LastTime` (`DataChange_LastTime`), KEY `AppId` (`AppId`(191)), KEY `ClusterName` (`ClusterName`(191)), KEY `NamespaceName` (`NamespaceName`(191)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='commit 历史表'; # Dump of table grayreleaserule # ------------------------------------------------------------ DROP TABLE IF EXISTS `GrayReleaseRule`; CREATE TABLE `GrayReleaseRule` ( `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID', `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name', `NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name', `BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'branch name', `Rules` varchar(16000) DEFAULT '[]' COMMENT '灰度规则', `ReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '灰度对应的release', `BranchStatus` tinyint(2) DEFAULT '1' COMMENT '灰度分支状态: 0:删除分支,1:正在使用的规则 2:全量发布', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `DataChange_LastTime` (`DataChange_LastTime`), KEY `IX_Namespace` (`AppId`,`ClusterName`,`NamespaceName`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='灰度规则表'; # Dump of table instance # ------------------------------------------------------------ DROP TABLE IF EXISTS `Instance`; CREATE TABLE `Instance` ( `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', `AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID', `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName', `DataCenter` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Data Center Name', `Ip` varchar(32) NOT NULL DEFAULT '' COMMENT 'instance ip', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), UNIQUE KEY `IX_UNIQUE_KEY` (`AppId`,`ClusterName`,`Ip`,`DataCenter`), KEY `IX_IP` (`Ip`), KEY `IX_DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='使用配置的应用实例'; # Dump of table instanceconfig # ------------------------------------------------------------ DROP TABLE IF EXISTS `InstanceConfig`; CREATE TABLE `InstanceConfig` ( `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', `InstanceId` int(11) unsigned DEFAULT NULL COMMENT 'Instance Id', `ConfigAppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Config App Id', `ConfigClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Cluster Name', `ConfigNamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Namespace Name', `ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key', `ReleaseDeliveryTime` timestamp NULL DEFAULT NULL COMMENT '配置获取时间', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), UNIQUE KEY `IX_UNIQUE_KEY` (`InstanceId`,`ConfigAppId`,`ConfigNamespaceName`), KEY `IX_ReleaseKey` (`ReleaseKey`), KEY `IX_DataChange_LastTime` (`DataChange_LastTime`), KEY `IX_Valid_Namespace` (`ConfigAppId`,`ConfigClusterName`,`ConfigNamespaceName`,`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用实例的配置信息'; # Dump of table item # ------------------------------------------------------------ DROP TABLE IF EXISTS `Item`; CREATE TABLE `Item` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', `NamespaceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceId', `Key` varchar(128) NOT NULL DEFAULT 'default' COMMENT '配置项Key', `Value` longtext NOT NULL COMMENT '配置项值', `Comment` varchar(1024) DEFAULT '' COMMENT '注释', `LineNum` int(10) unsigned DEFAULT '0' COMMENT '行号', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `IX_GroupId` (`NamespaceId`), KEY `DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置项目'; # Dump of table namespace # ------------------------------------------------------------ DROP TABLE IF EXISTS `Namespace`; CREATE TABLE `Namespace` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name', `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `AppId_ClusterName_NamespaceName` (`AppId`(191),`ClusterName`(191),`NamespaceName`(191)), KEY `DataChange_LastTime` (`DataChange_LastTime`), KEY `IX_NamespaceName` (`NamespaceName`(191)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='命名空间'; # Dump of table namespacelock # ------------------------------------------------------------ DROP TABLE IF EXISTS `NamespaceLock`; CREATE TABLE `NamespaceLock` ( `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id', `NamespaceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceId', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT 'default' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', `IsDeleted` bit(1) DEFAULT b'0' COMMENT '软删除', PRIMARY KEY (`Id`), UNIQUE KEY `IX_NamespaceId` (`NamespaceId`), KEY `DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='namespace的编辑锁'; # Dump of table release # ------------------------------------------------------------ DROP TABLE IF EXISTS `Release`; CREATE TABLE `Release` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', `ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key', `Name` varchar(64) NOT NULL DEFAULT 'default' COMMENT '发布名字', `Comment` varchar(256) DEFAULT NULL COMMENT '发布说明', `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName', `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName', `Configurations` longtext NOT NULL COMMENT '发布配置', `IsAbandoned` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否废弃', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `AppId_ClusterName_GroupName` (`AppId`(191),`ClusterName`(191),`NamespaceName`(191)), KEY `DataChange_LastTime` (`DataChange_LastTime`), KEY `IX_ReleaseKey` (`ReleaseKey`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布'; # Dump of table releasehistory # ------------------------------------------------------------ DROP TABLE IF EXISTS `ReleaseHistory`; CREATE TABLE `ReleaseHistory` ( `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', `AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID', `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName', `NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'namespaceName', `BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT '发布分支名', `ReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '关联的Release Id', `PreviousReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '前一次发布的ReleaseId', `Operation` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '发布类型,0: 普通发布,1: 回滚,2: 灰度发布,3: 灰度规则更新,4: 灰度合并回主分支发布,5: 主分支发布灰度自动发布,6: 主分支回滚灰度自动发布,7: 放弃灰度', `OperationContext` longtext NOT NULL COMMENT '发布上下文信息', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `IX_Namespace` (`AppId`,`ClusterName`,`NamespaceName`,`BranchName`), KEY `IX_ReleaseId` (`ReleaseId`), KEY `IX_DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布历史'; # Dump of table releasemessage # ------------------------------------------------------------ DROP TABLE IF EXISTS `ReleaseMessage`; CREATE TABLE `ReleaseMessage` ( `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', `Message` varchar(1024) NOT NULL DEFAULT '' COMMENT '发布的消息内容', `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `DataChange_LastTime` (`DataChange_LastTime`), KEY `IX_Message` (`Message`(191)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布消息'; # Dump of table serverconfig # ------------------------------------------------------------ DROP TABLE IF EXISTS `ServerConfig`; CREATE TABLE `ServerConfig` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', `Key` varchar(64) NOT NULL DEFAULT 'default' COMMENT '配置项Key', `Cluster` varchar(32) NOT NULL DEFAULT 'default' COMMENT '配置对应的集群,default为不针对特定的集群', `Value` varchar(2048) NOT NULL DEFAULT 'default' COMMENT '配置项值', `Comment` varchar(1024) DEFAULT '' COMMENT '注释', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `IX_Key` (`Key`), KEY `DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置服务自身配置'; # Dump of table accesskey # ------------------------------------------------------------ DROP TABLE IF EXISTS `AccessKey`; CREATE TABLE `AccessKey` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', `Secret` varchar(128) NOT NULL DEFAULT '' COMMENT 'Secret', `IsEnabled` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: enabled, 0: disabled', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) NOT NULL DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `AppId` (`AppId`(191)), KEY `DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='访问密钥'; # Config # ------------------------------------------------------------ INSERT INTO `ServerConfig` (`Key`, `Cluster`, `Value`, `Comment`) VALUES ('eureka.service.url', 'default', 'http://statefulset-apollo-config-server-test-alpha-0.service-apollo-meta-server-test-alpha:8080/eureka/,http://statefulset-apollo-config-server-test-alpha-1.service-apollo-meta-server-test-alpha:8080/eureka/,http://statefulset-apollo-config-server-test-alpha-2.service-apollo-meta-server-test-alpha:8080/eureka/', 'Eureka服务Url,多个service以英文逗号分隔'), ('namespace.lock.switch', 'default', 'false', '一次发布只能有一个人修改开关'), ('item.key.length.limit', 'default', '128', 'item key 最大长度限制'), ('item.value.length.limit', 'default', '20000', 'item value最大长度限制'), ('config-service.cache.enabled', 'default', 'false', 'ConfigService是否开启缓存,开启后能提高性能,但是会增大内存消耗!'); /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; # Create Database # ------------------------------------------------------------ CREATE DATABASE IF NOT EXISTS TestAlphaApolloConfigDB DEFAULT CHARACTER SET = utf8mb4; Use TestAlphaApolloConfigDB; # Dump of table app # ------------------------------------------------------------ DROP TABLE IF EXISTS `App`; CREATE TABLE `App` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', `Name` varchar(500) NOT NULL DEFAULT 'default' COMMENT '应用名', `OrgId` varchar(32) NOT NULL DEFAULT 'default' COMMENT '部门Id', `OrgName` varchar(64) NOT NULL DEFAULT 'default' COMMENT '部门名字', `OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName', `OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `AppId` (`AppId`(191)), KEY `DataChange_LastTime` (`DataChange_LastTime`), KEY `IX_Name` (`Name`(191)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用表'; # Dump of table appnamespace # ------------------------------------------------------------ DROP TABLE IF EXISTS `AppNamespace`; CREATE TABLE `AppNamespace` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', `Name` varchar(32) NOT NULL DEFAULT '' COMMENT 'namespace名字,注意,需要全局唯一', `AppId` varchar(64) NOT NULL DEFAULT '' COMMENT 'app id', `Format` varchar(32) NOT NULL DEFAULT 'properties' COMMENT 'namespace的format类型', `IsPublic` bit(1) NOT NULL DEFAULT b'0' COMMENT 'namespace是否为公共', `Comment` varchar(64) NOT NULL DEFAULT '' COMMENT '注释', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT '' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `IX_AppId` (`AppId`), KEY `Name_AppId` (`Name`,`AppId`), KEY `DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用namespace定义'; # Dump of table audit # ------------------------------------------------------------ DROP TABLE IF EXISTS `Audit`; CREATE TABLE `Audit` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `EntityName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '表名', `EntityId` int(10) unsigned DEFAULT NULL COMMENT '记录ID', `OpName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '操作类型', `Comment` varchar(500) DEFAULT NULL COMMENT '备注', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='日志审计表'; # Dump of table cluster # ------------------------------------------------------------ DROP TABLE IF EXISTS `Cluster`; CREATE TABLE `Cluster` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', `Name` varchar(32) NOT NULL DEFAULT '' COMMENT '集群名字', `AppId` varchar(64) NOT NULL DEFAULT '' COMMENT 'App id', `ParentClusterId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父cluster', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT '' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `IX_AppId_Name` (`AppId`,`Name`), KEY `IX_ParentClusterId` (`ParentClusterId`), KEY `DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集群'; # Dump of table commit # ------------------------------------------------------------ DROP TABLE IF EXISTS `Commit`; CREATE TABLE `Commit` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `ChangeSets` longtext NOT NULL COMMENT '修改变更集', `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName', `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName', `Comment` varchar(500) DEFAULT NULL COMMENT '备注', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `DataChange_LastTime` (`DataChange_LastTime`), KEY `AppId` (`AppId`(191)), KEY `ClusterName` (`ClusterName`(191)), KEY `NamespaceName` (`NamespaceName`(191)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='commit 历史表'; # Dump of table grayreleaserule # ------------------------------------------------------------ DROP TABLE IF EXISTS `GrayReleaseRule`; CREATE TABLE `GrayReleaseRule` ( `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID', `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name', `NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name', `BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'branch name', `Rules` varchar(16000) DEFAULT '[]' COMMENT '灰度规则', `ReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '灰度对应的release', `BranchStatus` tinyint(2) DEFAULT '1' COMMENT '灰度分支状态: 0:删除分支,1:正在使用的规则 2:全量发布', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `DataChange_LastTime` (`DataChange_LastTime`), KEY `IX_Namespace` (`AppId`,`ClusterName`,`NamespaceName`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='灰度规则表'; # Dump of table instance # ------------------------------------------------------------ DROP TABLE IF EXISTS `Instance`; CREATE TABLE `Instance` ( `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', `AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID', `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName', `DataCenter` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Data Center Name', `Ip` varchar(32) NOT NULL DEFAULT '' COMMENT 'instance ip', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), UNIQUE KEY `IX_UNIQUE_KEY` (`AppId`,`ClusterName`,`Ip`,`DataCenter`), KEY `IX_IP` (`Ip`), KEY `IX_DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='使用配置的应用实例'; # Dump of table instanceconfig # ------------------------------------------------------------ DROP TABLE IF EXISTS `InstanceConfig`; CREATE TABLE `InstanceConfig` ( `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', `InstanceId` int(11) unsigned DEFAULT NULL COMMENT 'Instance Id', `ConfigAppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Config App Id', `ConfigClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Cluster Name', `ConfigNamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Namespace Name', `ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key', `ReleaseDeliveryTime` timestamp NULL DEFAULT NULL COMMENT '配置获取时间', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), UNIQUE KEY `IX_UNIQUE_KEY` (`InstanceId`,`ConfigAppId`,`ConfigNamespaceName`), KEY `IX_ReleaseKey` (`ReleaseKey`), KEY `IX_DataChange_LastTime` (`DataChange_LastTime`), KEY `IX_Valid_Namespace` (`ConfigAppId`,`ConfigClusterName`,`ConfigNamespaceName`,`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用实例的配置信息'; # Dump of table item # ------------------------------------------------------------ DROP TABLE IF EXISTS `Item`; CREATE TABLE `Item` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', `NamespaceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceId', `Key` varchar(128) NOT NULL DEFAULT 'default' COMMENT '配置项Key', `Value` longtext NOT NULL COMMENT '配置项值', `Comment` varchar(1024) DEFAULT '' COMMENT '注释', `LineNum` int(10) unsigned DEFAULT '0' COMMENT '行号', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `IX_GroupId` (`NamespaceId`), KEY `DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置项目'; # Dump of table namespace # ------------------------------------------------------------ DROP TABLE IF EXISTS `Namespace`; CREATE TABLE `Namespace` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name', `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `AppId_ClusterName_NamespaceName` (`AppId`(191),`ClusterName`(191),`NamespaceName`(191)), KEY `DataChange_LastTime` (`DataChange_LastTime`), KEY `IX_NamespaceName` (`NamespaceName`(191)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='命名空间'; # Dump of table namespacelock # ------------------------------------------------------------ DROP TABLE IF EXISTS `NamespaceLock`; CREATE TABLE `NamespaceLock` ( `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id', `NamespaceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceId', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT 'default' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', `IsDeleted` bit(1) DEFAULT b'0' COMMENT '软删除', PRIMARY KEY (`Id`), UNIQUE KEY `IX_NamespaceId` (`NamespaceId`), KEY `DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='namespace的编辑锁'; # Dump of table release # ------------------------------------------------------------ DROP TABLE IF EXISTS `Release`; CREATE TABLE `Release` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', `ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key', `Name` varchar(64) NOT NULL DEFAULT 'default' COMMENT '发布名字', `Comment` varchar(256) DEFAULT NULL COMMENT '发布说明', `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName', `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName', `Configurations` longtext NOT NULL COMMENT '发布配置', `IsAbandoned` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否废弃', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `AppId_ClusterName_GroupName` (`AppId`(191),`ClusterName`(191),`NamespaceName`(191)), KEY `DataChange_LastTime` (`DataChange_LastTime`), KEY `IX_ReleaseKey` (`ReleaseKey`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布'; # Dump of table releasehistory # ------------------------------------------------------------ DROP TABLE IF EXISTS `ReleaseHistory`; CREATE TABLE `ReleaseHistory` ( `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', `AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID', `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName', `NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'namespaceName', `BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT '发布分支名', `ReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '关联的Release Id', `PreviousReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '前一次发布的ReleaseId', `Operation` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '发布类型,0: 普通发布,1: 回滚,2: 灰度发布,3: 灰度规则更新,4: 灰度合并回主分支发布,5: 主分支发布灰度自动发布,6: 主分支回滚灰度自动发布,7: 放弃灰度', `OperationContext` longtext NOT NULL COMMENT '发布上下文信息', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `IX_Namespace` (`AppId`,`ClusterName`,`NamespaceName`,`BranchName`), KEY `IX_ReleaseId` (`ReleaseId`), KEY `IX_DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布历史'; # Dump of table releasemessage # ------------------------------------------------------------ DROP TABLE IF EXISTS `ReleaseMessage`; CREATE TABLE `ReleaseMessage` ( `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', `Message` varchar(1024) NOT NULL DEFAULT '' COMMENT '发布的消息内容', `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `DataChange_LastTime` (`DataChange_LastTime`), KEY `IX_Message` (`Message`(191)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布消息'; # Dump of table serverconfig # ------------------------------------------------------------ DROP TABLE IF EXISTS `ServerConfig`; CREATE TABLE `ServerConfig` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', `Key` varchar(64) NOT NULL DEFAULT 'default' COMMENT '配置项Key', `Cluster` varchar(32) NOT NULL DEFAULT 'default' COMMENT '配置对应的集群,default为不针对特定的集群', `Value` varchar(2048) NOT NULL DEFAULT 'default' COMMENT '配置项值', `Comment` varchar(1024) DEFAULT '' COMMENT '注释', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `IX_Key` (`Key`), KEY `DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置服务自身配置'; # Dump of table accesskey # ------------------------------------------------------------ DROP TABLE IF EXISTS `AccessKey`; CREATE TABLE `AccessKey` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', `Secret` varchar(128) NOT NULL DEFAULT '' COMMENT 'Secret', `IsEnabled` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: enabled, 0: disabled', `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `DataChange_LastModifiedBy` varchar(32) NOT NULL DEFAULT '' COMMENT '最后修改人邮箱前缀', `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', PRIMARY KEY (`Id`), KEY `AppId` (`AppId`(191)), KEY `DataChange_LastTime` (`DataChange_LastTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='访问密钥'; # Config # ------------------------------------------------------------ INSERT INTO `ServerConfig` (`Key`, `Cluster`, `Value`, `Comment`) VALUES ('eureka.service.url', 'default', 'http://statefulset-apollo-config-server-test-alpha-0.service-apollo-meta-server-test-alpha:8080/eureka/,http://statefulset-apollo-config-server-test-alpha-1.service-apollo-meta-server-test-alpha:8080/eureka/,http://statefulset-apollo-config-server-test-alpha-2.service-apollo-meta-server-test-alpha:8080/eureka/', 'Eureka服务Url,多个service以英文逗号分隔'), ('namespace.lock.switch', 'default', 'false', '一次发布只能有一个人修改开关'), ('item.key.length.limit', 'default', '128', 'item key 最大长度限制'), ('item.value.length.limit', 'default', '20000', 'item value最大长度限制'), ('config-service.cache.enabled', 'default', 'false', 'ConfigService是否开启缓存,开启后能提高性能,但是会增大内存消耗!'); /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/ResourceUtils.java
package com.ctrip.framework.apollo.core.utils; import java.net.URL; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.FileNotFoundException; import java.nio.file.Paths; import java.util.Properties; public class ResourceUtils { private static final Logger logger = LoggerFactory.getLogger(ResourceUtils.class); private static final String[] DEFAULT_FILE_SEARCH_LOCATIONS = new String[]{"./config/", "./"}; @SuppressWarnings("unchecked") public static Properties readConfigFile(String configPath, Properties defaults) { Properties props = new Properties(); if (defaults != null) { props.putAll(defaults); } InputStream in = loadConfigFileFromDefaultSearchLocations(configPath); try { if (in != null) { props.load(in); } } catch (IOException ex) { logger.warn("Reading config failed: {}", ex.getMessage()); } finally { if (in != null) { try { in.close(); } catch (IOException ex) { logger.warn("Close config failed: {}", ex.getMessage()); } } } if (logger.isDebugEnabled()) { StringBuilder sb = new StringBuilder(); for (String propertyName : props.stringPropertyNames()) { sb.append(propertyName).append('=').append(props.getProperty(propertyName)).append('\n'); } if (sb.length() > 0) { logger.debug("Reading properties: \n" + sb.toString()); } else { logger.warn("No available properties: {}", configPath); } } return props; } private static InputStream loadConfigFileFromDefaultSearchLocations(String configPath) { try { // load from default search locations for (String searchLocation : DEFAULT_FILE_SEARCH_LOCATIONS) { File candidate = Paths.get(searchLocation, configPath).toFile(); if (candidate.exists() && candidate.isFile() && candidate.canRead()) { logger.debug("Reading config from resource {}", candidate.getAbsolutePath()); return new FileInputStream(candidate); } } // load from classpath URL url = ClassLoaderUtil.getLoader().getResource(configPath); if (url != null) { InputStream in = getResourceAsStream(url); if (in != null) { logger.debug("Reading config from resource {}", url.getPath()); return in; } } // load outside resource under current user path File candidate = new File(System.getProperty("user.dir"), configPath); if (candidate.exists() && candidate.isFile() && candidate.canRead()) { logger.debug("Reading config from resource {}", candidate.getAbsolutePath()); return new FileInputStream(candidate); } } catch (FileNotFoundException e) { //ignore } return null; } private static InputStream getResourceAsStream(URL url) { try { return url != null ? url.openStream() : null; } catch (IOException e) { return null; } } }
package com.ctrip.framework.apollo.core.utils; import java.net.URL; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.FileNotFoundException; import java.nio.file.Paths; import java.util.Properties; public class ResourceUtils { private static final Logger logger = LoggerFactory.getLogger(ResourceUtils.class); private static final String[] DEFAULT_FILE_SEARCH_LOCATIONS = new String[]{"./config/", "./"}; @SuppressWarnings("unchecked") public static Properties readConfigFile(String configPath, Properties defaults) { Properties props = new Properties(); if (defaults != null) { props.putAll(defaults); } InputStream in = loadConfigFileFromDefaultSearchLocations(configPath); try { if (in != null) { props.load(in); } } catch (IOException ex) { logger.warn("Reading config failed: {}", ex.getMessage()); } finally { if (in != null) { try { in.close(); } catch (IOException ex) { logger.warn("Close config failed: {}", ex.getMessage()); } } } if (logger.isDebugEnabled()) { StringBuilder sb = new StringBuilder(); for (String propertyName : props.stringPropertyNames()) { sb.append(propertyName).append('=').append(props.getProperty(propertyName)).append('\n'); } if (sb.length() > 0) { logger.debug("Reading properties: \n" + sb.toString()); } else { logger.warn("No available properties: {}", configPath); } } return props; } private static InputStream loadConfigFileFromDefaultSearchLocations(String configPath) { try { // load from default search locations for (String searchLocation : DEFAULT_FILE_SEARCH_LOCATIONS) { File candidate = Paths.get(searchLocation, configPath).toFile(); if (candidate.exists() && candidate.isFile() && candidate.canRead()) { logger.debug("Reading config from resource {}", candidate.getAbsolutePath()); return new FileInputStream(candidate); } } // load from classpath URL url = ClassLoaderUtil.getLoader().getResource(configPath); if (url != null) { InputStream in = getResourceAsStream(url); if (in != null) { logger.debug("Reading config from resource {}", url.getPath()); return in; } } // load outside resource under current user path File candidate = new File(System.getProperty("user.dir"), configPath); if (candidate.exists() && candidate.isFile() && candidate.canRead()) { logger.debug("Reading config from resource {}", candidate.getAbsolutePath()); return new FileInputStream(candidate); } } catch (FileNotFoundException e) { //ignore } return null; } private static InputStream getResourceAsStream(URL url) { try { return url != null ? url.openStream() : null; } catch (IOException e) { return null; } } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/entity/ConsumerAudit.java
package com.ctrip.framework.apollo.openapi.entity; import com.google.common.base.MoreObjects; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.PrePersist; import javax.persistence.Table; /** * @author Jason Song([email protected]) */ @Entity @Table(name = "ConsumerAudit") public class ConsumerAudit { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "Id") private long id; @Column(name = "ConsumerId", nullable = false) private long consumerId; @Column(name = "Uri", nullable = false) private String uri; @Column(name = "Method", nullable = false) private String method; @Column(name = "DataChange_CreatedTime") private Date dataChangeCreatedTime; @Column(name = "DataChange_LastTime") private Date dataChangeLastModifiedTime; @PrePersist protected void prePersist() { if (this.dataChangeCreatedTime == null) { this.dataChangeCreatedTime = new Date(); } if (this.dataChangeLastModifiedTime == null) { dataChangeLastModifiedTime = this.dataChangeCreatedTime; } } public long getId() { return id; } public void setId(long id) { this.id = id; } public long getConsumerId() { return consumerId; } public void setConsumerId(long consumerId) { this.consumerId = consumerId; } public String getUri() { return uri; } public void setUri(String uri) { this.uri = uri; } public String getMethod() { return method; } public void setMethod(String method) { this.method = method; } public Date getDataChangeCreatedTime() { return dataChangeCreatedTime; } public void setDataChangeCreatedTime(Date dataChangeCreatedTime) { this.dataChangeCreatedTime = dataChangeCreatedTime; } public Date getDataChangeLastModifiedTime() { return dataChangeLastModifiedTime; } public void setDataChangeLastModifiedTime(Date dataChangeLastModifiedTime) { this.dataChangeLastModifiedTime = dataChangeLastModifiedTime; } @Override public String toString() { return MoreObjects.toStringHelper(this) .omitNullValues() .add("id", id) .add("consumerId", consumerId) .add("uri", uri) .add("method", method) .add("dataChangeCreatedTime", dataChangeCreatedTime) .add("dataChangeLastModifiedTime", dataChangeLastModifiedTime) .toString(); } }
package com.ctrip.framework.apollo.openapi.entity; import com.google.common.base.MoreObjects; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.PrePersist; import javax.persistence.Table; /** * @author Jason Song([email protected]) */ @Entity @Table(name = "ConsumerAudit") public class ConsumerAudit { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "Id") private long id; @Column(name = "ConsumerId", nullable = false) private long consumerId; @Column(name = "Uri", nullable = false) private String uri; @Column(name = "Method", nullable = false) private String method; @Column(name = "DataChange_CreatedTime") private Date dataChangeCreatedTime; @Column(name = "DataChange_LastTime") private Date dataChangeLastModifiedTime; @PrePersist protected void prePersist() { if (this.dataChangeCreatedTime == null) { this.dataChangeCreatedTime = new Date(); } if (this.dataChangeLastModifiedTime == null) { dataChangeLastModifiedTime = this.dataChangeCreatedTime; } } public long getId() { return id; } public void setId(long id) { this.id = id; } public long getConsumerId() { return consumerId; } public void setConsumerId(long consumerId) { this.consumerId = consumerId; } public String getUri() { return uri; } public void setUri(String uri) { this.uri = uri; } public String getMethod() { return method; } public void setMethod(String method) { this.method = method; } public Date getDataChangeCreatedTime() { return dataChangeCreatedTime; } public void setDataChangeCreatedTime(Date dataChangeCreatedTime) { this.dataChangeCreatedTime = dataChangeCreatedTime; } public Date getDataChangeLastModifiedTime() { return dataChangeLastModifiedTime; } public void setDataChangeLastModifiedTime(Date dataChangeLastModifiedTime) { this.dataChangeLastModifiedTime = dataChangeLastModifiedTime; } @Override public String toString() { return MoreObjects.toStringHelper(this) .omitNullValues() .add("id", id) .add("consumerId", consumerId) .add("uri", uri) .add("method", method) .add("dataChangeCreatedTime", dataChangeCreatedTime) .add("dataChangeLastModifiedTime", dataChangeLastModifiedTime) .toString(); } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-client/src/test/resources/spring/XmlConfigPlaceholderTest3.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:apollo="http://www.ctrip.com/schema/apollo" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd"> <apollo:config namespaces="application,FX.apollo"/> <bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean"> <property name="timeout" value="${timeout:100}"/> <property name="batch" value="${batch:200}"/> </bean> </beans>
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:apollo="http://www.ctrip.com/schema/apollo" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd"> <apollo:config namespaces="application,FX.apollo"/> <bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean"> <property name="timeout" value="${timeout:100}"/> <property name="batch" value="${batch:200}"/> </bean> </beans>
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-client/src/main/java/com/ctrip/framework/apollo/spring/config/NamespaceHandler.java
package com.ctrip.framework.apollo.spring.config; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser; import org.springframework.beans.factory.xml.NamespaceHandlerSupport; import org.springframework.core.Ordered; import org.springframework.util.SystemPropertyUtils; import org.w3c.dom.Element; import com.ctrip.framework.apollo.core.ConfigConsts; import com.google.common.base.Splitter; import com.google.common.base.Strings; /** * @author Jason Song([email protected]) */ public class NamespaceHandler extends NamespaceHandlerSupport { private static final Splitter NAMESPACE_SPLITTER = Splitter.on(",").omitEmptyStrings() .trimResults(); @Override public void init() { registerBeanDefinitionParser("config", new BeanParser()); } static class BeanParser extends AbstractSingleBeanDefinitionParser { @Override protected Class<?> getBeanClass(Element element) { return ConfigPropertySourcesProcessor.class; } @Override protected boolean shouldGenerateId() { return true; } private String resolveNamespaces(Element element) { String namespaces = element.getAttribute("namespaces"); if (Strings.isNullOrEmpty(namespaces)) { //default to application return ConfigConsts.NAMESPACE_APPLICATION; } return SystemPropertyUtils.resolvePlaceholders(namespaces); } @Override protected void doParse(Element element, BeanDefinitionBuilder builder) { String namespaces = this.resolveNamespaces(element); int order = Ordered.LOWEST_PRECEDENCE; String orderAttribute = element.getAttribute("order"); if (!Strings.isNullOrEmpty(orderAttribute)) { try { order = Integer.parseInt(orderAttribute); } catch (Throwable ex) { throw new IllegalArgumentException( String.format("Invalid order: %s for namespaces: %s", orderAttribute, namespaces)); } } PropertySourcesProcessor.addNamespaces(NAMESPACE_SPLITTER.splitToList(namespaces), order); } } }
package com.ctrip.framework.apollo.spring.config; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser; import org.springframework.beans.factory.xml.NamespaceHandlerSupport; import org.springframework.core.Ordered; import org.springframework.util.SystemPropertyUtils; import org.w3c.dom.Element; import com.ctrip.framework.apollo.core.ConfigConsts; import com.google.common.base.Splitter; import com.google.common.base.Strings; /** * @author Jason Song([email protected]) */ public class NamespaceHandler extends NamespaceHandlerSupport { private static final Splitter NAMESPACE_SPLITTER = Splitter.on(",").omitEmptyStrings() .trimResults(); @Override public void init() { registerBeanDefinitionParser("config", new BeanParser()); } static class BeanParser extends AbstractSingleBeanDefinitionParser { @Override protected Class<?> getBeanClass(Element element) { return ConfigPropertySourcesProcessor.class; } @Override protected boolean shouldGenerateId() { return true; } private String resolveNamespaces(Element element) { String namespaces = element.getAttribute("namespaces"); if (Strings.isNullOrEmpty(namespaces)) { //default to application return ConfigConsts.NAMESPACE_APPLICATION; } return SystemPropertyUtils.resolvePlaceholders(namespaces); } @Override protected void doParse(Element element, BeanDefinitionBuilder builder) { String namespaces = this.resolveNamespaces(element); int order = Ordered.LOWEST_PRECEDENCE; String orderAttribute = element.getAttribute("order"); if (!Strings.isNullOrEmpty(orderAttribute)) { try { order = Integer.parseInt(orderAttribute); } catch (Throwable ex) { throw new IllegalArgumentException( String.format("Invalid order: %s for namespaces: %s", orderAttribute, namespaces)); } } PropertySourcesProcessor.addNamespaces(NAMESPACE_SPLITTER.splitToList(namespaces), order); } } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/resources/static/delete_app_cluster_namespace.html
<!doctype html> <html ng-app="delete_app_cluster_namespace"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="icon" href="img/config.png"> <!-- styles --> <link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="vendor/angular/angular-toastr-1.4.1.min.css"> <link rel="stylesheet" type="text/css" media='all' href="vendor/angular/loading-bar.min.css"> <link rel="stylesheet" type="text/css" href="styles/common-style.css"> <link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css"> <title>{{'Delete.Title' | translate }}</title> </head> <body> <apollonav></apollonav> <div class="container-fluid" ng-controller="DeleteAppClusterNamespaceController"> <div class="col-md-10 col-md-offset-1 panel"> <section class="panel-body" ng-show="isRootUser"> <!-- delete app --> <section class="row"> <h5>{{'Delete.DeleteApp' | translate }} <small> {{'Delete.DeleteAppTips' | translate }} </small> </h5> <hr> <form class="form-horizontal"> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Common.AppId' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="app.appId"> <small> {{'Delete.AppIdTips' | translate }}</small> </div> <div class="col-sm-1"> <button class="btn btn-info" ng-click="getAppInfo()">{{'Common.Search' | translate }}</button> </div> </div> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> {{'Delete.AppInfo' | translate }}</label> <div class="col-sm-5"> <h5 ng-show="app.info" ng-bind="app.info"></h5> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-9"> <button type="submit" class="btn btn-primary" ng-disabled="deleteAppBtnDisabled" ng-click="deleteApp()"> {{'Delete.DeleteApp' | translate }} </button> </div> </div> </form> </section> <!-- delete cluster --> <section class="row"> <h5>{{'Delete.DeleteCluster' | translate }} <small> {{'Delete.DeleteClusterTips' | translate }} </small> </h5> <hr> <form class="form-horizontal"> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Common.AppId' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="cluster.appId"> </div> </div> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Delete.EnvName' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="cluster.env"> </div> </div> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Common.ClusterName' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="cluster.name"> <small>{{'Delete.ClusterNameTips' | translate }}</small> </div> <div class="col-sm-1"> <button class="btn btn-info" ng-click="getClusterInfo()">{{'Common.Search' | translate }}</button> </div> </div> <div class="form-group" viv clform-group> <label class="col-sm-2 control-label"> {{'Delete.ClusterInfo' | translate }}</label> <div class="col-sm-5"> <h5 ng-show="cluster.info" ng-bind="cluster.info"></h5> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-9"> <button type="submit" class="btn btn-primary" ng-disabled="deleteClusterBtnDisabled" ng-click="deleteCluster()"> {{'Delete.DeleteCluster' | translate }} </button> </div> </div> </form> </section> <!-- delete app namespace --> <section class="row"> <h5>{{'Delete.DeleteNamespace' | translate }} <small>{{'Delete.DeleteNamespaceTips' | translate }}</small> </h5> <small> {{'Delete.DeleteNamespaceTips2' | translate }} </small> <hr> <form class="form-horizontal"> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Common.AppId' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="appNamespace.appId"> </div> </div> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Delete.AppNamespaceName' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="appNamespace.name"> <small>{{'Delete.AppNamespaceNameTips' | translate }}</small> </div> <div class="col-sm-1"> <button class="btn btn-info" ng-click="getAppNamespaceInfo()">{{'Common.Search' | translate }}</button> </div> </div> <div class="form-group" viv clform-group> <label class="col-sm-2 control-label"> {{'Delete.AppNamespaceInfo' | translate }}</label> <div class="col-sm-5"> <h5 ng-show="appNamespace.info" ng-bind="appNamespace.info"></h5> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-9"> <button type="submit" class="btn btn-primary" ng-disabled="deleteAppNamespaceBtnDisabled" ng-click="deleteAppNamespace()"> {{'Delete.DeleteNamespace' | translate }} </button> </div> </div> </form> </section> </section> <section class="panel-body text-center" ng-if="!isRootUser"> <h4>{{'Common.IsRootUser' | translate }}</h4> </section> </div> </div> <div ng-include="'views/common/footer.html'"></div> <!-- jquery.js --> <script src="vendor/jquery.min.js" type="text/javascript"></script> <!--angular--> <script src="vendor/angular/angular.min.js"></script> <script src="vendor/angular/angular-route.min.js"></script> <script src="vendor/angular/angular-resource.min.js"></script> <script src="vendor/angular/angular-toastr-1.4.1.tpls.min.js"></script> <script src="vendor/angular/loading-bar.min.js"></script> <script src="vendor/angular/angular-cookies.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate-loader-static-files.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate-storage-cookie.min.js"></script> <!--valdr--> <script src="vendor/valdr/valdr.min.js" type="text/javascript"></script> <script src="vendor/valdr/valdr-message.min.js" type="text/javascript"></script> <!-- bootstrap.js --> <script src="vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script> <script src="vendor/lodash.min.js"></script> <script src="vendor/select2/select2.min.js" type="text/javascript"></script> <!--biz--> <!--must import--> <script type="application/javascript" src="scripts/app.js"></script> <script type="application/javascript" src="scripts/services/AppService.js"></script> <script type="application/javascript" src="scripts/services/EnvService.js"></script> <script type="application/javascript" src="scripts/services/UserService.js"></script> <script type="application/javascript" src="scripts/services/CommonService.js"></script> <script type="application/javascript" src="scripts/services/PermissionService.js"></script> <script type="application/javascript" src="scripts/services/ClusterService.js"></script> <script type="application/javascript" src="scripts/services/NamespaceService.js"></script> <script type="application/javascript" src="scripts/AppUtils.js"></script> <script type="application/javascript" src="scripts/PageCommon.js"></script> <script type="application/javascript" src="scripts/directive/directive.js"></script> <script type="application/javascript" src="scripts/valdr.js"></script> <script type="application/javascript" src="scripts/controller/DeleteAppClusterNamespaceController.js"></script> </body> </html>
<!doctype html> <html ng-app="delete_app_cluster_namespace"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="icon" href="img/config.png"> <!-- styles --> <link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="vendor/angular/angular-toastr-1.4.1.min.css"> <link rel="stylesheet" type="text/css" media='all' href="vendor/angular/loading-bar.min.css"> <link rel="stylesheet" type="text/css" href="styles/common-style.css"> <link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css"> <title>{{'Delete.Title' | translate }}</title> </head> <body> <apollonav></apollonav> <div class="container-fluid" ng-controller="DeleteAppClusterNamespaceController"> <div class="col-md-10 col-md-offset-1 panel"> <section class="panel-body" ng-show="isRootUser"> <!-- delete app --> <section class="row"> <h5>{{'Delete.DeleteApp' | translate }} <small> {{'Delete.DeleteAppTips' | translate }} </small> </h5> <hr> <form class="form-horizontal"> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Common.AppId' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="app.appId"> <small> {{'Delete.AppIdTips' | translate }}</small> </div> <div class="col-sm-1"> <button class="btn btn-info" ng-click="getAppInfo()">{{'Common.Search' | translate }}</button> </div> </div> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> {{'Delete.AppInfo' | translate }}</label> <div class="col-sm-5"> <h5 ng-show="app.info" ng-bind="app.info"></h5> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-9"> <button type="submit" class="btn btn-primary" ng-disabled="deleteAppBtnDisabled" ng-click="deleteApp()"> {{'Delete.DeleteApp' | translate }} </button> </div> </div> </form> </section> <!-- delete cluster --> <section class="row"> <h5>{{'Delete.DeleteCluster' | translate }} <small> {{'Delete.DeleteClusterTips' | translate }} </small> </h5> <hr> <form class="form-horizontal"> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Common.AppId' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="cluster.appId"> </div> </div> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Delete.EnvName' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="cluster.env"> </div> </div> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Common.ClusterName' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="cluster.name"> <small>{{'Delete.ClusterNameTips' | translate }}</small> </div> <div class="col-sm-1"> <button class="btn btn-info" ng-click="getClusterInfo()">{{'Common.Search' | translate }}</button> </div> </div> <div class="form-group" viv clform-group> <label class="col-sm-2 control-label"> {{'Delete.ClusterInfo' | translate }}</label> <div class="col-sm-5"> <h5 ng-show="cluster.info" ng-bind="cluster.info"></h5> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-9"> <button type="submit" class="btn btn-primary" ng-disabled="deleteClusterBtnDisabled" ng-click="deleteCluster()"> {{'Delete.DeleteCluster' | translate }} </button> </div> </div> </form> </section> <!-- delete app namespace --> <section class="row"> <h5>{{'Delete.DeleteNamespace' | translate }} <small>{{'Delete.DeleteNamespaceTips' | translate }}</small> </h5> <small> {{'Delete.DeleteNamespaceTips2' | translate }} </small> <hr> <form class="form-horizontal"> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Common.AppId' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="appNamespace.appId"> </div> </div> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Delete.AppNamespaceName' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="appNamespace.name"> <small>{{'Delete.AppNamespaceNameTips' | translate }}</small> </div> <div class="col-sm-1"> <button class="btn btn-info" ng-click="getAppNamespaceInfo()">{{'Common.Search' | translate }}</button> </div> </div> <div class="form-group" viv clform-group> <label class="col-sm-2 control-label"> {{'Delete.AppNamespaceInfo' | translate }}</label> <div class="col-sm-5"> <h5 ng-show="appNamespace.info" ng-bind="appNamespace.info"></h5> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-9"> <button type="submit" class="btn btn-primary" ng-disabled="deleteAppNamespaceBtnDisabled" ng-click="deleteAppNamespace()"> {{'Delete.DeleteNamespace' | translate }} </button> </div> </div> </form> </section> </section> <section class="panel-body text-center" ng-if="!isRootUser"> <h4>{{'Common.IsRootUser' | translate }}</h4> </section> </div> </div> <div ng-include="'views/common/footer.html'"></div> <!-- jquery.js --> <script src="vendor/jquery.min.js" type="text/javascript"></script> <!--angular--> <script src="vendor/angular/angular.min.js"></script> <script src="vendor/angular/angular-route.min.js"></script> <script src="vendor/angular/angular-resource.min.js"></script> <script src="vendor/angular/angular-toastr-1.4.1.tpls.min.js"></script> <script src="vendor/angular/loading-bar.min.js"></script> <script src="vendor/angular/angular-cookies.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate-loader-static-files.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate-storage-cookie.min.js"></script> <!--valdr--> <script src="vendor/valdr/valdr.min.js" type="text/javascript"></script> <script src="vendor/valdr/valdr-message.min.js" type="text/javascript"></script> <!-- bootstrap.js --> <script src="vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script> <script src="vendor/lodash.min.js"></script> <script src="vendor/select2/select2.min.js" type="text/javascript"></script> <!--biz--> <!--must import--> <script type="application/javascript" src="scripts/app.js"></script> <script type="application/javascript" src="scripts/services/AppService.js"></script> <script type="application/javascript" src="scripts/services/EnvService.js"></script> <script type="application/javascript" src="scripts/services/UserService.js"></script> <script type="application/javascript" src="scripts/services/CommonService.js"></script> <script type="application/javascript" src="scripts/services/PermissionService.js"></script> <script type="application/javascript" src="scripts/services/ClusterService.js"></script> <script type="application/javascript" src="scripts/services/NamespaceService.js"></script> <script type="application/javascript" src="scripts/AppUtils.js"></script> <script type="application/javascript" src="scripts/PageCommon.js"></script> <script type="application/javascript" src="scripts/directive/directive.js"></script> <script type="application/javascript" src="scripts/valdr.js"></script> <script type="application/javascript" src="scripts/controller/DeleteAppClusterNamespaceController.js"></script> </body> </html>
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/listener/ConfigPublishEvent.java
package com.ctrip.framework.apollo.portal.listener; import com.ctrip.framework.apollo.portal.environment.Env; import org.springframework.context.ApplicationEvent; public class ConfigPublishEvent extends ApplicationEvent { private ConfigPublishInfo configPublishInfo; public ConfigPublishEvent(Object source) { super(source); configPublishInfo = (ConfigPublishInfo) source; } public static ConfigPublishEvent instance() { ConfigPublishInfo info = new ConfigPublishInfo(); return new ConfigPublishEvent(info); } public ConfigPublishInfo getConfigPublishInfo(){ return configPublishInfo; } public ConfigPublishEvent withAppId(String appId) { configPublishInfo.setAppId(appId); return this; } public ConfigPublishEvent withCluster(String clusterName) { configPublishInfo.setClusterName(clusterName); return this; } public ConfigPublishEvent withNamespace(String namespaceName) { configPublishInfo.setNamespaceName(namespaceName); return this; } public ConfigPublishEvent withReleaseId(long releaseId){ configPublishInfo.setReleaseId(releaseId); return this; } public ConfigPublishEvent withPreviousReleaseId(long previousReleaseId){ configPublishInfo.setPreviousReleaseId(previousReleaseId); return this; } public ConfigPublishEvent setNormalPublishEvent(boolean isNormalPublishEvent) { configPublishInfo.setNormalPublishEvent(isNormalPublishEvent); return this; } public ConfigPublishEvent setGrayPublishEvent(boolean isGrayPublishEvent) { configPublishInfo.setGrayPublishEvent(isGrayPublishEvent); return this; } public ConfigPublishEvent setRollbackEvent(boolean isRollbackEvent) { configPublishInfo.setRollbackEvent(isRollbackEvent); return this; } public ConfigPublishEvent setMergeEvent(boolean isMergeEvent) { configPublishInfo.setMergeEvent(isMergeEvent); return this; } public ConfigPublishEvent setEnv(Env env) { configPublishInfo.setEnv(env); return this; } public static class ConfigPublishInfo { private String env; private String appId; private String clusterName; private String namespaceName; private long releaseId; private long previousReleaseId; private boolean isRollbackEvent; private boolean isMergeEvent; private boolean isNormalPublishEvent; private boolean isGrayPublishEvent; public Env getEnv() { return Env.valueOf(env); } public void setEnv(Env env) { this.env = env.toString(); } public String getAppId() { return appId; } public void setAppId(String appId) { this.appId = appId; } public String getClusterName() { return clusterName; } public void setClusterName(String clusterName) { this.clusterName = clusterName; } public String getNamespaceName() { return namespaceName; } public void setNamespaceName(String namespaceName) { this.namespaceName = namespaceName; } public long getReleaseId() { return releaseId; } public void setReleaseId(long releaseId) { this.releaseId = releaseId; } public long getPreviousReleaseId() { return previousReleaseId; } public void setPreviousReleaseId(long previousReleaseId) { this.previousReleaseId = previousReleaseId; } public boolean isRollbackEvent() { return isRollbackEvent; } public void setRollbackEvent(boolean rollbackEvent) { isRollbackEvent = rollbackEvent; } public boolean isMergeEvent() { return isMergeEvent; } public void setMergeEvent(boolean mergeEvent) { isMergeEvent = mergeEvent; } public boolean isNormalPublishEvent() { return isNormalPublishEvent; } public void setNormalPublishEvent(boolean normalPublishEvent) { isNormalPublishEvent = normalPublishEvent; } public boolean isGrayPublishEvent() { return isGrayPublishEvent; } public void setGrayPublishEvent(boolean grayPublishEvent) { isGrayPublishEvent = grayPublishEvent; } } }
package com.ctrip.framework.apollo.portal.listener; import com.ctrip.framework.apollo.portal.environment.Env; import org.springframework.context.ApplicationEvent; public class ConfigPublishEvent extends ApplicationEvent { private ConfigPublishInfo configPublishInfo; public ConfigPublishEvent(Object source) { super(source); configPublishInfo = (ConfigPublishInfo) source; } public static ConfigPublishEvent instance() { ConfigPublishInfo info = new ConfigPublishInfo(); return new ConfigPublishEvent(info); } public ConfigPublishInfo getConfigPublishInfo(){ return configPublishInfo; } public ConfigPublishEvent withAppId(String appId) { configPublishInfo.setAppId(appId); return this; } public ConfigPublishEvent withCluster(String clusterName) { configPublishInfo.setClusterName(clusterName); return this; } public ConfigPublishEvent withNamespace(String namespaceName) { configPublishInfo.setNamespaceName(namespaceName); return this; } public ConfigPublishEvent withReleaseId(long releaseId){ configPublishInfo.setReleaseId(releaseId); return this; } public ConfigPublishEvent withPreviousReleaseId(long previousReleaseId){ configPublishInfo.setPreviousReleaseId(previousReleaseId); return this; } public ConfigPublishEvent setNormalPublishEvent(boolean isNormalPublishEvent) { configPublishInfo.setNormalPublishEvent(isNormalPublishEvent); return this; } public ConfigPublishEvent setGrayPublishEvent(boolean isGrayPublishEvent) { configPublishInfo.setGrayPublishEvent(isGrayPublishEvent); return this; } public ConfigPublishEvent setRollbackEvent(boolean isRollbackEvent) { configPublishInfo.setRollbackEvent(isRollbackEvent); return this; } public ConfigPublishEvent setMergeEvent(boolean isMergeEvent) { configPublishInfo.setMergeEvent(isMergeEvent); return this; } public ConfigPublishEvent setEnv(Env env) { configPublishInfo.setEnv(env); return this; } public static class ConfigPublishInfo { private String env; private String appId; private String clusterName; private String namespaceName; private long releaseId; private long previousReleaseId; private boolean isRollbackEvent; private boolean isMergeEvent; private boolean isNormalPublishEvent; private boolean isGrayPublishEvent; public Env getEnv() { return Env.valueOf(env); } public void setEnv(Env env) { this.env = env.toString(); } public String getAppId() { return appId; } public void setAppId(String appId) { this.appId = appId; } public String getClusterName() { return clusterName; } public void setClusterName(String clusterName) { this.clusterName = clusterName; } public String getNamespaceName() { return namespaceName; } public void setNamespaceName(String namespaceName) { this.namespaceName = namespaceName; } public long getReleaseId() { return releaseId; } public void setReleaseId(long releaseId) { this.releaseId = releaseId; } public long getPreviousReleaseId() { return previousReleaseId; } public void setPreviousReleaseId(long previousReleaseId) { this.previousReleaseId = previousReleaseId; } public boolean isRollbackEvent() { return isRollbackEvent; } public void setRollbackEvent(boolean rollbackEvent) { isRollbackEvent = rollbackEvent; } public boolean isMergeEvent() { return isMergeEvent; } public void setMergeEvent(boolean mergeEvent) { isMergeEvent = mergeEvent; } public boolean isNormalPublishEvent() { return isNormalPublishEvent; } public void setNormalPublishEvent(boolean normalPublishEvent) { isNormalPublishEvent = normalPublishEvent; } public boolean isGrayPublishEvent() { return isGrayPublishEvent; } public void setGrayPublishEvent(boolean grayPublishEvent) { isGrayPublishEvent = grayPublishEvent; } } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-common/src/main/java/com/ctrip/framework/apollo/common/ApolloCommonConfig.java
package com.ctrip.framework.apollo.common; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @EnableAutoConfiguration @Configuration @ComponentScan(basePackageClasses = ApolloCommonConfig.class) public class ApolloCommonConfig { }
package com.ctrip.framework.apollo.common; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @EnableAutoConfiguration @Configuration @ComponentScan(basePackageClasses = ApolloCommonConfig.class) public class ApolloCommonConfig { }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/resources/static/config.html
<!DOCTYPE html> <html data-ng-app="application"> <head> <meta charset="UTF-8"> <title>{{'Config.Title' | translate }}</title> <link rel="icon" href="./img/config.png"> <link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="vendor/angular/angular-toastr-1.4.1.min.css"> <link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css"> <link rel="stylesheet" type="text/css" href="vendor/jquery-plugin/textareafullscreen.css"> <link rel="stylesheet" type="text/css" media='all' href="vendor/angular/loading-bar.min.css"> <link rel="stylesheet" type="text/css" href="styles/common-style.css"> </head> <body> <apollonav></apollonav> <div id="config-info" class="apollo-container app"> <div ng-controller="ConfigBaseInfoController"> <div class="J_appNotFound hidden row text-center app-not-found" ng-show="notFoundApp"> <img src="img/404.png"> <br> <p> <span ng-bind="pageContext.appId"></span> {{'Config.AppIdNotFound' | translate }}<a href="app.html">{{'Config.ClickByCreate' | translate }}</a> </p> </div> <div class="side-bar" ng-class="{'position-absolute': viewMode == 1, 'position-fixed': viewMode == 2}"> <div class="J_appFound hidden" ng-show="!notFoundApp && (viewMode == 1 || (viewMode == 2 && showSideBar))"> <!--env list--> <section class="panel"> <header class="panel-heading"> {{'Config.EnvList' | translate }} <span class="pull-right" data-tooltip="tooltip" data-placement="bottom" title="{{'Config.EnvListTips' | translate }}"> <img src="img/question.png" class="i-20" /> </span> </header> <div id="treeview" class="no-radius"></div> </section> <!--app info--> <section class="panel"> <header class="panel-heading"> {{'Config.ProjectInfo' | translate }} <span class="pull-right"> <a href="app/setting.html?#/appid={{pageContext.appId}}" style="margin-right: 5px;text-decoration:none;"> <img src="img/edit.png" class="i-20 cursor-pointer" data-tooltip="tooltip" data-placement="bottom" title="{{'Config.ModifyBasicProjectInfo' | translate }}" /> </a> <img src="img/unlike.png" class="i-20 cursor-pointer" ng-if="!favoriteId" ng-click="addFavorite()" data-tooltip="tooltip" data-placement="bottom" title="{{'Config.Favorite' | translate }}" /> <img src="img/like.png" class="i-20 cursor-pointer" ng-if="favoriteId" ng-click="deleteFavorite()" data-tooltip="tooltip" data-placement="bottom" title="{{'Config.CancelFavorite' | translate }}" /> </span> </header> <div class="panel-body"> <table class="project-info"> <tbody class="text-left"> <tr> <th>{{'Common.AppId' | translate }}:</th> <td ng-bind="appBaseInfo.appId"></td> </tr> <tr> <th>{{'Common.AppName' | translate }}:</th> <td> <small ng-bind="appBaseInfo.name"></small> </td> </tr> <tr> <th>{{'Common.Department' | translate }}:</th> <td ng-bind="appBaseInfo.orgInfo"></td> </tr> <tr> <th>{{'Common.AppOwner' | translate }}:</th> <td ng-bind="appBaseInfo.ownerName"></td> </tr> <tr> <th>{{'Common.Email' | translate }}:</th> <td> <small ng-bind="appBaseInfo.ownerEmail"></small> </td> </tr> <tr ng-show="missEnvs.length > 0"> <th>{{'Config.MissEnv' | translate }}:</th> <td> <span ng-repeat="env in missEnvs" ng-bind="env"> </span> </td> </tr> <tr ng-show="missingNamespaces.length > 0"> <th>{{'Config.MissNamespace' | translate }}:</th> <td> <span ng-repeat="namespace in missingNamespaces" ng-bind="namespace"> </span> </td> </tr> </tbody> </table> </div> </section> <!--operation entrance--> <section> <apolloentrance apollo-title="'Config.ProjectManage' | translate" apollo-img-src="'project-manage'" apollo-href="'app/setting.html?#/appid=' + pageContext.appId"></apolloentrance> <apolloentrance apollo-title="'Config.AccessKeyManage' | translate" apollo-img-src="'accesskey-manage'" apollo-href="'app/access_key.html?#/appid=' + pageContext.appId"></apolloentrance> <a class="list-group-item" ng-show="missEnvs.length > 0" ng-click="createAppInMissEnv()"> <div class="row icon-text icon-plus-orange"> <p class="btn-title ng-binding">{{'Config.CreateAppMissEnv' | translate }}</p> </div> </a> <a class="list-group-item" ng-show="missingNamespaces.length > 0" ng-click="createMissingNamespaces()"> <div class="row icon-text icon-plus-orange"> <p class="btn-title ng-binding">{{'Config.CreateAppMissNamespace' | translate }}</p> </div> </a> <apolloentrance apollo-title="'Config.AddCluster' | translate" apollo-img-src="'plus-orange'" apollo-href="'cluster.html?#/appid=' + pageContext.appId" ng-show="hasCreateClusterPermission"></apolloentrance> <div class="list-group-item cursor-pointer hover" ng-click="showMasterPermissionTips()" ng-show="!hasCreateClusterPermission"> <div class="row icon-text icon-plus-orange"> <p class="btn-title">{{'Config.AddCluster' | translate }}</p> </div> </div> <apolloentrance apollo-title="'Config.AddNamespace' | translate" apollo-img-src="'plus-orange'" apollo-href="'namespace.html?#/appid=' + pageContext.appId" ng-show="hasCreateNamespacePermission"></apolloentrance> <div class="list-group-item cursor-pointer hover" ng-click="showMasterPermissionTips()" ng-show="!hasCreateNamespacePermission"> <div class="row icon-text icon-plus-orange"> <p class="btn-title">{{'Config.AddNamespace' | translate }}</p> </div> </div> </section> </div> </div> </div> <!--具体配置信息--> <!--namespaces--> <div class="config-item-container hide" ng-class="{'view-mode-1': viewMode == 1, 'view-mode-2': viewMode == 2}" ng-controller="ConfigNamespaceController"> <h4 class="text-center" ng-show="viewMode == 2"> {{'Config.CurrentlyOperatorEnv' | translate }}:{{pageContext.env}}, {{'Common.Cluster' | translate }}:{{pageContext.clusterName}} </h4> <div class="alert alert-info alert-dismissible" role="alert" ng-show="(!hideTip || !hideTip[pageContext.appId][pageContext.clusterName]) && envMapClusters[pageContext.env]"> <button class="btn btn-sm btn-default pull-right" style="margin-top: -7px;margin-right:-15px;" ng-click="closeTip(pageContext.clusterName)">{{'Config.DoNotRemindAgain' | translate }} </button> <!--default cluster tip --> <div ng-show="pageContext.clusterName == 'default'"> <strong>{{'Config.Note' | translate }}:</strong> <span translate="Config.ClusterIsDefaultTipContent" translate-value-name="{{envMapClusters[pageContext.env]}}"></span> </div> <!--custom cluster tip--> <div ng-show="pageContext.clusterName != 'default'"> <strong>{{'Config.Note' | translate }}:</strong> <span translate="Config.ClusterIsCustomTipContent" translate-value-name="{{pageContext.clusterName}}"></span> </div> </div> <div class="alert alert-info" ng-if="hasNotPublishNamespace"> <p><b>{{'Config.Note' | translate }}:</b> {{'Config.HasNotPublishNamespace' | translate }}</p> <p> <mark ng-bind="namespacePublishInfo.join(',')"></mark> </p> </div> <apollonspanel ng-repeat="namespace in namespaces" namespace="namespace" app-id="pageContext.appId" env="pageContext.env" lock-check="lockCheck" cluster="pageContext.clusterName" user="currentUser" pre-release-ns="prepareReleaseNamespace" create-item="createItem" edit-item="editItem" pre-delete-item="preDeleteItem" pre-revoke-item="preRevokeItem" show-text="showText" show-no-modify-permission-dialog="showNoModifyPermissionDialog" show-body="namespaces.length < 3" lazy-load="namespaces.length > 10" pre-create-branch="preCreateBranch" pre-delete-branch="preDeleteBranch"> </apollonspanel> <releasemodal app-id="pageContext.appId" env="pageContext.env" cluster="pageContext.clusterName"> </releasemodal> <itemmodal to-operation-namespace="toOperationNamespace" app-id="pageContext.appId" env="pageContext.env" cluster="pageContext.clusterName" item="item"> </itemmodal> <showtextmodal text="text"></showtextmodal> <rollbackmodal app-id="pageContext.appId" env="pageContext.env" cluster="pageContext.clusterName"> </rollbackmodal> <rulesmodal app-id="pageContext.appId" env="pageContext.env" cluster="pageContext.clusterName"> </rulesmodal> <mergeandpublishmodal app-id="pageContext.appId" env="pageContext.env" cluster="pageContext.clusterName"> </mergeandpublishmodal> <publishdenymodal env="pageContext.env"></publishdenymodal> <deletenamespacemodal env="pageContext.env"></deletenamespacemodal> <apolloconfirmdialog apollo-dialog-id="'deleteConfirmDialog'" apollo-title="'Config.DeleteItem.DialogTitle' | translate" apollo-detail="'Config.DeleteItem.DialogContent' | translate:this" apollo-show-cancel-btn="true" apollo-confirm="deleteItem"></apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'releaseNoPermissionDialog'" apollo-title="'Config.PublishNoPermission.DialogTitle' | translate" apollo-detail="'Config.PublishNoPermission.DialogContent' | translate:this" apollo-show-cancel-btn="false"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'modifyNoPermissionDialog'" apollo-title="'Config.ModifyNoPermission.DialogTitle' | translate" apollo-detail="'Config.ModifyNoPermission.DialogContent' | translate:this" apollo-show-cancel-btn="false"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'masterNoPermissionDialog'" apollo-title="'Config.MasterNoPermission.DialogTitle' | translate" apollo-detail="'Config.MasterNoPermission.DialogContent' | translate:this" apollo-show-cancel-btn="false"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'namespaceLockedDialog'" apollo-title="'Config.NamespaceLocked.DialogTitle' | translate" apollo-detail="'Config.NamespaceLocked.DialogContent' | translate:this" apollo-show-cancel-btn="false"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'rollbackAlertDialog'" apollo-title="'Config.RollbackAlert.DialogTitle' | translate" apollo-detail="'Config.RollbackAlert.DialogContent' | translate" apollo-show-cancel-btn="true" apollo-confirm="rollback"></apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'emergencyPublishAlertDialog'" apollo-title="'Config.EmergencyPublishAlert.DialogTitle' | translate" apollo-detail="'Config.EmergencyPublishAlert.DialogContent' | translate" apollo-show-cancel-btn="true" apollo-confirm="emergencyPublish"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'deleteBranchDialog'" apollo-title="'Config.DeleteBranch.DialogTitle' | translate" apollo-detail="'Config.DeleteBranch.DialogContent' | translate" apollo-show-cancel-btn="true" apollo-confirm="deleteBranch"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'updateRuleTips'" apollo-title="'Config.UpdateRuleTips.DialogTitle' | translate" apollo-detail="'Config.UpdateRuleTips.DialogContent' | translate"></apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'mergeAndReleaseDenyDialog'" apollo-title="'Config.MergeAndReleaseDeny.DialogTitle' | translate" apollo-detail="'Config.MergeAndReleaseDeny.DialogContent' | translate"></apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'grayReleaseWithoutRulesTips'" apollo-title="'Config.GrayReleaseWithoutRulesTips.DialogTitle' | translate" apollo-detail="'Config.GrayReleaseWithoutRulesTips.DialogContent' | translate"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'deleteNamespaceDenyForMasterInstanceDialog'" apollo-title="'Config.DeleteNamespaceDenyForMasterInstance.DialogTitle' | translate" apollo-detail="'Config.DeleteNamespaceDenyForMasterInstance.DialogContent' | translate:this" apollo-confirm="continueDeleteNamespace"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'deleteNamespaceDenyForBranchInstanceDialog'" apollo-title="'Config.DeleteNamespaceDenyForBranchInstance.DialogTitle' | translate" apollo-detail="'Config.DeleteNamespaceDenyForBranchInstance.DialogContent' | translate:this" apollo-confirm="continueDeleteNamespace"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'deleteNamespaceDenyForPublicNamespaceDialog'" apollo-title="'Config.DeleteNamespaceDenyForPublicNamespace.DialogTitle' | translate" apollo-detail="deleteNamespaceContext.detailReason"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'syntaxCheckFailedDialog'" apollo-title="'Config.SyntaxCheckFailed.DialogTitle' | translate" apollo-detail="syntaxCheckContext.syntaxCheckMessage" apollo-extra-class="'pre'"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'revokeItemConfirmDialog'" apollo-title="'Config.RevokeItem.DialogTitle' | translate" apollo-detail="'Config.RevokeItem.DialogContent' | translate:this" apollo-show-cancel-btn="true" apollo-confirm="revokeItem"> </apolloconfirmdialog> <div class="modal fade" id="createBranchTips" tabindex="-1" role="dialog"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header panel-primary"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title">{{'Config.CreateBranchTips.DialogTitle' | translate}}</h4> </div> <div class="modal-body" ng-bind-html="'Config.CreateBranchTips.DialogContent' | translate"> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">{{'Common.Cancel' | translate}}</button> <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="createBranch()">{{'Common.Ok' | translate}}</button> </div> </div> </div> </div> </div> </div> <div ng-include="'views/common/footer.html'"></div> <!-- jquery.js --> <script src="vendor/jquery.min.js" type="text/javascript"></script> <script src="vendor/select2/select2.min.js" type="text/javascript"></script> <script src="vendor/jquery-plugin/jquery.textareafullscreen.js" type="text/javascript"></script> <!--lodash.js--> <script src="vendor/lodash.min.js" type="text/javascript"></script> <!--angular--> <script src="vendor/angular/angular.min.js"></script> <script src="vendor/angular/angular-resource.min.js"></script> <script src="vendor/angular/angular-toastr-1.4.1.tpls.min.js"></script> <script src="vendor/angular/loading-bar.min.js"></script> <script src="vendor/angular/angular-cookies.min.js"></script> <script src="vendor/angular/angular-sanitize.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate-loader-static-files.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate-storage-cookie.min.js"></script> <!-- bootstrap.js --> <script src="vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script> <script src="vendor/bootstrap/js/bootstrap-treeview.min.js" type="text/javascript"></script> <script src="vendor/diff.min.js" type="text/javascript"></script> <script src="vendor/clipboard.min.js" type="text/javascript"></script> <script src="vendor/ui-ace/ace.js" type="text/javascript"></script> <script src="vendor/ui-ace/ui-ace.min.js" type="text/javascript"></script> <script src="vendor/ui-ace/mode-properties.js" type="text/javascript"></script> <script src="vendor/ui-ace/mode-xml.js" type="text/javascript"></script> <script src="vendor/ui-ace/mode-yaml.js" type="text/javascript"></script> <script src="vendor/ui-ace/mode-json.js" type="text/javascript"></script> <script src="vendor/ui-ace/worker-json.js" type="text/javascript"></script> <script src="vendor/ui-ace/worker-xml.js" type="text/javascript"></script> <!--valdr--> <script src="vendor/valdr/valdr.min.js" type="text/javascript"></script> <script src="vendor/valdr/valdr-message.min.js" type="text/javascript"></script> <!--biz script--> <script type="application/javascript" src="scripts/app.js"></script> <!--service--> <script type="application/javascript" src="scripts/services/AppService.js"></script> <script type="application/javascript" src="scripts/services/EnvService.js"></script> <script type="application/javascript" src="scripts/services/UserService.js"></script> <script type="application/javascript" src="scripts/services/ConfigService.js"></script> <script type="application/javascript" src="scripts/services/ReleaseService.js"></script> <script type="application/javascript" src="scripts/services/PermissionService.js"></script> <script type="application/javascript" src="scripts/services/NamespaceService.js"></script> <script type="application/javascript" src="scripts/services/CommitService.js"></script> <script type="application/javascript" src="scripts/services/CommonService.js"></script> <script type="application/javascript" src="scripts/services/NamespaceLockService.js"></script> <script type="application/javascript" src="scripts/services/InstanceService.js"></script> <script type="application/javascript" src="scripts/services/FavoriteService.js"></script> <script type="application/javascript" src="scripts/services/NamespaceBranchService.js"></script> <script type="application/javascript" src="scripts/services/EventManager.js"></script> <script type="application/javascript" src="scripts/AppUtils.js"></script> <!--directive--> <script type="application/javascript" src="scripts/directive/directive.js"></script> <script type="application/javascript" src="scripts/directive/namespace-panel-directive.js"></script> <script type="application/javascript" src="scripts/directive/diff-directive.js"></script> <script type="application/javascript" src="scripts/directive/release-modal-directive.js"></script> <script type="application/javascript" src="scripts/directive/item-modal-directive.js"></script> <script type="application/javascript" src="scripts/directive/show-text-modal-directive.js"></script> <script type="application/javascript" src="scripts/directive/rollback-modal-directive.js"></script> <script type="application/javascript" src="scripts/directive/gray-release-rules-modal-directive.js"></script> <script type="application/javascript" src="scripts/directive/merge-and-publish-modal-directive.js"></script> <script type="application/javascript" src="scripts/directive/publish-deny-modal-directive.js"></script> <script type="application/javascript" src="scripts/directive/delete-namespace-modal-directive.js"></script> <!--controller--> <script type="application/javascript" src="scripts/controller/config/ConfigNamespaceController.js"></script> <script type="application/javascript" src="scripts/controller/config/ConfigBaseInfoController.js"></script> <script type="application/javascript" src="scripts/PageCommon.js"></script> <script src="scripts/valdr.js" type="text/javascript"></script> </body> </html>
<!DOCTYPE html> <html data-ng-app="application"> <head> <meta charset="UTF-8"> <title>{{'Config.Title' | translate }}</title> <link rel="icon" href="./img/config.png"> <link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="vendor/angular/angular-toastr-1.4.1.min.css"> <link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css"> <link rel="stylesheet" type="text/css" href="vendor/jquery-plugin/textareafullscreen.css"> <link rel="stylesheet" type="text/css" media='all' href="vendor/angular/loading-bar.min.css"> <link rel="stylesheet" type="text/css" href="styles/common-style.css"> </head> <body> <apollonav></apollonav> <div id="config-info" class="apollo-container app"> <div ng-controller="ConfigBaseInfoController"> <div class="J_appNotFound hidden row text-center app-not-found" ng-show="notFoundApp"> <img src="img/404.png"> <br> <p> <span ng-bind="pageContext.appId"></span> {{'Config.AppIdNotFound' | translate }}<a href="app.html">{{'Config.ClickByCreate' | translate }}</a> </p> </div> <div class="side-bar" ng-class="{'position-absolute': viewMode == 1, 'position-fixed': viewMode == 2}"> <div class="J_appFound hidden" ng-show="!notFoundApp && (viewMode == 1 || (viewMode == 2 && showSideBar))"> <!--env list--> <section class="panel"> <header class="panel-heading"> {{'Config.EnvList' | translate }} <span class="pull-right" data-tooltip="tooltip" data-placement="bottom" title="{{'Config.EnvListTips' | translate }}"> <img src="img/question.png" class="i-20" /> </span> </header> <div id="treeview" class="no-radius"></div> </section> <!--app info--> <section class="panel"> <header class="panel-heading"> {{'Config.ProjectInfo' | translate }} <span class="pull-right"> <a href="app/setting.html?#/appid={{pageContext.appId}}" style="margin-right: 5px;text-decoration:none;"> <img src="img/edit.png" class="i-20 cursor-pointer" data-tooltip="tooltip" data-placement="bottom" title="{{'Config.ModifyBasicProjectInfo' | translate }}" /> </a> <img src="img/unlike.png" class="i-20 cursor-pointer" ng-if="!favoriteId" ng-click="addFavorite()" data-tooltip="tooltip" data-placement="bottom" title="{{'Config.Favorite' | translate }}" /> <img src="img/like.png" class="i-20 cursor-pointer" ng-if="favoriteId" ng-click="deleteFavorite()" data-tooltip="tooltip" data-placement="bottom" title="{{'Config.CancelFavorite' | translate }}" /> </span> </header> <div class="panel-body"> <table class="project-info"> <tbody class="text-left"> <tr> <th>{{'Common.AppId' | translate }}:</th> <td ng-bind="appBaseInfo.appId"></td> </tr> <tr> <th>{{'Common.AppName' | translate }}:</th> <td> <small ng-bind="appBaseInfo.name"></small> </td> </tr> <tr> <th>{{'Common.Department' | translate }}:</th> <td ng-bind="appBaseInfo.orgInfo"></td> </tr> <tr> <th>{{'Common.AppOwner' | translate }}:</th> <td ng-bind="appBaseInfo.ownerName"></td> </tr> <tr> <th>{{'Common.Email' | translate }}:</th> <td> <small ng-bind="appBaseInfo.ownerEmail"></small> </td> </tr> <tr ng-show="missEnvs.length > 0"> <th>{{'Config.MissEnv' | translate }}:</th> <td> <span ng-repeat="env in missEnvs" ng-bind="env"> </span> </td> </tr> <tr ng-show="missingNamespaces.length > 0"> <th>{{'Config.MissNamespace' | translate }}:</th> <td> <span ng-repeat="namespace in missingNamespaces" ng-bind="namespace"> </span> </td> </tr> </tbody> </table> </div> </section> <!--operation entrance--> <section> <apolloentrance apollo-title="'Config.ProjectManage' | translate" apollo-img-src="'project-manage'" apollo-href="'app/setting.html?#/appid=' + pageContext.appId"></apolloentrance> <apolloentrance apollo-title="'Config.AccessKeyManage' | translate" apollo-img-src="'accesskey-manage'" apollo-href="'app/access_key.html?#/appid=' + pageContext.appId"></apolloentrance> <a class="list-group-item" ng-show="missEnvs.length > 0" ng-click="createAppInMissEnv()"> <div class="row icon-text icon-plus-orange"> <p class="btn-title ng-binding">{{'Config.CreateAppMissEnv' | translate }}</p> </div> </a> <a class="list-group-item" ng-show="missingNamespaces.length > 0" ng-click="createMissingNamespaces()"> <div class="row icon-text icon-plus-orange"> <p class="btn-title ng-binding">{{'Config.CreateAppMissNamespace' | translate }}</p> </div> </a> <apolloentrance apollo-title="'Config.AddCluster' | translate" apollo-img-src="'plus-orange'" apollo-href="'cluster.html?#/appid=' + pageContext.appId" ng-show="hasCreateClusterPermission"></apolloentrance> <div class="list-group-item cursor-pointer hover" ng-click="showMasterPermissionTips()" ng-show="!hasCreateClusterPermission"> <div class="row icon-text icon-plus-orange"> <p class="btn-title">{{'Config.AddCluster' | translate }}</p> </div> </div> <apolloentrance apollo-title="'Config.AddNamespace' | translate" apollo-img-src="'plus-orange'" apollo-href="'namespace.html?#/appid=' + pageContext.appId" ng-show="hasCreateNamespacePermission"></apolloentrance> <div class="list-group-item cursor-pointer hover" ng-click="showMasterPermissionTips()" ng-show="!hasCreateNamespacePermission"> <div class="row icon-text icon-plus-orange"> <p class="btn-title">{{'Config.AddNamespace' | translate }}</p> </div> </div> </section> </div> </div> </div> <!--具体配置信息--> <!--namespaces--> <div class="config-item-container hide" ng-class="{'view-mode-1': viewMode == 1, 'view-mode-2': viewMode == 2}" ng-controller="ConfigNamespaceController"> <h4 class="text-center" ng-show="viewMode == 2"> {{'Config.CurrentlyOperatorEnv' | translate }}:{{pageContext.env}}, {{'Common.Cluster' | translate }}:{{pageContext.clusterName}} </h4> <div class="alert alert-info alert-dismissible" role="alert" ng-show="(!hideTip || !hideTip[pageContext.appId][pageContext.clusterName]) && envMapClusters[pageContext.env]"> <button class="btn btn-sm btn-default pull-right" style="margin-top: -7px;margin-right:-15px;" ng-click="closeTip(pageContext.clusterName)">{{'Config.DoNotRemindAgain' | translate }} </button> <!--default cluster tip --> <div ng-show="pageContext.clusterName == 'default'"> <strong>{{'Config.Note' | translate }}:</strong> <span translate="Config.ClusterIsDefaultTipContent" translate-value-name="{{envMapClusters[pageContext.env]}}"></span> </div> <!--custom cluster tip--> <div ng-show="pageContext.clusterName != 'default'"> <strong>{{'Config.Note' | translate }}:</strong> <span translate="Config.ClusterIsCustomTipContent" translate-value-name="{{pageContext.clusterName}}"></span> </div> </div> <div class="alert alert-info" ng-if="hasNotPublishNamespace"> <p><b>{{'Config.Note' | translate }}:</b> {{'Config.HasNotPublishNamespace' | translate }}</p> <p> <mark ng-bind="namespacePublishInfo.join(',')"></mark> </p> </div> <apollonspanel ng-repeat="namespace in namespaces" namespace="namespace" app-id="pageContext.appId" env="pageContext.env" lock-check="lockCheck" cluster="pageContext.clusterName" user="currentUser" pre-release-ns="prepareReleaseNamespace" create-item="createItem" edit-item="editItem" pre-delete-item="preDeleteItem" pre-revoke-item="preRevokeItem" show-text="showText" show-no-modify-permission-dialog="showNoModifyPermissionDialog" show-body="namespaces.length < 3" lazy-load="namespaces.length > 10" pre-create-branch="preCreateBranch" pre-delete-branch="preDeleteBranch"> </apollonspanel> <releasemodal app-id="pageContext.appId" env="pageContext.env" cluster="pageContext.clusterName"> </releasemodal> <itemmodal to-operation-namespace="toOperationNamespace" app-id="pageContext.appId" env="pageContext.env" cluster="pageContext.clusterName" item="item"> </itemmodal> <showtextmodal text="text"></showtextmodal> <rollbackmodal app-id="pageContext.appId" env="pageContext.env" cluster="pageContext.clusterName"> </rollbackmodal> <rulesmodal app-id="pageContext.appId" env="pageContext.env" cluster="pageContext.clusterName"> </rulesmodal> <mergeandpublishmodal app-id="pageContext.appId" env="pageContext.env" cluster="pageContext.clusterName"> </mergeandpublishmodal> <publishdenymodal env="pageContext.env"></publishdenymodal> <deletenamespacemodal env="pageContext.env"></deletenamespacemodal> <apolloconfirmdialog apollo-dialog-id="'deleteConfirmDialog'" apollo-title="'Config.DeleteItem.DialogTitle' | translate" apollo-detail="'Config.DeleteItem.DialogContent' | translate:this" apollo-show-cancel-btn="true" apollo-confirm="deleteItem"></apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'releaseNoPermissionDialog'" apollo-title="'Config.PublishNoPermission.DialogTitle' | translate" apollo-detail="'Config.PublishNoPermission.DialogContent' | translate:this" apollo-show-cancel-btn="false"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'modifyNoPermissionDialog'" apollo-title="'Config.ModifyNoPermission.DialogTitle' | translate" apollo-detail="'Config.ModifyNoPermission.DialogContent' | translate:this" apollo-show-cancel-btn="false"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'masterNoPermissionDialog'" apollo-title="'Config.MasterNoPermission.DialogTitle' | translate" apollo-detail="'Config.MasterNoPermission.DialogContent' | translate:this" apollo-show-cancel-btn="false"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'namespaceLockedDialog'" apollo-title="'Config.NamespaceLocked.DialogTitle' | translate" apollo-detail="'Config.NamespaceLocked.DialogContent' | translate:this" apollo-show-cancel-btn="false"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'rollbackAlertDialog'" apollo-title="'Config.RollbackAlert.DialogTitle' | translate" apollo-detail="'Config.RollbackAlert.DialogContent' | translate" apollo-show-cancel-btn="true" apollo-confirm="rollback"></apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'emergencyPublishAlertDialog'" apollo-title="'Config.EmergencyPublishAlert.DialogTitle' | translate" apollo-detail="'Config.EmergencyPublishAlert.DialogContent' | translate" apollo-show-cancel-btn="true" apollo-confirm="emergencyPublish"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'deleteBranchDialog'" apollo-title="'Config.DeleteBranch.DialogTitle' | translate" apollo-detail="'Config.DeleteBranch.DialogContent' | translate" apollo-show-cancel-btn="true" apollo-confirm="deleteBranch"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'updateRuleTips'" apollo-title="'Config.UpdateRuleTips.DialogTitle' | translate" apollo-detail="'Config.UpdateRuleTips.DialogContent' | translate"></apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'mergeAndReleaseDenyDialog'" apollo-title="'Config.MergeAndReleaseDeny.DialogTitle' | translate" apollo-detail="'Config.MergeAndReleaseDeny.DialogContent' | translate"></apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'grayReleaseWithoutRulesTips'" apollo-title="'Config.GrayReleaseWithoutRulesTips.DialogTitle' | translate" apollo-detail="'Config.GrayReleaseWithoutRulesTips.DialogContent' | translate"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'deleteNamespaceDenyForMasterInstanceDialog'" apollo-title="'Config.DeleteNamespaceDenyForMasterInstance.DialogTitle' | translate" apollo-detail="'Config.DeleteNamespaceDenyForMasterInstance.DialogContent' | translate:this" apollo-confirm="continueDeleteNamespace"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'deleteNamespaceDenyForBranchInstanceDialog'" apollo-title="'Config.DeleteNamespaceDenyForBranchInstance.DialogTitle' | translate" apollo-detail="'Config.DeleteNamespaceDenyForBranchInstance.DialogContent' | translate:this" apollo-confirm="continueDeleteNamespace"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'deleteNamespaceDenyForPublicNamespaceDialog'" apollo-title="'Config.DeleteNamespaceDenyForPublicNamespace.DialogTitle' | translate" apollo-detail="deleteNamespaceContext.detailReason"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'syntaxCheckFailedDialog'" apollo-title="'Config.SyntaxCheckFailed.DialogTitle' | translate" apollo-detail="syntaxCheckContext.syntaxCheckMessage" apollo-extra-class="'pre'"> </apolloconfirmdialog> <apolloconfirmdialog apollo-dialog-id="'revokeItemConfirmDialog'" apollo-title="'Config.RevokeItem.DialogTitle' | translate" apollo-detail="'Config.RevokeItem.DialogContent' | translate:this" apollo-show-cancel-btn="true" apollo-confirm="revokeItem"> </apolloconfirmdialog> <div class="modal fade" id="createBranchTips" tabindex="-1" role="dialog"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header panel-primary"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title">{{'Config.CreateBranchTips.DialogTitle' | translate}}</h4> </div> <div class="modal-body" ng-bind-html="'Config.CreateBranchTips.DialogContent' | translate"> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">{{'Common.Cancel' | translate}}</button> <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="createBranch()">{{'Common.Ok' | translate}}</button> </div> </div> </div> </div> </div> </div> <div ng-include="'views/common/footer.html'"></div> <!-- jquery.js --> <script src="vendor/jquery.min.js" type="text/javascript"></script> <script src="vendor/select2/select2.min.js" type="text/javascript"></script> <script src="vendor/jquery-plugin/jquery.textareafullscreen.js" type="text/javascript"></script> <!--lodash.js--> <script src="vendor/lodash.min.js" type="text/javascript"></script> <!--angular--> <script src="vendor/angular/angular.min.js"></script> <script src="vendor/angular/angular-resource.min.js"></script> <script src="vendor/angular/angular-toastr-1.4.1.tpls.min.js"></script> <script src="vendor/angular/loading-bar.min.js"></script> <script src="vendor/angular/angular-cookies.min.js"></script> <script src="vendor/angular/angular-sanitize.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate-loader-static-files.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate-storage-cookie.min.js"></script> <!-- bootstrap.js --> <script src="vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script> <script src="vendor/bootstrap/js/bootstrap-treeview.min.js" type="text/javascript"></script> <script src="vendor/diff.min.js" type="text/javascript"></script> <script src="vendor/clipboard.min.js" type="text/javascript"></script> <script src="vendor/ui-ace/ace.js" type="text/javascript"></script> <script src="vendor/ui-ace/ui-ace.min.js" type="text/javascript"></script> <script src="vendor/ui-ace/mode-properties.js" type="text/javascript"></script> <script src="vendor/ui-ace/mode-xml.js" type="text/javascript"></script> <script src="vendor/ui-ace/mode-yaml.js" type="text/javascript"></script> <script src="vendor/ui-ace/mode-json.js" type="text/javascript"></script> <script src="vendor/ui-ace/worker-json.js" type="text/javascript"></script> <script src="vendor/ui-ace/worker-xml.js" type="text/javascript"></script> <!--valdr--> <script src="vendor/valdr/valdr.min.js" type="text/javascript"></script> <script src="vendor/valdr/valdr-message.min.js" type="text/javascript"></script> <!--biz script--> <script type="application/javascript" src="scripts/app.js"></script> <!--service--> <script type="application/javascript" src="scripts/services/AppService.js"></script> <script type="application/javascript" src="scripts/services/EnvService.js"></script> <script type="application/javascript" src="scripts/services/UserService.js"></script> <script type="application/javascript" src="scripts/services/ConfigService.js"></script> <script type="application/javascript" src="scripts/services/ReleaseService.js"></script> <script type="application/javascript" src="scripts/services/PermissionService.js"></script> <script type="application/javascript" src="scripts/services/NamespaceService.js"></script> <script type="application/javascript" src="scripts/services/CommitService.js"></script> <script type="application/javascript" src="scripts/services/CommonService.js"></script> <script type="application/javascript" src="scripts/services/NamespaceLockService.js"></script> <script type="application/javascript" src="scripts/services/InstanceService.js"></script> <script type="application/javascript" src="scripts/services/FavoriteService.js"></script> <script type="application/javascript" src="scripts/services/NamespaceBranchService.js"></script> <script type="application/javascript" src="scripts/services/EventManager.js"></script> <script type="application/javascript" src="scripts/AppUtils.js"></script> <!--directive--> <script type="application/javascript" src="scripts/directive/directive.js"></script> <script type="application/javascript" src="scripts/directive/namespace-panel-directive.js"></script> <script type="application/javascript" src="scripts/directive/diff-directive.js"></script> <script type="application/javascript" src="scripts/directive/release-modal-directive.js"></script> <script type="application/javascript" src="scripts/directive/item-modal-directive.js"></script> <script type="application/javascript" src="scripts/directive/show-text-modal-directive.js"></script> <script type="application/javascript" src="scripts/directive/rollback-modal-directive.js"></script> <script type="application/javascript" src="scripts/directive/gray-release-rules-modal-directive.js"></script> <script type="application/javascript" src="scripts/directive/merge-and-publish-modal-directive.js"></script> <script type="application/javascript" src="scripts/directive/publish-deny-modal-directive.js"></script> <script type="application/javascript" src="scripts/directive/delete-namespace-modal-directive.js"></script> <!--controller--> <script type="application/javascript" src="scripts/controller/config/ConfigNamespaceController.js"></script> <script type="application/javascript" src="scripts/controller/config/ConfigBaseInfoController.js"></script> <script type="application/javascript" src="scripts/PageCommon.js"></script> <script src="scripts/valdr.js" type="text/javascript"></script> </body> </html>
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/message/DatabaseMessageSender.java
package com.ctrip.framework.apollo.biz.message; import com.ctrip.framework.apollo.biz.entity.ReleaseMessage; import com.ctrip.framework.apollo.biz.repository.ReleaseMessageRepository; import com.ctrip.framework.apollo.core.utils.ApolloThreadFactory; import com.ctrip.framework.apollo.tracer.Tracer; import com.ctrip.framework.apollo.tracer.spi.Transaction; import com.google.common.collect.Queues; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import javax.annotation.PostConstruct; import java.util.List; import java.util.Objects; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; /** * @author Jason Song([email protected]) */ @Component public class DatabaseMessageSender implements MessageSender { private static final Logger logger = LoggerFactory.getLogger(DatabaseMessageSender.class); private static final int CLEAN_QUEUE_MAX_SIZE = 100; private BlockingQueue<Long> toClean = Queues.newLinkedBlockingQueue(CLEAN_QUEUE_MAX_SIZE); private final ExecutorService cleanExecutorService; private final AtomicBoolean cleanStopped; private final ReleaseMessageRepository releaseMessageRepository; public DatabaseMessageSender(final ReleaseMessageRepository releaseMessageRepository) { cleanExecutorService = Executors.newSingleThreadExecutor(ApolloThreadFactory.create("DatabaseMessageSender", true)); cleanStopped = new AtomicBoolean(false); this.releaseMessageRepository = releaseMessageRepository; } @Override @Transactional public void sendMessage(String message, String channel) { logger.info("Sending message {} to channel {}", message, channel); if (!Objects.equals(channel, Topics.APOLLO_RELEASE_TOPIC)) { logger.warn("Channel {} not supported by DatabaseMessageSender!", channel); return; } Tracer.logEvent("Apollo.AdminService.ReleaseMessage", message); Transaction transaction = Tracer.newTransaction("Apollo.AdminService", "sendMessage"); try { ReleaseMessage newMessage = releaseMessageRepository.save(new ReleaseMessage(message)); toClean.offer(newMessage.getId()); transaction.setStatus(Transaction.SUCCESS); } catch (Throwable ex) { logger.error("Sending message to database failed", ex); transaction.setStatus(ex); throw ex; } finally { transaction.complete(); } } @PostConstruct private void initialize() { cleanExecutorService.submit(() -> { while (!cleanStopped.get() && !Thread.currentThread().isInterrupted()) { try { Long rm = toClean.poll(1, TimeUnit.SECONDS); if (rm != null) { cleanMessage(rm); } else { TimeUnit.SECONDS.sleep(5); } } catch (Throwable ex) { Tracer.logError(ex); } } }); } private void cleanMessage(Long id) { //double check in case the release message is rolled back ReleaseMessage releaseMessage = releaseMessageRepository.findById(id).orElse(null); if (releaseMessage == null) { return; } boolean hasMore = true; while (hasMore && !Thread.currentThread().isInterrupted()) { List<ReleaseMessage> messages = releaseMessageRepository.findFirst100ByMessageAndIdLessThanOrderByIdAsc( releaseMessage.getMessage(), releaseMessage.getId()); releaseMessageRepository.deleteAll(messages); hasMore = messages.size() == 100; messages.forEach(toRemove -> Tracer.logEvent( String.format("ReleaseMessage.Clean.%s", toRemove.getMessage()), String.valueOf(toRemove.getId()))); } } void stopClean() { cleanStopped.set(true); } }
package com.ctrip.framework.apollo.biz.message; import com.ctrip.framework.apollo.biz.entity.ReleaseMessage; import com.ctrip.framework.apollo.biz.repository.ReleaseMessageRepository; import com.ctrip.framework.apollo.core.utils.ApolloThreadFactory; import com.ctrip.framework.apollo.tracer.Tracer; import com.ctrip.framework.apollo.tracer.spi.Transaction; import com.google.common.collect.Queues; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import javax.annotation.PostConstruct; import java.util.List; import java.util.Objects; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; /** * @author Jason Song([email protected]) */ @Component public class DatabaseMessageSender implements MessageSender { private static final Logger logger = LoggerFactory.getLogger(DatabaseMessageSender.class); private static final int CLEAN_QUEUE_MAX_SIZE = 100; private BlockingQueue<Long> toClean = Queues.newLinkedBlockingQueue(CLEAN_QUEUE_MAX_SIZE); private final ExecutorService cleanExecutorService; private final AtomicBoolean cleanStopped; private final ReleaseMessageRepository releaseMessageRepository; public DatabaseMessageSender(final ReleaseMessageRepository releaseMessageRepository) { cleanExecutorService = Executors.newSingleThreadExecutor(ApolloThreadFactory.create("DatabaseMessageSender", true)); cleanStopped = new AtomicBoolean(false); this.releaseMessageRepository = releaseMessageRepository; } @Override @Transactional public void sendMessage(String message, String channel) { logger.info("Sending message {} to channel {}", message, channel); if (!Objects.equals(channel, Topics.APOLLO_RELEASE_TOPIC)) { logger.warn("Channel {} not supported by DatabaseMessageSender!", channel); return; } Tracer.logEvent("Apollo.AdminService.ReleaseMessage", message); Transaction transaction = Tracer.newTransaction("Apollo.AdminService", "sendMessage"); try { ReleaseMessage newMessage = releaseMessageRepository.save(new ReleaseMessage(message)); toClean.offer(newMessage.getId()); transaction.setStatus(Transaction.SUCCESS); } catch (Throwable ex) { logger.error("Sending message to database failed", ex); transaction.setStatus(ex); throw ex; } finally { transaction.complete(); } } @PostConstruct private void initialize() { cleanExecutorService.submit(() -> { while (!cleanStopped.get() && !Thread.currentThread().isInterrupted()) { try { Long rm = toClean.poll(1, TimeUnit.SECONDS); if (rm != null) { cleanMessage(rm); } else { TimeUnit.SECONDS.sleep(5); } } catch (Throwable ex) { Tracer.logError(ex); } } }); } private void cleanMessage(Long id) { //double check in case the release message is rolled back ReleaseMessage releaseMessage = releaseMessageRepository.findById(id).orElse(null); if (releaseMessage == null) { return; } boolean hasMore = true; while (hasMore && !Thread.currentThread().isInterrupted()) { List<ReleaseMessage> messages = releaseMessageRepository.findFirst100ByMessageAndIdLessThanOrderByIdAsc( releaseMessage.getMessage(), releaseMessage.getId()); releaseMessageRepository.deleteAll(messages); hasMore = messages.size() == 100; messages.forEach(toRemove -> Tracer.logEvent( String.format("ReleaseMessage.Clean.%s", toRemove.getMessage()), String.valueOf(toRemove.getId()))); } } void stopClean() { cleanStopped.set(true); } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/SystemInfoController.java
package com.ctrip.framework.apollo.portal.controller; import com.ctrip.framework.apollo.Apollo; import com.ctrip.framework.apollo.portal.environment.PortalMetaDomainService; import com.ctrip.framework.apollo.core.dto.ServiceDTO; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.component.PortalSettings; import com.ctrip.framework.apollo.portal.component.RestTemplateFactory; import com.ctrip.framework.apollo.portal.entity.vo.EnvironmentInfo; import com.ctrip.framework.apollo.portal.entity.vo.SystemInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.actuate.health.Health; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.RestTemplate; import javax.annotation.PostConstruct; import java.util.List; @RestController @RequestMapping("/system-info") public class SystemInfoController { private static final Logger logger = LoggerFactory.getLogger(SystemInfoController.class); private static final String CONFIG_SERVICE_URL_PATH = "/services/config"; private static final String ADMIN_SERVICE_URL_PATH = "/services/admin"; private RestTemplate restTemplate; private final PortalSettings portalSettings; private final RestTemplateFactory restTemplateFactory; private final PortalMetaDomainService portalMetaDomainService; public SystemInfoController( final PortalSettings portalSettings, final RestTemplateFactory restTemplateFactory, final PortalMetaDomainService portalMetaDomainService ) { this.portalSettings = portalSettings; this.restTemplateFactory = restTemplateFactory; this.portalMetaDomainService = portalMetaDomainService; } @PostConstruct private void init() { restTemplate = restTemplateFactory.getObject(); } @PreAuthorize(value = "@permissionValidator.isSuperAdmin()") @GetMapping public SystemInfo getSystemInfo() { SystemInfo systemInfo = new SystemInfo(); String version = Apollo.VERSION; if (isValidVersion(version)) { systemInfo.setVersion(version); } List<Env> allEnvList = portalSettings.getAllEnvs(); for (Env env : allEnvList) { EnvironmentInfo environmentInfo = adaptEnv2EnvironmentInfo(env); systemInfo.addEnvironment(environmentInfo); } return systemInfo; } @PreAuthorize(value = "@permissionValidator.isSuperAdmin()") @GetMapping(value = "/health") public Health checkHealth(@RequestParam String instanceId) { List<Env> allEnvs = portalSettings.getAllEnvs(); ServiceDTO service = null; for (final Env env : allEnvs) { EnvironmentInfo envInfo = adaptEnv2EnvironmentInfo(env); if (envInfo.getAdminServices() != null) { for (final ServiceDTO s : envInfo.getAdminServices()) { if (instanceId.equals(s.getInstanceId())) { service = s; break; } } } if (envInfo.getConfigServices() != null) { for (final ServiceDTO s : envInfo.getConfigServices()) { if (instanceId.equals(s.getInstanceId())) { service = s; break; } } } } if (service == null) { throw new IllegalArgumentException("No such instance of instanceId: " + instanceId); } return restTemplate.getForObject(service.getHomepageUrl() + "/health", Health.class); } private EnvironmentInfo adaptEnv2EnvironmentInfo(final Env env) { EnvironmentInfo environmentInfo = new EnvironmentInfo(); String metaServerAddresses = portalMetaDomainService.getMetaServerAddress(env); environmentInfo.setEnv(env); environmentInfo.setActive(portalSettings.isEnvActive(env)); environmentInfo.setMetaServerAddress(metaServerAddresses); String selectedMetaServerAddress = portalMetaDomainService.getDomain(env); try { environmentInfo.setConfigServices(getServerAddress(selectedMetaServerAddress, CONFIG_SERVICE_URL_PATH)); environmentInfo.setAdminServices(getServerAddress(selectedMetaServerAddress, ADMIN_SERVICE_URL_PATH)); } catch (Throwable ex) { String errorMessage = "Loading config/admin services from meta server: " + selectedMetaServerAddress + " failed!"; logger.error(errorMessage, ex); environmentInfo.setErrorMessage(errorMessage + " Exception: " + ex.getMessage()); } return environmentInfo; } private ServiceDTO[] getServerAddress(String metaServerAddress, String path) { String url = metaServerAddress + path; return restTemplate.getForObject(url, ServiceDTO[].class); } private boolean isValidVersion(String version) { return !version.equals("java-null"); } }
package com.ctrip.framework.apollo.portal.controller; import com.ctrip.framework.apollo.Apollo; import com.ctrip.framework.apollo.portal.environment.PortalMetaDomainService; import com.ctrip.framework.apollo.core.dto.ServiceDTO; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.component.PortalSettings; import com.ctrip.framework.apollo.portal.component.RestTemplateFactory; import com.ctrip.framework.apollo.portal.entity.vo.EnvironmentInfo; import com.ctrip.framework.apollo.portal.entity.vo.SystemInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.actuate.health.Health; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.RestTemplate; import javax.annotation.PostConstruct; import java.util.List; @RestController @RequestMapping("/system-info") public class SystemInfoController { private static final Logger logger = LoggerFactory.getLogger(SystemInfoController.class); private static final String CONFIG_SERVICE_URL_PATH = "/services/config"; private static final String ADMIN_SERVICE_URL_PATH = "/services/admin"; private RestTemplate restTemplate; private final PortalSettings portalSettings; private final RestTemplateFactory restTemplateFactory; private final PortalMetaDomainService portalMetaDomainService; public SystemInfoController( final PortalSettings portalSettings, final RestTemplateFactory restTemplateFactory, final PortalMetaDomainService portalMetaDomainService ) { this.portalSettings = portalSettings; this.restTemplateFactory = restTemplateFactory; this.portalMetaDomainService = portalMetaDomainService; } @PostConstruct private void init() { restTemplate = restTemplateFactory.getObject(); } @PreAuthorize(value = "@permissionValidator.isSuperAdmin()") @GetMapping public SystemInfo getSystemInfo() { SystemInfo systemInfo = new SystemInfo(); String version = Apollo.VERSION; if (isValidVersion(version)) { systemInfo.setVersion(version); } List<Env> allEnvList = portalSettings.getAllEnvs(); for (Env env : allEnvList) { EnvironmentInfo environmentInfo = adaptEnv2EnvironmentInfo(env); systemInfo.addEnvironment(environmentInfo); } return systemInfo; } @PreAuthorize(value = "@permissionValidator.isSuperAdmin()") @GetMapping(value = "/health") public Health checkHealth(@RequestParam String instanceId) { List<Env> allEnvs = portalSettings.getAllEnvs(); ServiceDTO service = null; for (final Env env : allEnvs) { EnvironmentInfo envInfo = adaptEnv2EnvironmentInfo(env); if (envInfo.getAdminServices() != null) { for (final ServiceDTO s : envInfo.getAdminServices()) { if (instanceId.equals(s.getInstanceId())) { service = s; break; } } } if (envInfo.getConfigServices() != null) { for (final ServiceDTO s : envInfo.getConfigServices()) { if (instanceId.equals(s.getInstanceId())) { service = s; break; } } } } if (service == null) { throw new IllegalArgumentException("No such instance of instanceId: " + instanceId); } return restTemplate.getForObject(service.getHomepageUrl() + "/health", Health.class); } private EnvironmentInfo adaptEnv2EnvironmentInfo(final Env env) { EnvironmentInfo environmentInfo = new EnvironmentInfo(); String metaServerAddresses = portalMetaDomainService.getMetaServerAddress(env); environmentInfo.setEnv(env); environmentInfo.setActive(portalSettings.isEnvActive(env)); environmentInfo.setMetaServerAddress(metaServerAddresses); String selectedMetaServerAddress = portalMetaDomainService.getDomain(env); try { environmentInfo.setConfigServices(getServerAddress(selectedMetaServerAddress, CONFIG_SERVICE_URL_PATH)); environmentInfo.setAdminServices(getServerAddress(selectedMetaServerAddress, ADMIN_SERVICE_URL_PATH)); } catch (Throwable ex) { String errorMessage = "Loading config/admin services from meta server: " + selectedMetaServerAddress + " failed!"; logger.error(errorMessage, ex); environmentInfo.setErrorMessage(errorMessage + " Exception: " + ex.getMessage()); } return environmentInfo; } private ServiceDTO[] getServerAddress(String metaServerAddress, String path) { String url = metaServerAddress + path; return restTemplate.getForObject(url, ServiceDTO[].class); } private boolean isValidVersion(String version) { return !version.equals("java-null"); } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./doc/images/apollo-net-server-url-config.png
PNG  IHDRF)!} iCCPICC ProfileHT[Lz$! ҫ@z *6D',"CbCA/CA]DEeX¾ݳgs͝o3?~P &3cb8  @es2nW}xdֿ_&drfr>EP "K8eEHn?='<ad6[#gfs:d:f._'p>ҧT'/55$)ϼ˴La*{[igh!A|CYmJANϟf7b9e{ϲ8%m٢{YYJ RXRN D7ksxQ͏ ̔09ҼH*9Q-}Ǵ̹8ge}zM,wiMaj\>|fv,d_\`O H ]e%Gpb!&pL3-mڃ3Cނ\a"IsvR$ w ?8bQL=u"tԁ60&H6" b2<D`X6PݠTC'A38.6 @k0 > pAJ C yAP(AICkPTCUP+t ݄4( a5X^n?/ 8·ep5| n/÷~ b4Q&(;*JDPPRT5Պ@CIPoP_X4 DѾ4^.FkM{(Qc0,L4& S)``a`0X,bcb~l# ۍĎp8%1 cpcK3[x>_?OBKXEF8Lh%! &D}1L@,#6?H$-=)'H'H7H/d*وA^B(ŕKɢlQPQ>dLeX2\22M2=2oe ndsdKeOޑ}#Gӓc˭;+'7&O7O/?*S~Q\j> ui<hFa5Kק"qz}T`RBႂb1XT6IF/<ynm0g޸bbbůJL%/JJOF!+(_S~BWqTTy V=ک:&T۫vE:CU=Y}E _c%WL3YƼTkViviNhkEhi5j=&ji'jnYF^.ANGCw\O_/Jo^ް>K?G^ à!0p]#ڈgTat617o?_0z~ $ۤda`glv΂;t,afmjv9<ϼǢ%re;+cV4E֛ۭڈllFlullnc۟`pOGǣ &,<pIˉT$qf:9th]]jr]k\_%s{n.r?>֣YE*z]=cڧ÷X~~kZ\$P7PXA;g T5]F [v4S{H%uQQ%Qko(cZbq5c^<zIޥKW.LyY eEbWYG9=\W.HSBIDĒ$I#<^) ߃_\<r$e25*1 vV@L "QM&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1#VĢ.C Qf<N 3`VXUcC8&@bbluC\k3f 3vV% MGl2c.e\ 3`U5F82 3`̀U\30f 3`0h[5f 3`7FW}ޜ0f 30э~s 3`̀0@՚S~~(y ,YѶ&y:kg3`̀0@1Zv5=K}ϔu8p3`̀0@1ʚ6'!S6sֹ%Xv3`̀"ǨSmdF=uuC¸hW=c|)r2y18juh|,k3`̀0f`dF3{(Le]Ie@jS=%t9Ʊ<_;g 3`̀g  S~` m;էTu|sjx|(c63`̀08j^k.& LKsJ0G9.<ػ1̀0f @MzƁ {8bk7Ed߹̀0f׺Yހ9-MIɖvRhS{iQx ku77kLAn9 0f 3@nh,P(sÒ0f 3hjbS̀0f 3piuf 3`%2OMdIENDB`
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ConfigsImportService.java
package com.ctrip.framework.apollo.portal.service; import com.ctrip.framework.apollo.common.dto.NamespaceDTO; import com.ctrip.framework.apollo.common.exception.ServiceException; import com.ctrip.framework.apollo.portal.component.PermissionValidator; import com.ctrip.framework.apollo.portal.entity.model.NamespaceTextModel; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.util.ConfigFileUtils; import com.ctrip.framework.apollo.portal.util.ConfigToFileUtils; import java.io.IOException; import java.io.InputStream; import java.security.AccessControlException; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; /** * @author wxq */ @Service public class ConfigsImportService { private final ItemService itemService; private final NamespaceService namespaceService; private final PermissionValidator permissionValidator; public ConfigsImportService( final ItemService itemService, final @Lazy NamespaceService namespaceService, PermissionValidator permissionValidator) { this.itemService = itemService; this.namespaceService = namespaceService; this.permissionValidator = permissionValidator; } /** * move from {@link com.ctrip.framework.apollo.portal.controller.ConfigsImportController} */ private void importConfig( final String appId, final String env, final String clusterName, final String namespaceName, final long namespaceId, final String format, final String configText ) { final NamespaceTextModel model = new NamespaceTextModel(); model.setAppId(appId); model.setEnv(env); model.setClusterName(clusterName); model.setNamespaceName(namespaceName); model.setNamespaceId(namespaceId); model.setFormat(format); model.setConfigText(configText); itemService.updateConfigItemByText(model); } /** * import one config from file */ private void importOneConfigFromFile( final String appId, final String env, final String clusterName, final String namespaceName, final String configText, final String format ) { final NamespaceDTO namespaceDTO = namespaceService .loadNamespaceBaseInfo(appId, Env.valueOf(env), clusterName, namespaceName); this.importConfig(appId, env, clusterName, namespaceName, namespaceDTO.getId(), format, configText); } /** * import a config file. * the name of config file must be special like * appId+cluster+namespace.format * Example: * <pre> * 123456+default+application.properties (appId is 123456, cluster is default, namespace is application, format is properties) * 654321+north+password.yml (appId is 654321, cluster is north, namespace is password, format is yml) * </pre> * so we can get the information of appId, cluster, namespace, format from the file name. * @param env environment * @param standardFilename appId+cluster+namespace.format * @param configText config content */ private void importOneConfigFromText( final String env, final String standardFilename, final String configText ) { final String appId = ConfigFileUtils.getAppId(standardFilename); final String clusterName = ConfigFileUtils.getClusterName(standardFilename); final String namespace = ConfigFileUtils.getNamespace(standardFilename); final String format = ConfigFileUtils.getFormat(standardFilename); this.importOneConfigFromFile(appId, env, clusterName, namespace, configText, format); } /** * @see ConfigsImportService#importOneConfigFromText(java.lang.String, java.lang.String, java.lang.String) * @throws AccessControlException if has no modify namespace permission */ public void importOneConfigFromFile( final String env, final String standardFilename, final InputStream inputStream ) { final String configText; try(InputStream in = inputStream) { configText = ConfigToFileUtils.fileToString(in); } catch (IOException e) { throw new ServiceException("Read config file errors:{}", e); } this.importOneConfigFromText(env, standardFilename, configText); } }
package com.ctrip.framework.apollo.portal.service; import com.ctrip.framework.apollo.common.dto.NamespaceDTO; import com.ctrip.framework.apollo.common.exception.ServiceException; import com.ctrip.framework.apollo.portal.component.PermissionValidator; import com.ctrip.framework.apollo.portal.entity.model.NamespaceTextModel; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.util.ConfigFileUtils; import com.ctrip.framework.apollo.portal.util.ConfigToFileUtils; import java.io.IOException; import java.io.InputStream; import java.security.AccessControlException; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; /** * @author wxq */ @Service public class ConfigsImportService { private final ItemService itemService; private final NamespaceService namespaceService; private final PermissionValidator permissionValidator; public ConfigsImportService( final ItemService itemService, final @Lazy NamespaceService namespaceService, PermissionValidator permissionValidator) { this.itemService = itemService; this.namespaceService = namespaceService; this.permissionValidator = permissionValidator; } /** * move from {@link com.ctrip.framework.apollo.portal.controller.ConfigsImportController} */ private void importConfig( final String appId, final String env, final String clusterName, final String namespaceName, final long namespaceId, final String format, final String configText ) { final NamespaceTextModel model = new NamespaceTextModel(); model.setAppId(appId); model.setEnv(env); model.setClusterName(clusterName); model.setNamespaceName(namespaceName); model.setNamespaceId(namespaceId); model.setFormat(format); model.setConfigText(configText); itemService.updateConfigItemByText(model); } /** * import one config from file */ private void importOneConfigFromFile( final String appId, final String env, final String clusterName, final String namespaceName, final String configText, final String format ) { final NamespaceDTO namespaceDTO = namespaceService .loadNamespaceBaseInfo(appId, Env.valueOf(env), clusterName, namespaceName); this.importConfig(appId, env, clusterName, namespaceName, namespaceDTO.getId(), format, configText); } /** * import a config file. * the name of config file must be special like * appId+cluster+namespace.format * Example: * <pre> * 123456+default+application.properties (appId is 123456, cluster is default, namespace is application, format is properties) * 654321+north+password.yml (appId is 654321, cluster is north, namespace is password, format is yml) * </pre> * so we can get the information of appId, cluster, namespace, format from the file name. * @param env environment * @param standardFilename appId+cluster+namespace.format * @param configText config content */ private void importOneConfigFromText( final String env, final String standardFilename, final String configText ) { final String appId = ConfigFileUtils.getAppId(standardFilename); final String clusterName = ConfigFileUtils.getClusterName(standardFilename); final String namespace = ConfigFileUtils.getNamespace(standardFilename); final String format = ConfigFileUtils.getFormat(standardFilename); this.importOneConfigFromFile(appId, env, clusterName, namespace, configText, format); } /** * @see ConfigsImportService#importOneConfigFromText(java.lang.String, java.lang.String, java.lang.String) * @throws AccessControlException if has no modify namespace permission */ public void importOneConfigFromFile( final String env, final String standardFilename, final InputStream inputStream ) { final String configText; try(InputStream in = inputStream) { configText = ConfigToFileUtils.fileToString(in); } catch (IOException e) { throw new ServiceException("Read config file errors:{}", e); } this.importOneConfigFromText(env, standardFilename, configText); } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-adminservice/src/main/resources/application.yml
spring: application: name: apollo-adminservice profiles: active: ${apollo_profile} ctrip: appid: 100003172 server: port: 8090 logging: file: name: /opt/logs/100003172/apollo-adminservice.log eureka: instance: hostname: ${hostname:localhost} preferIpAddress: true status-page-url-path: /info health-check-url-path: /health client: serviceUrl: # This setting will be overridden by eureka.service.url setting from ApolloConfigDB.ServerConfig or System Property # see com.ctrip.framework.apollo.biz.eureka.ApolloEurekaClientConfig defaultZone: http://${eureka.instance.hostname}:8080/eureka/ healthcheck: enabled: true eurekaServiceUrlPollIntervalSeconds: 60 management: health: status: order: DOWN, OUT_OF_SERVICE, UNKNOWN, UP
spring: application: name: apollo-adminservice profiles: active: ${apollo_profile} ctrip: appid: 100003172 server: port: 8090 logging: file: name: /opt/logs/100003172/apollo-adminservice.log eureka: instance: hostname: ${hostname:localhost} preferIpAddress: true status-page-url-path: /info health-check-url-path: /health client: serviceUrl: # This setting will be overridden by eureka.service.url setting from ApolloConfigDB.ServerConfig or System Property # see com.ctrip.framework.apollo.biz.eureka.ApolloEurekaClientConfig defaultZone: http://${eureka.instance.hostname}:8080/eureka/ healthcheck: enabled: true eurekaServiceUrlPollIntervalSeconds: 60 management: health: status: order: DOWN, OUT_OF_SERVICE, UNKNOWN, UP
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./scripts/helm/apollo-portal/templates/service-portaldb.yaml
{{- if .Values.portaldb.service.enabled -}} --- # service definition for mysql kind: Service apiVersion: v1 metadata: name: {{include "apollo.portaldb.serviceName" .}} labels: {{- include "apollo.portal.labels" . | nindent 4 }} spec: type: {{ .Values.portaldb.service.type }} {{- if eq .Values.portaldb.service.type "ExternalName" }} externalName: {{ required "portaldb.host is required!" .Values.portaldb.host }} {{- else }} ports: - protocol: TCP port: {{ .Values.portaldb.service.port }} targetPort: {{ .Values.portaldb.port }} --- kind: Endpoints apiVersion: v1 metadata: name: {{include "apollo.portaldb.serviceName" .}} subsets: - addresses: - ip: {{ required "portaldb.host is required!" .Values.portaldb.host }} ports: - protocol: TCP port: {{ .Values.portaldb.port }} {{- end }} {{- end }}
{{- if .Values.portaldb.service.enabled -}} --- # service definition for mysql kind: Service apiVersion: v1 metadata: name: {{include "apollo.portaldb.serviceName" .}} labels: {{- include "apollo.portal.labels" . | nindent 4 }} spec: type: {{ .Values.portaldb.service.type }} {{- if eq .Values.portaldb.service.type "ExternalName" }} externalName: {{ required "portaldb.host is required!" .Values.portaldb.host }} {{- else }} ports: - protocol: TCP port: {{ .Values.portaldb.service.port }} targetPort: {{ .Values.portaldb.port }} --- kind: Endpoints apiVersion: v1 metadata: name: {{include "apollo.portaldb.serviceName" .}} subsets: - addresses: - ip: {{ required "portaldb.host is required!" .Values.portaldb.host }} ports: - protocol: TCP port: {{ .Values.portaldb.port }} {{- end }} {{- end }}
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./scripts/apollo-on-kubernetes/kubernetes/apollo-env-dev/service-mysql-for-apollo-dev-env.yaml
--- # 为外部 mysql 服务设置 service kind: Service apiVersion: v1 metadata: namespace: sre name: service-mysql-for-apollo-dev-env labels: app: service-mysql-for-apollo-dev-env spec: ports: - protocol: TCP port: 3306 targetPort: 3306 type: ClusterIP sessionAffinity: None --- kind: Endpoints apiVersion: v1 metadata: namespace: sre name: service-mysql-for-apollo-dev-env subsets: - addresses: - ip: your-mysql-addresses ports: - protocol: TCP port: 3306
--- # 为外部 mysql 服务设置 service kind: Service apiVersion: v1 metadata: namespace: sre name: service-mysql-for-apollo-dev-env labels: app: service-mysql-for-apollo-dev-env spec: ports: - protocol: TCP port: 3306 targetPort: 3306 type: ClusterIP sessionAffinity: None --- kind: Endpoints apiVersion: v1 metadata: namespace: sre name: service-mysql-for-apollo-dev-env subsets: - addresses: - ip: your-mysql-addresses ports: - protocol: TCP port: 3306
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-client/src/main/resources/META-INF/apollo-1.0.0.xsd
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <xsd:schema xmlns="http://www.ctrip.com/schema/apollo" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ctrip.com/schema/apollo" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xsd:annotation> <xsd:documentation><![CDATA[ Namespace support for Ctrip Apollo Configuration Center. ]]></xsd:documentation> </xsd:annotation> <xsd:element name="config"> <xsd:annotation> <xsd:documentation> <![CDATA[ Apollo configuration section to integrate with Spring.]]> </xsd:documentation> </xsd:annotation> <xsd:complexType> <xsd:attribute name="namespaces" type="xsd:string" use="optional"> <xsd:annotation> <xsd:documentation> <![CDATA[ The comma-separated list of namespace names to integrate with Spring property sources. If not specified, then default to application namespace. ]]> </xsd:documentation> </xsd:annotation> </xsd:attribute> <xsd:attribute name="order" type="xsd:int" use="optional"> <xsd:annotation> <xsd:documentation> <![CDATA[ The order of the config, default to Ordered.LOWEST_PRECEDENCE, which is Integer.MAX_VALUE. If there are properties with the same name in different apollo configs, the config with smaller order wins. ]]> </xsd:documentation> </xsd:annotation> </xsd:attribute> </xsd:complexType> </xsd:element> </xsd:schema>
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <xsd:schema xmlns="http://www.ctrip.com/schema/apollo" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ctrip.com/schema/apollo" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xsd:annotation> <xsd:documentation><![CDATA[ Namespace support for Ctrip Apollo Configuration Center. ]]></xsd:documentation> </xsd:annotation> <xsd:element name="config"> <xsd:annotation> <xsd:documentation> <![CDATA[ Apollo configuration section to integrate with Spring.]]> </xsd:documentation> </xsd:annotation> <xsd:complexType> <xsd:attribute name="namespaces" type="xsd:string" use="optional"> <xsd:annotation> <xsd:documentation> <![CDATA[ The comma-separated list of namespace names to integrate with Spring property sources. If not specified, then default to application namespace. ]]> </xsd:documentation> </xsd:annotation> </xsd:attribute> <xsd:attribute name="order" type="xsd:int" use="optional"> <xsd:annotation> <xsd:documentation> <![CDATA[ The order of the config, default to Ordered.LOWEST_PRECEDENCE, which is Integer.MAX_VALUE. If there are properties with the same name in different apollo configs, the config with smaller order wins. ]]> </xsd:documentation> </xsd:annotation> </xsd:attribute> </xsd:complexType> </xsd:element> </xsd:schema>
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/repository/AppRepository.java
package com.ctrip.framework.apollo.biz.repository; import com.ctrip.framework.apollo.common.entity.App; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; import java.util.List; public interface AppRepository extends PagingAndSortingRepository<App, Long> { @Query("SELECT a from App a WHERE a.name LIKE %:name%") List<App> findByName(@Param("name") String name); App findByAppId(String appId); }
package com.ctrip.framework.apollo.biz.repository; import com.ctrip.framework.apollo.common.entity.App; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; import java.util.List; public interface AppRepository extends PagingAndSortingRepository<App, Long> { @Query("SELECT a from App a WHERE a.name LIKE %:name%") List<App> findByName(@Param("name") String name); App findByAppId(String appId); }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-biz/src/test/java/com/ctrip/framework/apollo/biz/AbstractUnitTest.java
package com.ctrip.framework.apollo.biz; import org.junit.runner.RunWith; import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public abstract class AbstractUnitTest { }
package com.ctrip.framework.apollo.biz; import org.junit.runner.RunWith; import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public abstract class AbstractUnitTest { }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/utils/EntityManagerUtil.java
package com.ctrip.framework.apollo.biz.utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.orm.jpa.EntityManagerFactoryAccessor; import org.springframework.orm.jpa.EntityManagerFactoryUtils; import org.springframework.orm.jpa.EntityManagerHolder; import org.springframework.stereotype.Component; import org.springframework.transaction.support.TransactionSynchronizationManager; /** * @author Jason Song([email protected]) */ @Component public class EntityManagerUtil extends EntityManagerFactoryAccessor { private static final Logger logger = LoggerFactory.getLogger(EntityManagerUtil.class); /** * close the entity manager. * Use it with caution! This is only intended for use with async request, which Spring won't * close the entity manager until the async request is finished. */ public void closeEntityManager() { EntityManagerHolder emHolder = (EntityManagerHolder) TransactionSynchronizationManager.getResource(getEntityManagerFactory()); if (emHolder == null) { return; } logger.debug("Closing JPA EntityManager in EntityManagerUtil"); EntityManagerFactoryUtils.closeEntityManager(emHolder.getEntityManager()); } }
package com.ctrip.framework.apollo.biz.utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.orm.jpa.EntityManagerFactoryAccessor; import org.springframework.orm.jpa.EntityManagerFactoryUtils; import org.springframework.orm.jpa.EntityManagerHolder; import org.springframework.stereotype.Component; import org.springframework.transaction.support.TransactionSynchronizationManager; /** * @author Jason Song([email protected]) */ @Component public class EntityManagerUtil extends EntityManagerFactoryAccessor { private static final Logger logger = LoggerFactory.getLogger(EntityManagerUtil.class); /** * close the entity manager. * Use it with caution! This is only intended for use with async request, which Spring won't * close the entity manager until the async request is finished. */ public void closeEntityManager() { EntityManagerHolder emHolder = (EntityManagerHolder) TransactionSynchronizationManager.getResource(getEntityManagerFactory()); if (emHolder == null) { return; } logger.debug("Closing JPA EntityManager in EntityManagerUtil"); EntityManagerFactoryUtils.closeEntityManager(emHolder.getEntityManager()); } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-client/src/main/java/com/ctrip/framework/apollo/spi/ConfigRegistry.java
package com.ctrip.framework.apollo.spi; /** * The manually config registry, use with caution! * * @author Jason Song([email protected]) */ public interface ConfigRegistry { /** * Register the config factory for the namespace specified. * * @param namespace the namespace * @param factory the factory for this namespace */ void register(String namespace, ConfigFactory factory); /** * Get the registered config factory for the namespace. * * @param namespace the namespace * @return the factory registered for this namespace */ ConfigFactory getFactory(String namespace); }
package com.ctrip.framework.apollo.spi; /** * The manually config registry, use with caution! * * @author Jason Song([email protected]) */ public interface ConfigRegistry { /** * Register the config factory for the namespace specified. * * @param namespace the namespace * @param factory the factory for this namespace */ void register(String namespace, ConfigFactory factory); /** * Get the registered config factory for the namespace. * * @param namespace the namespace * @return the factory registered for this namespace */ ConfigFactory getFactory(String namespace); }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/repository/InstanceConfigRepository.java
package com.ctrip.framework.apollo.biz.repository; import com.ctrip.framework.apollo.biz.entity.InstanceConfig; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; import java.util.Date; import java.util.List; import java.util.Set; public interface InstanceConfigRepository extends PagingAndSortingRepository<InstanceConfig, Long> { InstanceConfig findByInstanceIdAndConfigAppIdAndConfigNamespaceName(long instanceId, String configAppId, String configNamespaceName); Page<InstanceConfig> findByReleaseKeyAndDataChangeLastModifiedTimeAfter(String releaseKey, Date validDate, Pageable pageable); Page<InstanceConfig> findByConfigAppIdAndConfigClusterNameAndConfigNamespaceNameAndDataChangeLastModifiedTimeAfter( String appId, String clusterName, String namespaceName, Date validDate, Pageable pageable); List<InstanceConfig> findByConfigAppIdAndConfigClusterNameAndConfigNamespaceNameAndDataChangeLastModifiedTimeAfterAndReleaseKeyNotIn( String appId, String clusterName, String namespaceName, Date validDate, Set<String> releaseKey); @Modifying @Query("delete from InstanceConfig where ConfigAppId=?1 and ConfigClusterName=?2 and ConfigNamespaceName = ?3") int batchDelete(String appId, String clusterName, String namespaceName); @Query( value = "select b.Id from `InstanceConfig` a inner join `Instance` b on b.Id =" + " a.`InstanceId` where a.`ConfigAppId` = :configAppId and a.`ConfigClusterName` = " + ":clusterName and a.`ConfigNamespaceName` = :namespaceName and a.`DataChange_LastTime` " + "> :validDate and b.`AppId` = :instanceAppId", countQuery = "select count(1) from `InstanceConfig` a inner join `Instance` b on b.id =" + " a.`InstanceId` where a.`ConfigAppId` = :configAppId and a.`ConfigClusterName` = " + ":clusterName and a.`ConfigNamespaceName` = :namespaceName and a.`DataChange_LastTime` " + "> :validDate and b.`AppId` = :instanceAppId", nativeQuery = true) Page<Object> findInstanceIdsByNamespaceAndInstanceAppId( @Param("instanceAppId") String instanceAppId, @Param("configAppId") String configAppId, @Param("clusterName") String clusterName, @Param("namespaceName") String namespaceName, @Param("validDate") Date validDate, Pageable pageable); }
package com.ctrip.framework.apollo.biz.repository; import com.ctrip.framework.apollo.biz.entity.InstanceConfig; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; import java.util.Date; import java.util.List; import java.util.Set; public interface InstanceConfigRepository extends PagingAndSortingRepository<InstanceConfig, Long> { InstanceConfig findByInstanceIdAndConfigAppIdAndConfigNamespaceName(long instanceId, String configAppId, String configNamespaceName); Page<InstanceConfig> findByReleaseKeyAndDataChangeLastModifiedTimeAfter(String releaseKey, Date validDate, Pageable pageable); Page<InstanceConfig> findByConfigAppIdAndConfigClusterNameAndConfigNamespaceNameAndDataChangeLastModifiedTimeAfter( String appId, String clusterName, String namespaceName, Date validDate, Pageable pageable); List<InstanceConfig> findByConfigAppIdAndConfigClusterNameAndConfigNamespaceNameAndDataChangeLastModifiedTimeAfterAndReleaseKeyNotIn( String appId, String clusterName, String namespaceName, Date validDate, Set<String> releaseKey); @Modifying @Query("delete from InstanceConfig where ConfigAppId=?1 and ConfigClusterName=?2 and ConfigNamespaceName = ?3") int batchDelete(String appId, String clusterName, String namespaceName); @Query( value = "select b.Id from `InstanceConfig` a inner join `Instance` b on b.Id =" + " a.`InstanceId` where a.`ConfigAppId` = :configAppId and a.`ConfigClusterName` = " + ":clusterName and a.`ConfigNamespaceName` = :namespaceName and a.`DataChange_LastTime` " + "> :validDate and b.`AppId` = :instanceAppId", countQuery = "select count(1) from `InstanceConfig` a inner join `Instance` b on b.id =" + " a.`InstanceId` where a.`ConfigAppId` = :configAppId and a.`ConfigClusterName` = " + ":clusterName and a.`ConfigNamespaceName` = :namespaceName and a.`DataChange_LastTime` " + "> :validDate and b.`AppId` = :instanceAppId", nativeQuery = true) Page<Object> findInstanceIdsByNamespaceAndInstanceAppId( @Param("instanceAppId") String instanceAppId, @Param("configAppId") String configAppId, @Param("clusterName") String clusterName, @Param("namespaceName") String namespaceName, @Param("validDate") Date validDate, Pageable pageable); }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-client/src/main/java/com/ctrip/framework/apollo/spring/config/ConfigPropertySourcesProcessor.java
package com.ctrip.framework.apollo.spring.config; import com.ctrip.framework.apollo.spring.spi.ConfigPropertySourcesProcessorHelper; import com.ctrip.framework.foundation.internals.ServiceBootstrap; import org.springframework.beans.BeansException; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; /** * Apollo Property Sources processor for Spring XML Based Application * * @author Jason Song([email protected]) */ public class ConfigPropertySourcesProcessor extends PropertySourcesProcessor implements BeanDefinitionRegistryPostProcessor { private ConfigPropertySourcesProcessorHelper helper = ServiceBootstrap.loadPrimary(ConfigPropertySourcesProcessorHelper.class); @Override public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException { helper.postProcessBeanDefinitionRegistry(registry); } }
package com.ctrip.framework.apollo.spring.config; import com.ctrip.framework.apollo.spring.spi.ConfigPropertySourcesProcessorHelper; import com.ctrip.framework.foundation.internals.ServiceBootstrap; import org.springframework.beans.BeansException; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; /** * Apollo Property Sources processor for Spring XML Based Application * * @author Jason Song([email protected]) */ public class ConfigPropertySourcesProcessor extends PropertySourcesProcessor implements BeanDefinitionRegistryPostProcessor { private ConfigPropertySourcesProcessorHelper helper = ServiceBootstrap.loadPrimary(ConfigPropertySourcesProcessorHelper.class); @Override public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException { helper.postProcessBeanDefinitionRegistry(registry); } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/IndexController.java
package com.ctrip.framework.apollo.adminservice.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping(path = "/") public class IndexController { @GetMapping public String index() { return "apollo-adminservice"; } }
package com.ctrip.framework.apollo.adminservice.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping(path = "/") public class IndexController { @GetMapping public String index() { return "apollo-adminservice"; } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/repository/AccessKeyRepository.java
package com.ctrip.framework.apollo.biz.repository; import com.ctrip.framework.apollo.biz.entity.AccessKey; import java.util.Date; import java.util.List; import org.springframework.data.repository.PagingAndSortingRepository; public interface AccessKeyRepository extends PagingAndSortingRepository<AccessKey, Long> { long countByAppId(String appId); AccessKey findOneByAppIdAndId(String appId, long id); List<AccessKey> findByAppId(String appId); List<AccessKey> findFirst500ByDataChangeLastModifiedTimeGreaterThanOrderByDataChangeLastModifiedTimeAsc(Date date); List<AccessKey> findByDataChangeLastModifiedTime(Date date); }
package com.ctrip.framework.apollo.biz.repository; import com.ctrip.framework.apollo.biz.entity.AccessKey; import java.util.Date; import java.util.List; import org.springframework.data.repository.PagingAndSortingRepository; public interface AccessKeyRepository extends PagingAndSortingRepository<AccessKey, Long> { long countByAppId(String appId); AccessKey findOneByAppIdAndId(String appId, long id); List<AccessKey> findByAppId(String appId); List<AccessKey> findFirst500ByDataChangeLastModifiedTimeGreaterThanOrderByDataChangeLastModifiedTimeAsc(Date date); List<AccessKey> findByDataChangeLastModifiedTime(Date date); }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-core/src/main/java/com/ctrip/framework/foundation/internals/io/ProxyInputStream.java
/* * 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. */ package com.ctrip.framework.foundation.internals.io; import static com.ctrip.framework.foundation.internals.io.IOUtils.EOF; import java.io.FilterInputStream; import java.io.IOException; import java.io.InputStream; /** * A Proxy stream which acts as expected, that is it passes the method calls on to the proxied stream and doesn't change * which methods are being called. * <p> * It is an alternative base class to FilterInputStream to increase reusability, because FilterInputStream changes the * methods being called, such as read(byte[]) to read(byte[], int, int). * <p> * See the protected methods for ways in which a subclass can easily decorate a stream with custom pre-, post- or error * processing functionality. * * @version $Id: ProxyInputStream.java 1603493 2014-06-18 15:46:07Z ggregory $ */ public abstract class ProxyInputStream extends FilterInputStream { /** * Constructs a new ProxyInputStream. * * @param proxy the InputStream to delegate to */ public ProxyInputStream(final InputStream proxy) { super(proxy); // the proxy is stored in a protected superclass variable named 'in' } /** * Invokes the delegate's <code>read()</code> method. * * @return the byte read or -1 if the end of stream * @throws IOException if an I/O error occurs */ @Override public int read() throws IOException { try { beforeRead(1); final int b = in.read(); afterRead(b != EOF ? 1 : EOF); return b; } catch (final IOException e) { handleIOException(e); return EOF; } } /** * Invokes the delegate's <code>read(byte[])</code> method. * * @param bts the buffer to read the bytes into * @return the number of bytes read or EOF if the end of stream * @throws IOException if an I/O error occurs */ @Override public int read(final byte[] bts) throws IOException { try { beforeRead(bts != null ? bts.length : 0); final int n = in.read(bts); afterRead(n); return n; } catch (final IOException e) { handleIOException(e); return EOF; } } /** * Invokes the delegate's <code>read(byte[], int, int)</code> method. * * @param bts the buffer to read the bytes into * @param off The start offset * @param len The number of bytes to read * @return the number of bytes read or -1 if the end of stream * @throws IOException if an I/O error occurs */ @Override public int read(final byte[] bts, final int off, final int len) throws IOException { try { beforeRead(len); final int n = in.read(bts, off, len); afterRead(n); return n; } catch (final IOException e) { handleIOException(e); return EOF; } } /** * Invokes the delegate's <code>skip(long)</code> method. * * @param ln the number of bytes to skip * @return the actual number of bytes skipped * @throws IOException if an I/O error occurs */ @Override public long skip(final long ln) throws IOException { try { return in.skip(ln); } catch (final IOException e) { handleIOException(e); return 0; } } /** * Invokes the delegate's <code>available()</code> method. * * @return the number of available bytes * @throws IOException if an I/O error occurs */ @Override public int available() throws IOException { try { return super.available(); } catch (final IOException e) { handleIOException(e); return 0; } } /** * Invokes the delegate's <code>close()</code> method. * * @throws IOException if an I/O error occurs */ @Override public void close() throws IOException { try { in.close(); } catch (final IOException e) { handleIOException(e); } } /** * Invokes the delegate's <code>mark(int)</code> method. * * @param readlimit read ahead limit */ @Override public synchronized void mark(final int readlimit) { in.mark(readlimit); } /** * Invokes the delegate's <code>reset()</code> method. * * @throws IOException if an I/O error occurs */ @Override public synchronized void reset() throws IOException { try { in.reset(); } catch (final IOException e) { handleIOException(e); } } /** * Invokes the delegate's <code>markSupported()</code> method. * * @return true if mark is supported, otherwise false */ @Override public boolean markSupported() { return in.markSupported(); } /** * Invoked by the read methods before the call is proxied. The number of bytes that the caller wanted to read (1 for * the {@link #read()} method, buffer length for {@link #read(byte[])}, etc.) is given as an argument. * <p> * Subclasses can override this method to add common pre-processing functionality without having to override all the * read methods. The default implementation does nothing. * <p> * Note this method is <em>not</em> called from {@link #skip(long)} or {@link #reset()}. You need to explicitly * override those methods if you want to add pre-processing steps also to them. * * @since 2.0 * @param n number of bytes that the caller asked to be read * @throws IOException if the pre-processing fails */ protected void beforeRead(final int n) throws IOException { // no-op } /** * Invoked by the read methods after the proxied call has returned successfully. The number of bytes returned to the * caller (or -1 if the end of stream was reached) is given as an argument. * <p> * Subclasses can override this method to add common post-processing functionality without having to override all the * read methods. The default implementation does nothing. * <p> * Note this method is <em>not</em> called from {@link #skip(long)} or {@link #reset()}. You need to explicitly * override those methods if you want to add post-processing steps also to them. * * @since 2.0 * @param n number of bytes read, or -1 if the end of stream was reached * @throws IOException if the post-processing fails */ protected void afterRead(final int n) throws IOException { // no-op } /** * Handle any IOExceptions thrown. * <p> * This method provides a point to implement custom exception handling. The default behaviour is to re-throw the * exception. * * @param e The IOException thrown * @throws IOException if an I/O error occurs * @since 2.0 */ protected void handleIOException(final IOException e) throws IOException { throw e; } }
/* * 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. */ package com.ctrip.framework.foundation.internals.io; import static com.ctrip.framework.foundation.internals.io.IOUtils.EOF; import java.io.FilterInputStream; import java.io.IOException; import java.io.InputStream; /** * A Proxy stream which acts as expected, that is it passes the method calls on to the proxied stream and doesn't change * which methods are being called. * <p> * It is an alternative base class to FilterInputStream to increase reusability, because FilterInputStream changes the * methods being called, such as read(byte[]) to read(byte[], int, int). * <p> * See the protected methods for ways in which a subclass can easily decorate a stream with custom pre-, post- or error * processing functionality. * * @version $Id: ProxyInputStream.java 1603493 2014-06-18 15:46:07Z ggregory $ */ public abstract class ProxyInputStream extends FilterInputStream { /** * Constructs a new ProxyInputStream. * * @param proxy the InputStream to delegate to */ public ProxyInputStream(final InputStream proxy) { super(proxy); // the proxy is stored in a protected superclass variable named 'in' } /** * Invokes the delegate's <code>read()</code> method. * * @return the byte read or -1 if the end of stream * @throws IOException if an I/O error occurs */ @Override public int read() throws IOException { try { beforeRead(1); final int b = in.read(); afterRead(b != EOF ? 1 : EOF); return b; } catch (final IOException e) { handleIOException(e); return EOF; } } /** * Invokes the delegate's <code>read(byte[])</code> method. * * @param bts the buffer to read the bytes into * @return the number of bytes read or EOF if the end of stream * @throws IOException if an I/O error occurs */ @Override public int read(final byte[] bts) throws IOException { try { beforeRead(bts != null ? bts.length : 0); final int n = in.read(bts); afterRead(n); return n; } catch (final IOException e) { handleIOException(e); return EOF; } } /** * Invokes the delegate's <code>read(byte[], int, int)</code> method. * * @param bts the buffer to read the bytes into * @param off The start offset * @param len The number of bytes to read * @return the number of bytes read or -1 if the end of stream * @throws IOException if an I/O error occurs */ @Override public int read(final byte[] bts, final int off, final int len) throws IOException { try { beforeRead(len); final int n = in.read(bts, off, len); afterRead(n); return n; } catch (final IOException e) { handleIOException(e); return EOF; } } /** * Invokes the delegate's <code>skip(long)</code> method. * * @param ln the number of bytes to skip * @return the actual number of bytes skipped * @throws IOException if an I/O error occurs */ @Override public long skip(final long ln) throws IOException { try { return in.skip(ln); } catch (final IOException e) { handleIOException(e); return 0; } } /** * Invokes the delegate's <code>available()</code> method. * * @return the number of available bytes * @throws IOException if an I/O error occurs */ @Override public int available() throws IOException { try { return super.available(); } catch (final IOException e) { handleIOException(e); return 0; } } /** * Invokes the delegate's <code>close()</code> method. * * @throws IOException if an I/O error occurs */ @Override public void close() throws IOException { try { in.close(); } catch (final IOException e) { handleIOException(e); } } /** * Invokes the delegate's <code>mark(int)</code> method. * * @param readlimit read ahead limit */ @Override public synchronized void mark(final int readlimit) { in.mark(readlimit); } /** * Invokes the delegate's <code>reset()</code> method. * * @throws IOException if an I/O error occurs */ @Override public synchronized void reset() throws IOException { try { in.reset(); } catch (final IOException e) { handleIOException(e); } } /** * Invokes the delegate's <code>markSupported()</code> method. * * @return true if mark is supported, otherwise false */ @Override public boolean markSupported() { return in.markSupported(); } /** * Invoked by the read methods before the call is proxied. The number of bytes that the caller wanted to read (1 for * the {@link #read()} method, buffer length for {@link #read(byte[])}, etc.) is given as an argument. * <p> * Subclasses can override this method to add common pre-processing functionality without having to override all the * read methods. The default implementation does nothing. * <p> * Note this method is <em>not</em> called from {@link #skip(long)} or {@link #reset()}. You need to explicitly * override those methods if you want to add pre-processing steps also to them. * * @since 2.0 * @param n number of bytes that the caller asked to be read * @throws IOException if the pre-processing fails */ protected void beforeRead(final int n) throws IOException { // no-op } /** * Invoked by the read methods after the proxied call has returned successfully. The number of bytes returned to the * caller (or -1 if the end of stream was reached) is given as an argument. * <p> * Subclasses can override this method to add common post-processing functionality without having to override all the * read methods. The default implementation does nothing. * <p> * Note this method is <em>not</em> called from {@link #skip(long)} or {@link #reset()}. You need to explicitly * override those methods if you want to add post-processing steps also to them. * * @since 2.0 * @param n number of bytes read, or -1 if the end of stream was reached * @throws IOException if the post-processing fails */ protected void afterRead(final int n) throws IOException { // no-op } /** * Handle any IOExceptions thrown. * <p> * This method provides a point to implement custom exception handling. The default behaviour is to re-throw the * exception. * * @param e The IOException thrown * @throws IOException if an I/O error occurs * @since 2.0 */ protected void handleIOException(final IOException e) throws IOException { throw e; } }
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-core/src/test/resources/properties/server.properties
idc=SHAJQ env=DEV subenv=Dev123 bigdata=true tooling=true pci=true
idc=SHAJQ env=DEV subenv=Dev123 bigdata=true tooling=true pci=true
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/resources/static/vendor/angular/angular-translate.2.18.1/angular-translate.min.js
/*! * angular-translate - v2.18.1 - 2018-05-19 * * Copyright (c) 2018 The angular-translate team, Pascal Precht; Licensed MIT */ !function(t,e){"function"==typeof define&&define.amd?define([],function(){return e()}):"object"==typeof module&&module.exports?module.exports=e():e()}(0,function(){function t(e){"use strict";var n=e.storageKey(),a=e.storage(),t=function(){var t=e.preferredLanguage();angular.isString(t)?e.use(t):a.put(n,e.use())};t.displayName="fallbackFromIncorrectStorageValue",a?a.get(n)?e.use(a.get(n)).catch(t):t():angular.isString(e.preferredLanguage())&&e.use(e.preferredLanguage())}function e(t,r,e,i){"use strict";var z,c,T,x,F,I,_,n,V,R,D,K,U,M,H,G,q={},Y=[],B=t,J=[],Q="translate-cloak",W=!1,X=!1,Z=".",tt=!1,et=!1,nt=0,at=!0,a="default",s={default:function(t){return(t||"").split("-").join("_")},java:function(t){var e=(t||"").split("-").join("_"),n=e.split("_");return 1<n.length?n[0].toLowerCase()+"_"+n[1].toUpperCase():e},bcp47:function(t){var e=(t||"").split("_").join("-"),n=e.split("-");switch(n.length){case 1:n[0]=n[0].toLowerCase();break;case 2:n[0]=n[0].toLowerCase(),4===n[1].length?n[1]=n[1].charAt(0).toUpperCase()+n[1].slice(1).toLowerCase():n[1]=n[1].toUpperCase();break;case 3:n[0]=n[0].toLowerCase(),n[1]=n[1].charAt(0).toUpperCase()+n[1].slice(1).toLowerCase(),n[2]=n[2].toUpperCase();break;default:return e}return n.join("-")},"iso639-1":function(t){return(t||"").split("_").join("-").split("-")[0].toLowerCase()}},o=function(){if(angular.isFunction(i.getLocale))return i.getLocale();var t,e,n=r.$get().navigator,a=["language","browserLanguage","systemLanguage","userLanguage"];if(angular.isArray(n.languages))for(t=0;t<n.languages.length;t++)if((e=n.languages[t])&&e.length)return e;for(t=0;t<a.length;t++)if((e=n[a[t]])&&e.length)return e;return null};o.displayName="angular-translate/service: getFirstBrowserLanguage";var rt=function(){var t=o()||"";return s[a]&&(t=s[a](t)),t};rt.displayName="angular-translate/service: getLocale";var it=function(t,e){for(var n=0,a=t.length;n<a;n++)if(t[n]===e)return n;return-1},st=function(){return this.toString().replace(/^\s+|\s+$/g,"")},f=function(t){return angular.isString(t)?t.toLowerCase():t},ot=function(t){if(t){for(var e,n=[],a=f(t),r=0,i=Y.length;r<i;r++)n.push(f(Y[r]));if(-1<(r=it(n,a)))return Y[r];if(c)for(var s in c)if(c.hasOwnProperty(s)){var o=!1,l=Object.prototype.hasOwnProperty.call(c,s)&&f(s)===f(t);if("*"===s.slice(-1)&&(o=f(s.slice(0,-1))===f(t.slice(0,s.length-1))),(l||o)&&(e=c[s],-1<it(n,f(e))))return e}var u=t.split("_");return 1<u.length&&-1<it(n,f(u[0]))?u[0]:void 0}},lt=function(t,e){if(!t&&!e)return q;if(t&&!e){if(angular.isString(t))return q[t]}else angular.isObject(q[t])||(q[t]={}),angular.extend(q[t],ut(e));return this};this.translations=lt,this.cloakClassName=function(t){return t?(Q=t,this):Q},this.nestedObjectDelimeter=function(t){return t?(Z=t,this):Z};var ut=function(t,e,n,a){var r,i,s;for(r in e||(e=[]),n||(n={}),t)Object.prototype.hasOwnProperty.call(t,r)&&(s=t[r],angular.isObject(s)?ut(s,e.concat(r),n,r):(i=e.length?""+e.join(Z)+Z+r:r,e.length&&r===a&&(n[""+e.join(Z)]="@:"+i),n[i]=s));return n};ut.displayName="flatObject",this.addInterpolation=function(t){return J.push(t),this},this.useMessageFormatInterpolation=function(){return this.useInterpolation("$translateMessageFormatInterpolation")},this.useInterpolation=function(t){return R=t,this},this.useSanitizeValueStrategy=function(t){return e.useStrategy(t),this},this.preferredLanguage=function(t){return t?(ct(t),this):z};var ct=function(t){return t&&(z=t),z};this.translationNotFoundIndicator=function(t){return this.translationNotFoundIndicatorLeft(t),this.translationNotFoundIndicatorRight(t),this},this.translationNotFoundIndicatorLeft=function(t){return t?(U=t,this):U},this.translationNotFoundIndicatorRight=function(t){return t?(M=t,this):M},this.fallbackLanguage=function(t){return ft(t),this};var ft=function(t){return t?(angular.isString(t)?(x=!0,T=[t]):angular.isArray(t)&&(x=!1,T=t),angular.isString(z)&&it(T,z)<0&&T.push(z),this):x?T[0]:T};this.use=function(t){if(t){if(!q[t]&&!D)throw new Error("$translateProvider couldn't find translationTable for langKey: '"+t+"'");return F=t,this}return F},this.resolveClientLocale=function(){return rt()};var gt=function(t){return t?(B=t,this):n?n+B:B};this.storageKey=gt,this.useUrlLoader=function(t,e){return this.useLoader("$translateUrlLoader",angular.extend({url:t},e))},this.useStaticFilesLoader=function(t){return this.useLoader("$translateStaticFilesLoader",t)},this.useLoader=function(t,e){return D=t,K=e||{},this},this.useLocalStorage=function(){return this.useStorage("$translateLocalStorage")},this.useCookieStorage=function(){return this.useStorage("$translateCookieStorage")},this.useStorage=function(t){return _=t,this},this.storagePrefix=function(t){return t?(n=t,this):t},this.useMissingTranslationHandlerLog=function(){return this.useMissingTranslationHandler("$translateMissingTranslationHandlerLog")},this.useMissingTranslationHandler=function(t){return V=t,this},this.usePostCompiling=function(t){return W=!!t,this},this.forceAsyncReload=function(t){return X=!!t,this},this.uniformLanguageTag=function(t){return t?angular.isString(t)&&(t={standard:t}):t={},a=t.standard,this},this.determinePreferredLanguage=function(t){var e=t&&angular.isFunction(t)?t():rt();return z=Y.length&&ot(e)||e,this},this.registerAvailableLanguageKeys=function(t,e){return t?(Y=t,e&&(c=e),this):Y},this.useLoaderCache=function(t){return!1===t?H=void 0:!0===t?H=!0:void 0===t?H="$translationCache":t&&(H=t),this},this.directivePriority=function(t){return void 0===t?nt:(nt=t,this)},this.statefulFilter=function(t){return void 0===t?at:(at=t,this)},this.postProcess=function(t){return G=t||void 0,this},this.keepContent=function(t){return et=!!t,this},this.$get=["$log","$injector","$rootScope","$q",function(t,o,s,m){var i,$,y,b=o.get(R||"$translateDefaultInterpolation"),S=!1,L={},f={},j=function(t,s,o,l,u,c){!F&&z&&(F=z);var a=u&&u!==F?ot(u)||u:F;if(u&&v(u),angular.isArray(t)){return function(t){for(var a={},e=[],n=function(e){var n=m.defer(),t=function(t){a[e]=t,n.resolve([e,t])};return j(e,s,o,l,u,c).then(t,t),n.promise},r=0,i=t.length;r<i;r++)e.push(n(t[r]));return m.all(e).then(function(){return a})}(t)}var e=m.defer();t&&(t=st.apply(t));var n=function(){var t=f[a]||f[z];if($=0,_&&!t){var e=i.get(B);if(t=f[e],T&&T.length){var n=it(T,e);$=0===n?1:0,it(T,z)<0&&T.push(z)}}return t}();if(n){var r=function(){u||(a=F),h(t,s,o,l,a,c).then(e.resolve,e.reject)};r.displayName="promiseResolved",n.finally(r).catch(angular.noop)}else h(t,s,o,l,a,c).then(e.resolve,e.reject);return e.promise},w=function(t){return U&&(t=[U,t].join(" ")),M&&(t=[t,M].join(" ")),t},l=function(t){F=t,_&&i.put(j.storageKey(),F),s.$emit("$translateChangeSuccess",{language:t}),b.setLocale(F);var e=function(t,e){L[e].setLocale(F)};e.displayName="eachInterpolatorLocaleSetter",angular.forEach(L,e),s.$emit("$translateChangeEnd",{language:t})},u=function(n){if(!n)throw"No language key specified for loading.";var a=m.defer();s.$emit("$translateLoadingStart",{language:n}),S=!0;var t=H;"string"==typeof t&&(t=o.get(t));var e=angular.extend({},K,{key:n,$http:angular.extend({},{cache:t},K.$http)}),r=function(t){var e={};s.$emit("$translateLoadingSuccess",{language:n}),angular.isArray(t)?angular.forEach(t,function(t){angular.extend(e,ut(t))}):angular.extend(e,ut(t)),S=!1,a.resolve({key:n,table:e}),s.$emit("$translateLoadingEnd",{language:n})};r.displayName="onLoaderSuccess";var i=function(t){s.$emit("$translateLoadingError",{language:t}),a.reject(t),s.$emit("$translateLoadingEnd",{language:t})};return i.displayName="onLoaderError",o.get(D)(e).then(r,i),a.promise};if(_&&(!(i=o.get(_)).get||!i.put))throw new Error("Couldn't use storage '"+_+"', missing get() or put() method!");if(J.length){var e=function(t){var e=o.get(t);e.setLocale(z||F),L[e.getInterpolationIdentifier()]=e};e.displayName="interpolationFactoryAdder",angular.forEach(J,e)}var c=function(a,r,i,s,o){var l=m.defer(),t=function(t){if(Object.prototype.hasOwnProperty.call(t,r)&&null!==t[r]){s.setLocale(a);var e=t[r];if("@:"===e.substr(0,2))c(a,e.substr(2),i,s,o).then(l.resolve,l.reject);else{var n=s.interpolate(t[r],i,"service",o,r);n=O(r,t[r],n,i,a),l.resolve(n)}s.setLocale(F)}else l.reject()};return t.displayName="fallbackTranslationResolver",function(t){var e=m.defer();if(Object.prototype.hasOwnProperty.call(q,t))e.resolve(q[t]);else if(f[t]){var n=function(t){lt(t.key,t.table),e.resolve(t.table)};n.displayName="translationTableResolver",f[t].then(n,e.reject)}else e.reject();return e.promise}(a).then(t,l.reject),l.promise},g=function(t,e,n,a,r){var i,s=q[t];if(s&&Object.prototype.hasOwnProperty.call(s,e)&&null!==s[e]){if(a.setLocale(t),i=a.interpolate(s[e],n,"filter",r,e),i=O(e,s[e],i,n,t,r),!angular.isString(i)&&angular.isFunction(i.$$unwrapTrustedValue)){var o=i.$$unwrapTrustedValue();if("@:"===o.substr(0,2))return g(t,o.substr(2),n,a,r)}else if("@:"===i.substr(0,2))return g(t,i.substr(2),n,a,r);a.setLocale(F)}return i},C=function(t,e,n,a){return V?o.get(V)(t,F,e,n,a):t},N=function(t,e,n,a,r,i){var s=m.defer();if(t<T.length){var o=T[t];c(o,e,n,a,i).then(function(t){s.resolve(t)},function(){return N(t+1,e,n,a,r,i).then(s.resolve,s.reject)})}else if(r)s.resolve(r);else{var l=C(e,n,r);V&&l?s.resolve(l):s.reject(w(e))}return s.promise},p=function(t,e,n,a,r){var i;if(t<T.length){var s=T[t];(i=g(s,e,n,a,r))||""===i||(i=p(t+1,e,n,a))}return i},h=function(t,e,n,a,r,i){var s,o,l,u,c,f=m.defer(),g=r?q[r]:q,p=n?L[n]:b;if(g&&Object.prototype.hasOwnProperty.call(g,t)&&null!==g[t]){var h=g[t];if("@:"===h.substr(0,2))j(h.substr(2),e,n,a,r,i).then(f.resolve,f.reject);else{var d=p.interpolate(h,e,"service",i,t);d=O(t,h,d,e,r),f.resolve(d)}}else{var v;V&&!S&&(v=C(t,e,a)),r&&T&&T.length?(s=t,o=e,l=p,u=a,c=i,N(0<y?y:$,s,o,l,u,c)).then(function(t){f.resolve(t)},function(t){f.reject(w(t))}):V&&!S&&v?a?f.resolve(a):f.resolve(v):a?f.resolve(a):f.reject(w(t))}return f.promise},d=function(t,e,n,a,r){var i,s=a?q[a]:q,o=b;if(L&&Object.prototype.hasOwnProperty.call(L,n)&&(o=L[n]),s&&Object.prototype.hasOwnProperty.call(s,t)&&null!==s[t]){var l=s[t];"@:"===l.substr(0,2)?i=d(l.substr(2),e,n,a,r):(i=o.interpolate(l,e,"filter",r,t),i=O(t,l,i,e,a,r))}else{var u;V&&!S&&(u=C(t,e,r)),i=a&&T&&T.length?p(($=0)<y?y:$,t,e,o,r):V&&!S&&u?u:w(t)}return i},O=function(t,e,n,a,r,i){var s=G;return s&&("string"==typeof s&&(s=o.get(s)),s)?s(t,e,n,a,r,i):n},v=function(t){q[t]||!D||f[t]||(f[t]=u(t).then(function(t){return lt(t.key,t.table),t}))};j.preferredLanguage=function(t){return t&&ct(t),z},j.cloakClassName=function(){return Q},j.nestedObjectDelimeter=function(){return Z},j.fallbackLanguage=function(t){if(null!=t){if(ft(t),D&&T&&T.length)for(var e=0,n=T.length;e<n;e++)f[T[e]]||(f[T[e]]=u(T[e]));j.use(j.use())}return x?T[0]:T},j.useFallbackLanguage=function(t){if(null!=t)if(t){var e=it(T,t);-1<e&&(y=e)}else y=0},j.proposedLanguage=function(){return I},j.storage=function(){return i},j.negotiateLocale=ot,j.use=function(e){if(!e)return F;var n=m.defer();n.promise.then(null,angular.noop),s.$emit("$translateChangeStart",{language:e});var t=ot(e);return 0<Y.length&&!t?m.reject(e):(t&&(e=t),I=e,!X&&q[e]||!D||f[e]?f[e]?f[e].then(function(t){return I===t.key&&l(t.key),n.resolve(t.key),t},function(t){return!F&&T&&0<T.length&&T[0]!==t?j.use(T[0]).then(n.resolve,n.reject):n.reject(t)}):(n.resolve(e),l(e)):(f[e]=u(e).then(function(t){return lt(t.key,t.table),n.resolve(t.key),I===e&&l(t.key),t},function(t){return s.$emit("$translateChangeError",{language:t}),n.reject(t),s.$emit("$translateChangeEnd",{language:t}),m.reject(t)}),f[e].finally(function(){var t;I===(t=e)&&(I=void 0),f[t]=void 0}).catch(angular.noop)),n.promise)},j.resolveClientLocale=function(){return rt()},j.storageKey=function(){return gt()},j.isPostCompilingEnabled=function(){return W},j.isForceAsyncReloadEnabled=function(){return X},j.isKeepContent=function(){return et},j.refresh=function(t){if(!D)throw new Error("Couldn't refresh translation table, no loader registered!");s.$emit("$translateRefreshStart",{language:t});var e=m.defer(),n={};function a(e){var t=u(e);return(f[e]=t).then(function(t){q[e]={},lt(e,t.table),n[e]=!0},angular.noop),t}if(e.promise.then(function(){for(var t in q)q.hasOwnProperty(t)&&(t in n||delete q[t]);F&&l(F)},angular.noop).finally(function(){s.$emit("$translateRefreshEnd",{language:t})}),t)q[t]?a(t).then(e.resolve,e.reject):e.reject();else{var r=T&&T.slice()||[];F&&-1===r.indexOf(F)&&r.push(F),m.all(r.map(a)).then(e.resolve,e.reject)}return e.promise},j.instant=function(t,e,n,a,r){var i=a&&a!==F?ot(a)||a:F;if(null===t||angular.isUndefined(t))return t;if(a&&v(a),angular.isArray(t)){for(var s={},o=0,l=t.length;o<l;o++)s[t[o]]=j.instant(t[o],e,n,a,r);return s}if(angular.isString(t)&&t.length<1)return t;t&&(t=st.apply(t));var u,c,f=[];z&&f.push(z),i&&f.push(i),T&&T.length&&(f=f.concat(T));for(var g=0,p=f.length;g<p;g++){var h=f[g];if(q[h]&&void 0!==q[h][t]&&(u=d(t,e,n,i,r)),void 0!==u)break}u||""===u||(U||M?u=w(t):(u=b.interpolate(t,e,"filter",r),V&&!S&&(c=C(t,e,r)),V&&!S&&c&&(u=c)));return u},j.versionInfo=function(){return"2.18.1"},j.loaderCache=function(){return H},j.directivePriority=function(){return nt},j.statefulFilter=function(){return at},j.isReady=function(){return tt};var n=m.defer();n.promise.then(function(){tt=!0}),j.onReady=function(t){var e=m.defer();return angular.isFunction(t)&&e.promise.then(t),tt?e.resolve():n.promise.then(e.resolve),e.promise},j.getAvailableLanguageKeys=function(){return 0<Y.length?Y:null},j.getTranslationTable=function(t){return(t=t||j.use())&&q[t]?angular.copy(q[t]):null};var a=s.$on("$translateReady",function(){n.resolve(),a(),a=null}),r=s.$on("$translateChangeEnd",function(){n.resolve(),r(),r=null});if(D){if(angular.equals(q,{})&&j.use()&&j.use(j.use()),T&&T.length)for(var E=function(t){return lt(t.key,t.table),s.$emit("$translateChangeEnd",{language:t.key}),t},k=0,P=T.length;k<P;k++){var A=T[k];!X&&q[A]||(f[A]=u(A).then(E))}}else s.$emit("$translateReady",{language:j.use()});return j}]}function n(s,o){"use strict";var t={};return t.setLocale=function(t){t},t.getInterpolationIdentifier=function(){return"default"},t.useSanitizeValueStrategy=function(t){return o.useStrategy(t),this},t.interpolate=function(t,e,n,a,r){var i;return e=e||{},e=o.sanitize(e,"params",a,n),angular.isNumber(t)?i=""+t:angular.isString(t)?(i=s(t)(e),i=o.sanitize(i,"text",a,n)):i="",i},t}function a(S,L,j,w,C){"use strict";var N=function(t){return angular.isString(t)?t.toLowerCase():t};return{restrict:"AE",scope:!0,priority:S.directivePriority(),compile:function(t,h){var d=h.translateValues?h.translateValues:void 0,v=h.translateInterpolation?h.translateInterpolation:void 0,m=h.translateSanitizeStrategy?h.translateSanitizeStrategy:void 0,$=t[0].outerHTML.match(/translate-value-+/i),y="^(.*)("+L.startSymbol()+".*"+L.endSymbol()+")(.*)",b="^(.*)"+L.startSymbol()+"(.*)"+L.endSymbol()+"(.*)";return function(r,l,u){r.interpolateParams={},r.preText="",r.postText="",r.translateNamespace=function t(e){if(e.translateNamespace)return e.translateNamespace;if(e.$parent)return t(e.$parent)}(r);var i={},s=function(t){if(angular.isFunction(s._unwatchOld)&&(s._unwatchOld(),s._unwatchOld=void 0),angular.equals(t,"")||!angular.isDefined(t)){var e=function(){return this.toString().replace(/^\s+|\s+$/g,"")}.apply(l.text()),n=e.match(y);if(angular.isArray(n)){r.preText=n[1],r.postText=n[3],i.translate=L(n[2])(r.$parent);var a=e.match(b);angular.isArray(a)&&a[2]&&a[2].length&&(s._unwatchOld=r.$watch(a[2],function(t){i.translate=t,c()}))}else i.translate=e||void 0}else i.translate=t;c()},t=function(e){u.$observe(e,function(t){i[e]=t,c()})};!function(t,e,n){if(e.translateValues&&angular.extend(t,w(e.translateValues)(r.$parent)),$)for(var a in n)Object.prototype.hasOwnProperty.call(e,a)&&"translateValue"===a.substr(0,14)&&"translateValues"!==a&&(t[N(a.substr(14,1))+a.substr(15)]=n[a])}(r.interpolateParams,u,h);var e=!0;for(var n in u.$observe("translate",function(t){void 0===t?s(""):""===t&&e||(i.translate=t,c()),e=!1}),u)u.hasOwnProperty(n)&&"translateAttr"===n.substr(0,13)&&13<n.length&&t(n);if(u.$observe("translateDefault",function(t){r.defaultText=t,c()}),m&&u.$observe("translateSanitizeStrategy",function(t){r.sanitizeStrategy=w(t)(r.$parent),c()}),d&&u.$observe("translateValues",function(t){t&&r.$parent.$watch(function(){angular.extend(r.interpolateParams,w(t)(r.$parent))})}),$){var a=function(n){u.$observe(n,function(t){var e=N(n.substr(14,1))+n.substr(15);r.interpolateParams[e]=t})};for(var o in u)Object.prototype.hasOwnProperty.call(u,o)&&"translateValue"===o.substr(0,14)&&"translateValues"!==o&&a(o)}var c=function(){for(var t in i)i.hasOwnProperty(t)&&void 0!==i[t]&&f(t,i[t],r,r.interpolateParams,r.defaultText,r.translateNamespace)},f=function(e,t,n,a,r,i){t?(i&&"."===t.charAt(0)&&(t=i+t),S(t,a,v,r,n.translateLanguage,n.sanitizeStrategy).then(function(t){g(t,n,!0,e)},function(t){g(t,n,!1,e)})):g(t,n,!1,e)},g=function(t,e,n,a){if(n||void 0!==e.defaultText&&(t=e.defaultText),"translate"===a){(n||!n&&!S.isKeepContent()&&void 0===u.translateKeepContent)&&l.empty().append(e.preText+t+e.postText);var r=S.isPostCompilingEnabled(),i=void 0!==h.translateCompile,s=i&&"false"!==h.translateCompile;(r&&!i||s)&&j(l.contents())(e)}else{var o=u.$attr[a];"data-"===o.substr(0,5)&&(o=o.substr(5)),o=o.substr(15),l.attr(o,t)}};(d||$||u.translateDefault)&&r.$watch("interpolateParams",c,!0),r.$on("translateLanguageChanged",c);var p=C.$on("$translateChangeSuccess",c);l.text().length?u.translate?s(u.translate):s(""):u.translate&&s(u.translate),c(),r.$on("$destroy",p)}}}}function r(u,c){"use strict";return{restrict:"A",priority:u.directivePriority(),link:function(n,a,r){var i,s,o,l={},t=function(){angular.forEach(i,function(t,e){t&&(l[e]=!0,n.translateNamespace&&"."===t.charAt(0)&&(t=n.translateNamespace+t),u(t,s,r.translateInterpolation,void 0,n.translateLanguage,o).then(function(t){a.attr(e,t)},function(t){a.attr(e,t)}))}),angular.forEach(l,function(t,e){i[e]||(a.removeAttr(e),delete l[e])})};f(n,r.translateAttr,function(t){i=t},t),f(n,r.translateValues,function(t){s=t},t),f(n,r.translateSanitizeStrategy,function(t){o=t},t),r.translateValues&&n.$watch(r.translateValues,t,!0),n.$on("translateLanguageChanged",t);var e=c.$on("$translateChangeSuccess",t);t(),n.$on("$destroy",e)}}}function f(t,e,n,a){"use strict";e&&("::"===e.substr(0,2)?e=e.substr(2):t.$watch(e,function(t){n(t),a()},!0),n(t.$eval(e)))}function i(s,o){"use strict";return{compile:function(t){var i=function(t){t.addClass(s.cloakClassName())};return i(t),function(t,e,n){var a=function(t){t.removeClass(s.cloakClassName())}.bind(this,e),r=i.bind(this,e);n.translateCloak&&n.translateCloak.length?(n.$observe("translateCloak",function(t){s(t).then(a,r)}),o.$on("$translateChangeSuccess",function(){s(n.translateCloak).then(a,r)})):s.onReady(a)}}}}function s(){"use strict";return{restrict:"A",scope:!0,compile:function(){return{pre:function(t,e,n){t.translateNamespace=function t(e){if(e.translateNamespace)return e.translateNamespace;if(e.$parent)return t(e.$parent)}(t),t.translateNamespace&&"."===n.translateNamespace.charAt(0)?t.translateNamespace+=n.translateNamespace:t.translateNamespace=n.translateNamespace}}}}}function o(){"use strict";return{restrict:"A",scope:!0,compile:function(){return function(e,t,n){n.$observe("translateLanguage",function(t){e.translateLanguage=t}),e.$watch("translateLanguage",function(){e.$broadcast("translateLanguageChanged")})}}}}function l(i,s){"use strict";var t=function(t,e,n,a){if(!angular.isObject(e)){var r=this||{__SCOPE_IS_NOT_AVAILABLE:"More info at https://github.com/angular/angular.js/commit/8863b9d04c722b278fa93c5d66ad1e578ad6eb1f"};e=i(e)(r)}return s.instant(t,e,n,a)};return s.statefulFilter()&&(t.$stateful=!0),t}function u(t){"use strict";return t("translations")}return t.$inject=["$translate"],e.$inject=["$STORAGE_KEY","$windowProvider","$translateSanitizationProvider","pascalprechtTranslateOverrider"],n.$inject=["$interpolate","$translateSanitization"],a.$inject=["$translate","$interpolate","$compile","$parse","$rootScope"],r.$inject=["$translate","$rootScope"],i.$inject=["$translate","$rootScope"],l.$inject=["$parse","$translate"],u.$inject=["$cacheFactory"],angular.module("pascalprecht.translate",["ng"]).run(t),t.displayName="runTranslate",angular.module("pascalprecht.translate").provider("$translateSanitization",function(){"use strict";var n,a,g,p=null,h=!1,d=!1;(g={sanitize:function(t,e){return"text"===e&&(t=i(t)),t},escape:function(t,e){return"text"===e&&(t=r(t)),t},sanitizeParameters:function(t,e){return"params"===e&&(t=o(t,i)),t},escapeParameters:function(t,e){return"params"===e&&(t=o(t,r)),t},sce:function(t,e,n){return"text"===e?t=s(t):"params"===e&&"filter"!==n&&(t=o(t,r)),t},sceParameters:function(t,e){return"params"===e&&(t=o(t,s)),t}}).escaped=g.escapeParameters,this.addStrategy=function(t,e){return g[t]=e,this},this.removeStrategy=function(t){return delete g[t],this},this.useStrategy=function(t){return h=!0,p=t,this},this.$get=["$injector","$log",function(u,c){var e,f={};return u.has("$sanitize")&&(n=u.get("$sanitize")),u.has("$sce")&&(a=u.get("$sce")),{useStrategy:(e=this,function(t){e.useStrategy(t)}),sanitize:function(t,e,n,a){if(p||h||d||(c.warn("pascalprecht.translate.$translateSanitization: No sanitization strategy has been configured. This can have serious security implications. See http://angular-translate.github.io/docs/#/guide/19_security for details."),d=!0),n||null===n||(n=p),!n)return t;a||(a="service");var r,i,s,o,l=angular.isArray(n)?n:[n];return r=t,i=e,s=a,o=l,angular.forEach(o,function(e){if(angular.isFunction(e))r=e(r,i,s);else if(angular.isFunction(g[e]))r=g[e](r,i,s);else{if(!angular.isString(g[e]))throw new Error("pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: '"+e+"'");if(!f[g[e]])try{f[g[e]]=u.get(g[e])}catch(t){throw f[g[e]]=function(){},new Error("pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: '"+e+"'")}r=f[g[e]](r,i,s)}}),r}}}];var r=function(t){var e=angular.element("<div></div>");return e.text(t),e.html()},i=function(t){if(!n)throw new Error("pascalprecht.translate.$translateSanitization: Error cannot find $sanitize service. Either include the ngSanitize module (https://docs.angularjs.org/api/ngSanitize) or use a sanitization strategy which does not depend on $sanitize, such as 'escape'.");return n(t)},s=function(t){if(!a)throw new Error("pascalprecht.translate.$translateSanitization: Error cannot find $sce service.");return a.trustAsHtml(t)},o=function(t,n,a){if(angular.isDate(t))return t;if(angular.isObject(t)){var r=angular.isArray(t)?[]:{};if(a){if(-1<a.indexOf(t))throw new Error("pascalprecht.translate.$translateSanitization: Error cannot interpolate parameter due recursive object")}else a=[];return a.push(t),angular.forEach(t,function(t,e){angular.isFunction(t)||(r[e]=o(t,n,a))}),a.splice(-1,1),r}return angular.isNumber(t)?t:!0===t||!1===t?t:angular.isUndefined(t)||null===t?t:n(t)}}),angular.module("pascalprecht.translate").constant("pascalprechtTranslateOverrider",{}).provider("$translate",e),e.displayName="displayName",angular.module("pascalprecht.translate").factory("$translateDefaultInterpolation",n),n.displayName="$translateDefaultInterpolation",angular.module("pascalprecht.translate").constant("$STORAGE_KEY","NG_TRANSLATE_LANG_KEY"),angular.module("pascalprecht.translate").directive("translate",a),a.displayName="translateDirective",angular.module("pascalprecht.translate").directive("translateAttr",r),r.displayName="translateAttrDirective",angular.module("pascalprecht.translate").directive("translateCloak",i),i.displayName="translateCloakDirective",angular.module("pascalprecht.translate").directive("translateNamespace",s),s.displayName="translateNamespaceDirective",angular.module("pascalprecht.translate").directive("translateLanguage",o),o.displayName="translateLanguageDirective",angular.module("pascalprecht.translate").filter("translate",l),l.displayName="translateFilterFactory",angular.module("pascalprecht.translate").factory("$translationCache",u),u.displayName="$translationCache","pascalprecht.translate"});
/*! * angular-translate - v2.18.1 - 2018-05-19 * * Copyright (c) 2018 The angular-translate team, Pascal Precht; Licensed MIT */ !function(t,e){"function"==typeof define&&define.amd?define([],function(){return e()}):"object"==typeof module&&module.exports?module.exports=e():e()}(0,function(){function t(e){"use strict";var n=e.storageKey(),a=e.storage(),t=function(){var t=e.preferredLanguage();angular.isString(t)?e.use(t):a.put(n,e.use())};t.displayName="fallbackFromIncorrectStorageValue",a?a.get(n)?e.use(a.get(n)).catch(t):t():angular.isString(e.preferredLanguage())&&e.use(e.preferredLanguage())}function e(t,r,e,i){"use strict";var z,c,T,x,F,I,_,n,V,R,D,K,U,M,H,G,q={},Y=[],B=t,J=[],Q="translate-cloak",W=!1,X=!1,Z=".",tt=!1,et=!1,nt=0,at=!0,a="default",s={default:function(t){return(t||"").split("-").join("_")},java:function(t){var e=(t||"").split("-").join("_"),n=e.split("_");return 1<n.length?n[0].toLowerCase()+"_"+n[1].toUpperCase():e},bcp47:function(t){var e=(t||"").split("_").join("-"),n=e.split("-");switch(n.length){case 1:n[0]=n[0].toLowerCase();break;case 2:n[0]=n[0].toLowerCase(),4===n[1].length?n[1]=n[1].charAt(0).toUpperCase()+n[1].slice(1).toLowerCase():n[1]=n[1].toUpperCase();break;case 3:n[0]=n[0].toLowerCase(),n[1]=n[1].charAt(0).toUpperCase()+n[1].slice(1).toLowerCase(),n[2]=n[2].toUpperCase();break;default:return e}return n.join("-")},"iso639-1":function(t){return(t||"").split("_").join("-").split("-")[0].toLowerCase()}},o=function(){if(angular.isFunction(i.getLocale))return i.getLocale();var t,e,n=r.$get().navigator,a=["language","browserLanguage","systemLanguage","userLanguage"];if(angular.isArray(n.languages))for(t=0;t<n.languages.length;t++)if((e=n.languages[t])&&e.length)return e;for(t=0;t<a.length;t++)if((e=n[a[t]])&&e.length)return e;return null};o.displayName="angular-translate/service: getFirstBrowserLanguage";var rt=function(){var t=o()||"";return s[a]&&(t=s[a](t)),t};rt.displayName="angular-translate/service: getLocale";var it=function(t,e){for(var n=0,a=t.length;n<a;n++)if(t[n]===e)return n;return-1},st=function(){return this.toString().replace(/^\s+|\s+$/g,"")},f=function(t){return angular.isString(t)?t.toLowerCase():t},ot=function(t){if(t){for(var e,n=[],a=f(t),r=0,i=Y.length;r<i;r++)n.push(f(Y[r]));if(-1<(r=it(n,a)))return Y[r];if(c)for(var s in c)if(c.hasOwnProperty(s)){var o=!1,l=Object.prototype.hasOwnProperty.call(c,s)&&f(s)===f(t);if("*"===s.slice(-1)&&(o=f(s.slice(0,-1))===f(t.slice(0,s.length-1))),(l||o)&&(e=c[s],-1<it(n,f(e))))return e}var u=t.split("_");return 1<u.length&&-1<it(n,f(u[0]))?u[0]:void 0}},lt=function(t,e){if(!t&&!e)return q;if(t&&!e){if(angular.isString(t))return q[t]}else angular.isObject(q[t])||(q[t]={}),angular.extend(q[t],ut(e));return this};this.translations=lt,this.cloakClassName=function(t){return t?(Q=t,this):Q},this.nestedObjectDelimeter=function(t){return t?(Z=t,this):Z};var ut=function(t,e,n,a){var r,i,s;for(r in e||(e=[]),n||(n={}),t)Object.prototype.hasOwnProperty.call(t,r)&&(s=t[r],angular.isObject(s)?ut(s,e.concat(r),n,r):(i=e.length?""+e.join(Z)+Z+r:r,e.length&&r===a&&(n[""+e.join(Z)]="@:"+i),n[i]=s));return n};ut.displayName="flatObject",this.addInterpolation=function(t){return J.push(t),this},this.useMessageFormatInterpolation=function(){return this.useInterpolation("$translateMessageFormatInterpolation")},this.useInterpolation=function(t){return R=t,this},this.useSanitizeValueStrategy=function(t){return e.useStrategy(t),this},this.preferredLanguage=function(t){return t?(ct(t),this):z};var ct=function(t){return t&&(z=t),z};this.translationNotFoundIndicator=function(t){return this.translationNotFoundIndicatorLeft(t),this.translationNotFoundIndicatorRight(t),this},this.translationNotFoundIndicatorLeft=function(t){return t?(U=t,this):U},this.translationNotFoundIndicatorRight=function(t){return t?(M=t,this):M},this.fallbackLanguage=function(t){return ft(t),this};var ft=function(t){return t?(angular.isString(t)?(x=!0,T=[t]):angular.isArray(t)&&(x=!1,T=t),angular.isString(z)&&it(T,z)<0&&T.push(z),this):x?T[0]:T};this.use=function(t){if(t){if(!q[t]&&!D)throw new Error("$translateProvider couldn't find translationTable for langKey: '"+t+"'");return F=t,this}return F},this.resolveClientLocale=function(){return rt()};var gt=function(t){return t?(B=t,this):n?n+B:B};this.storageKey=gt,this.useUrlLoader=function(t,e){return this.useLoader("$translateUrlLoader",angular.extend({url:t},e))},this.useStaticFilesLoader=function(t){return this.useLoader("$translateStaticFilesLoader",t)},this.useLoader=function(t,e){return D=t,K=e||{},this},this.useLocalStorage=function(){return this.useStorage("$translateLocalStorage")},this.useCookieStorage=function(){return this.useStorage("$translateCookieStorage")},this.useStorage=function(t){return _=t,this},this.storagePrefix=function(t){return t?(n=t,this):t},this.useMissingTranslationHandlerLog=function(){return this.useMissingTranslationHandler("$translateMissingTranslationHandlerLog")},this.useMissingTranslationHandler=function(t){return V=t,this},this.usePostCompiling=function(t){return W=!!t,this},this.forceAsyncReload=function(t){return X=!!t,this},this.uniformLanguageTag=function(t){return t?angular.isString(t)&&(t={standard:t}):t={},a=t.standard,this},this.determinePreferredLanguage=function(t){var e=t&&angular.isFunction(t)?t():rt();return z=Y.length&&ot(e)||e,this},this.registerAvailableLanguageKeys=function(t,e){return t?(Y=t,e&&(c=e),this):Y},this.useLoaderCache=function(t){return!1===t?H=void 0:!0===t?H=!0:void 0===t?H="$translationCache":t&&(H=t),this},this.directivePriority=function(t){return void 0===t?nt:(nt=t,this)},this.statefulFilter=function(t){return void 0===t?at:(at=t,this)},this.postProcess=function(t){return G=t||void 0,this},this.keepContent=function(t){return et=!!t,this},this.$get=["$log","$injector","$rootScope","$q",function(t,o,s,m){var i,$,y,b=o.get(R||"$translateDefaultInterpolation"),S=!1,L={},f={},j=function(t,s,o,l,u,c){!F&&z&&(F=z);var a=u&&u!==F?ot(u)||u:F;if(u&&v(u),angular.isArray(t)){return function(t){for(var a={},e=[],n=function(e){var n=m.defer(),t=function(t){a[e]=t,n.resolve([e,t])};return j(e,s,o,l,u,c).then(t,t),n.promise},r=0,i=t.length;r<i;r++)e.push(n(t[r]));return m.all(e).then(function(){return a})}(t)}var e=m.defer();t&&(t=st.apply(t));var n=function(){var t=f[a]||f[z];if($=0,_&&!t){var e=i.get(B);if(t=f[e],T&&T.length){var n=it(T,e);$=0===n?1:0,it(T,z)<0&&T.push(z)}}return t}();if(n){var r=function(){u||(a=F),h(t,s,o,l,a,c).then(e.resolve,e.reject)};r.displayName="promiseResolved",n.finally(r).catch(angular.noop)}else h(t,s,o,l,a,c).then(e.resolve,e.reject);return e.promise},w=function(t){return U&&(t=[U,t].join(" ")),M&&(t=[t,M].join(" ")),t},l=function(t){F=t,_&&i.put(j.storageKey(),F),s.$emit("$translateChangeSuccess",{language:t}),b.setLocale(F);var e=function(t,e){L[e].setLocale(F)};e.displayName="eachInterpolatorLocaleSetter",angular.forEach(L,e),s.$emit("$translateChangeEnd",{language:t})},u=function(n){if(!n)throw"No language key specified for loading.";var a=m.defer();s.$emit("$translateLoadingStart",{language:n}),S=!0;var t=H;"string"==typeof t&&(t=o.get(t));var e=angular.extend({},K,{key:n,$http:angular.extend({},{cache:t},K.$http)}),r=function(t){var e={};s.$emit("$translateLoadingSuccess",{language:n}),angular.isArray(t)?angular.forEach(t,function(t){angular.extend(e,ut(t))}):angular.extend(e,ut(t)),S=!1,a.resolve({key:n,table:e}),s.$emit("$translateLoadingEnd",{language:n})};r.displayName="onLoaderSuccess";var i=function(t){s.$emit("$translateLoadingError",{language:t}),a.reject(t),s.$emit("$translateLoadingEnd",{language:t})};return i.displayName="onLoaderError",o.get(D)(e).then(r,i),a.promise};if(_&&(!(i=o.get(_)).get||!i.put))throw new Error("Couldn't use storage '"+_+"', missing get() or put() method!");if(J.length){var e=function(t){var e=o.get(t);e.setLocale(z||F),L[e.getInterpolationIdentifier()]=e};e.displayName="interpolationFactoryAdder",angular.forEach(J,e)}var c=function(a,r,i,s,o){var l=m.defer(),t=function(t){if(Object.prototype.hasOwnProperty.call(t,r)&&null!==t[r]){s.setLocale(a);var e=t[r];if("@:"===e.substr(0,2))c(a,e.substr(2),i,s,o).then(l.resolve,l.reject);else{var n=s.interpolate(t[r],i,"service",o,r);n=O(r,t[r],n,i,a),l.resolve(n)}s.setLocale(F)}else l.reject()};return t.displayName="fallbackTranslationResolver",function(t){var e=m.defer();if(Object.prototype.hasOwnProperty.call(q,t))e.resolve(q[t]);else if(f[t]){var n=function(t){lt(t.key,t.table),e.resolve(t.table)};n.displayName="translationTableResolver",f[t].then(n,e.reject)}else e.reject();return e.promise}(a).then(t,l.reject),l.promise},g=function(t,e,n,a,r){var i,s=q[t];if(s&&Object.prototype.hasOwnProperty.call(s,e)&&null!==s[e]){if(a.setLocale(t),i=a.interpolate(s[e],n,"filter",r,e),i=O(e,s[e],i,n,t,r),!angular.isString(i)&&angular.isFunction(i.$$unwrapTrustedValue)){var o=i.$$unwrapTrustedValue();if("@:"===o.substr(0,2))return g(t,o.substr(2),n,a,r)}else if("@:"===i.substr(0,2))return g(t,i.substr(2),n,a,r);a.setLocale(F)}return i},C=function(t,e,n,a){return V?o.get(V)(t,F,e,n,a):t},N=function(t,e,n,a,r,i){var s=m.defer();if(t<T.length){var o=T[t];c(o,e,n,a,i).then(function(t){s.resolve(t)},function(){return N(t+1,e,n,a,r,i).then(s.resolve,s.reject)})}else if(r)s.resolve(r);else{var l=C(e,n,r);V&&l?s.resolve(l):s.reject(w(e))}return s.promise},p=function(t,e,n,a,r){var i;if(t<T.length){var s=T[t];(i=g(s,e,n,a,r))||""===i||(i=p(t+1,e,n,a))}return i},h=function(t,e,n,a,r,i){var s,o,l,u,c,f=m.defer(),g=r?q[r]:q,p=n?L[n]:b;if(g&&Object.prototype.hasOwnProperty.call(g,t)&&null!==g[t]){var h=g[t];if("@:"===h.substr(0,2))j(h.substr(2),e,n,a,r,i).then(f.resolve,f.reject);else{var d=p.interpolate(h,e,"service",i,t);d=O(t,h,d,e,r),f.resolve(d)}}else{var v;V&&!S&&(v=C(t,e,a)),r&&T&&T.length?(s=t,o=e,l=p,u=a,c=i,N(0<y?y:$,s,o,l,u,c)).then(function(t){f.resolve(t)},function(t){f.reject(w(t))}):V&&!S&&v?a?f.resolve(a):f.resolve(v):a?f.resolve(a):f.reject(w(t))}return f.promise},d=function(t,e,n,a,r){var i,s=a?q[a]:q,o=b;if(L&&Object.prototype.hasOwnProperty.call(L,n)&&(o=L[n]),s&&Object.prototype.hasOwnProperty.call(s,t)&&null!==s[t]){var l=s[t];"@:"===l.substr(0,2)?i=d(l.substr(2),e,n,a,r):(i=o.interpolate(l,e,"filter",r,t),i=O(t,l,i,e,a,r))}else{var u;V&&!S&&(u=C(t,e,r)),i=a&&T&&T.length?p(($=0)<y?y:$,t,e,o,r):V&&!S&&u?u:w(t)}return i},O=function(t,e,n,a,r,i){var s=G;return s&&("string"==typeof s&&(s=o.get(s)),s)?s(t,e,n,a,r,i):n},v=function(t){q[t]||!D||f[t]||(f[t]=u(t).then(function(t){return lt(t.key,t.table),t}))};j.preferredLanguage=function(t){return t&&ct(t),z},j.cloakClassName=function(){return Q},j.nestedObjectDelimeter=function(){return Z},j.fallbackLanguage=function(t){if(null!=t){if(ft(t),D&&T&&T.length)for(var e=0,n=T.length;e<n;e++)f[T[e]]||(f[T[e]]=u(T[e]));j.use(j.use())}return x?T[0]:T},j.useFallbackLanguage=function(t){if(null!=t)if(t){var e=it(T,t);-1<e&&(y=e)}else y=0},j.proposedLanguage=function(){return I},j.storage=function(){return i},j.negotiateLocale=ot,j.use=function(e){if(!e)return F;var n=m.defer();n.promise.then(null,angular.noop),s.$emit("$translateChangeStart",{language:e});var t=ot(e);return 0<Y.length&&!t?m.reject(e):(t&&(e=t),I=e,!X&&q[e]||!D||f[e]?f[e]?f[e].then(function(t){return I===t.key&&l(t.key),n.resolve(t.key),t},function(t){return!F&&T&&0<T.length&&T[0]!==t?j.use(T[0]).then(n.resolve,n.reject):n.reject(t)}):(n.resolve(e),l(e)):(f[e]=u(e).then(function(t){return lt(t.key,t.table),n.resolve(t.key),I===e&&l(t.key),t},function(t){return s.$emit("$translateChangeError",{language:t}),n.reject(t),s.$emit("$translateChangeEnd",{language:t}),m.reject(t)}),f[e].finally(function(){var t;I===(t=e)&&(I=void 0),f[t]=void 0}).catch(angular.noop)),n.promise)},j.resolveClientLocale=function(){return rt()},j.storageKey=function(){return gt()},j.isPostCompilingEnabled=function(){return W},j.isForceAsyncReloadEnabled=function(){return X},j.isKeepContent=function(){return et},j.refresh=function(t){if(!D)throw new Error("Couldn't refresh translation table, no loader registered!");s.$emit("$translateRefreshStart",{language:t});var e=m.defer(),n={};function a(e){var t=u(e);return(f[e]=t).then(function(t){q[e]={},lt(e,t.table),n[e]=!0},angular.noop),t}if(e.promise.then(function(){for(var t in q)q.hasOwnProperty(t)&&(t in n||delete q[t]);F&&l(F)},angular.noop).finally(function(){s.$emit("$translateRefreshEnd",{language:t})}),t)q[t]?a(t).then(e.resolve,e.reject):e.reject();else{var r=T&&T.slice()||[];F&&-1===r.indexOf(F)&&r.push(F),m.all(r.map(a)).then(e.resolve,e.reject)}return e.promise},j.instant=function(t,e,n,a,r){var i=a&&a!==F?ot(a)||a:F;if(null===t||angular.isUndefined(t))return t;if(a&&v(a),angular.isArray(t)){for(var s={},o=0,l=t.length;o<l;o++)s[t[o]]=j.instant(t[o],e,n,a,r);return s}if(angular.isString(t)&&t.length<1)return t;t&&(t=st.apply(t));var u,c,f=[];z&&f.push(z),i&&f.push(i),T&&T.length&&(f=f.concat(T));for(var g=0,p=f.length;g<p;g++){var h=f[g];if(q[h]&&void 0!==q[h][t]&&(u=d(t,e,n,i,r)),void 0!==u)break}u||""===u||(U||M?u=w(t):(u=b.interpolate(t,e,"filter",r),V&&!S&&(c=C(t,e,r)),V&&!S&&c&&(u=c)));return u},j.versionInfo=function(){return"2.18.1"},j.loaderCache=function(){return H},j.directivePriority=function(){return nt},j.statefulFilter=function(){return at},j.isReady=function(){return tt};var n=m.defer();n.promise.then(function(){tt=!0}),j.onReady=function(t){var e=m.defer();return angular.isFunction(t)&&e.promise.then(t),tt?e.resolve():n.promise.then(e.resolve),e.promise},j.getAvailableLanguageKeys=function(){return 0<Y.length?Y:null},j.getTranslationTable=function(t){return(t=t||j.use())&&q[t]?angular.copy(q[t]):null};var a=s.$on("$translateReady",function(){n.resolve(),a(),a=null}),r=s.$on("$translateChangeEnd",function(){n.resolve(),r(),r=null});if(D){if(angular.equals(q,{})&&j.use()&&j.use(j.use()),T&&T.length)for(var E=function(t){return lt(t.key,t.table),s.$emit("$translateChangeEnd",{language:t.key}),t},k=0,P=T.length;k<P;k++){var A=T[k];!X&&q[A]||(f[A]=u(A).then(E))}}else s.$emit("$translateReady",{language:j.use()});return j}]}function n(s,o){"use strict";var t={};return t.setLocale=function(t){t},t.getInterpolationIdentifier=function(){return"default"},t.useSanitizeValueStrategy=function(t){return o.useStrategy(t),this},t.interpolate=function(t,e,n,a,r){var i;return e=e||{},e=o.sanitize(e,"params",a,n),angular.isNumber(t)?i=""+t:angular.isString(t)?(i=s(t)(e),i=o.sanitize(i,"text",a,n)):i="",i},t}function a(S,L,j,w,C){"use strict";var N=function(t){return angular.isString(t)?t.toLowerCase():t};return{restrict:"AE",scope:!0,priority:S.directivePriority(),compile:function(t,h){var d=h.translateValues?h.translateValues:void 0,v=h.translateInterpolation?h.translateInterpolation:void 0,m=h.translateSanitizeStrategy?h.translateSanitizeStrategy:void 0,$=t[0].outerHTML.match(/translate-value-+/i),y="^(.*)("+L.startSymbol()+".*"+L.endSymbol()+")(.*)",b="^(.*)"+L.startSymbol()+"(.*)"+L.endSymbol()+"(.*)";return function(r,l,u){r.interpolateParams={},r.preText="",r.postText="",r.translateNamespace=function t(e){if(e.translateNamespace)return e.translateNamespace;if(e.$parent)return t(e.$parent)}(r);var i={},s=function(t){if(angular.isFunction(s._unwatchOld)&&(s._unwatchOld(),s._unwatchOld=void 0),angular.equals(t,"")||!angular.isDefined(t)){var e=function(){return this.toString().replace(/^\s+|\s+$/g,"")}.apply(l.text()),n=e.match(y);if(angular.isArray(n)){r.preText=n[1],r.postText=n[3],i.translate=L(n[2])(r.$parent);var a=e.match(b);angular.isArray(a)&&a[2]&&a[2].length&&(s._unwatchOld=r.$watch(a[2],function(t){i.translate=t,c()}))}else i.translate=e||void 0}else i.translate=t;c()},t=function(e){u.$observe(e,function(t){i[e]=t,c()})};!function(t,e,n){if(e.translateValues&&angular.extend(t,w(e.translateValues)(r.$parent)),$)for(var a in n)Object.prototype.hasOwnProperty.call(e,a)&&"translateValue"===a.substr(0,14)&&"translateValues"!==a&&(t[N(a.substr(14,1))+a.substr(15)]=n[a])}(r.interpolateParams,u,h);var e=!0;for(var n in u.$observe("translate",function(t){void 0===t?s(""):""===t&&e||(i.translate=t,c()),e=!1}),u)u.hasOwnProperty(n)&&"translateAttr"===n.substr(0,13)&&13<n.length&&t(n);if(u.$observe("translateDefault",function(t){r.defaultText=t,c()}),m&&u.$observe("translateSanitizeStrategy",function(t){r.sanitizeStrategy=w(t)(r.$parent),c()}),d&&u.$observe("translateValues",function(t){t&&r.$parent.$watch(function(){angular.extend(r.interpolateParams,w(t)(r.$parent))})}),$){var a=function(n){u.$observe(n,function(t){var e=N(n.substr(14,1))+n.substr(15);r.interpolateParams[e]=t})};for(var o in u)Object.prototype.hasOwnProperty.call(u,o)&&"translateValue"===o.substr(0,14)&&"translateValues"!==o&&a(o)}var c=function(){for(var t in i)i.hasOwnProperty(t)&&void 0!==i[t]&&f(t,i[t],r,r.interpolateParams,r.defaultText,r.translateNamespace)},f=function(e,t,n,a,r,i){t?(i&&"."===t.charAt(0)&&(t=i+t),S(t,a,v,r,n.translateLanguage,n.sanitizeStrategy).then(function(t){g(t,n,!0,e)},function(t){g(t,n,!1,e)})):g(t,n,!1,e)},g=function(t,e,n,a){if(n||void 0!==e.defaultText&&(t=e.defaultText),"translate"===a){(n||!n&&!S.isKeepContent()&&void 0===u.translateKeepContent)&&l.empty().append(e.preText+t+e.postText);var r=S.isPostCompilingEnabled(),i=void 0!==h.translateCompile,s=i&&"false"!==h.translateCompile;(r&&!i||s)&&j(l.contents())(e)}else{var o=u.$attr[a];"data-"===o.substr(0,5)&&(o=o.substr(5)),o=o.substr(15),l.attr(o,t)}};(d||$||u.translateDefault)&&r.$watch("interpolateParams",c,!0),r.$on("translateLanguageChanged",c);var p=C.$on("$translateChangeSuccess",c);l.text().length?u.translate?s(u.translate):s(""):u.translate&&s(u.translate),c(),r.$on("$destroy",p)}}}}function r(u,c){"use strict";return{restrict:"A",priority:u.directivePriority(),link:function(n,a,r){var i,s,o,l={},t=function(){angular.forEach(i,function(t,e){t&&(l[e]=!0,n.translateNamespace&&"."===t.charAt(0)&&(t=n.translateNamespace+t),u(t,s,r.translateInterpolation,void 0,n.translateLanguage,o).then(function(t){a.attr(e,t)},function(t){a.attr(e,t)}))}),angular.forEach(l,function(t,e){i[e]||(a.removeAttr(e),delete l[e])})};f(n,r.translateAttr,function(t){i=t},t),f(n,r.translateValues,function(t){s=t},t),f(n,r.translateSanitizeStrategy,function(t){o=t},t),r.translateValues&&n.$watch(r.translateValues,t,!0),n.$on("translateLanguageChanged",t);var e=c.$on("$translateChangeSuccess",t);t(),n.$on("$destroy",e)}}}function f(t,e,n,a){"use strict";e&&("::"===e.substr(0,2)?e=e.substr(2):t.$watch(e,function(t){n(t),a()},!0),n(t.$eval(e)))}function i(s,o){"use strict";return{compile:function(t){var i=function(t){t.addClass(s.cloakClassName())};return i(t),function(t,e,n){var a=function(t){t.removeClass(s.cloakClassName())}.bind(this,e),r=i.bind(this,e);n.translateCloak&&n.translateCloak.length?(n.$observe("translateCloak",function(t){s(t).then(a,r)}),o.$on("$translateChangeSuccess",function(){s(n.translateCloak).then(a,r)})):s.onReady(a)}}}}function s(){"use strict";return{restrict:"A",scope:!0,compile:function(){return{pre:function(t,e,n){t.translateNamespace=function t(e){if(e.translateNamespace)return e.translateNamespace;if(e.$parent)return t(e.$parent)}(t),t.translateNamespace&&"."===n.translateNamespace.charAt(0)?t.translateNamespace+=n.translateNamespace:t.translateNamespace=n.translateNamespace}}}}}function o(){"use strict";return{restrict:"A",scope:!0,compile:function(){return function(e,t,n){n.$observe("translateLanguage",function(t){e.translateLanguage=t}),e.$watch("translateLanguage",function(){e.$broadcast("translateLanguageChanged")})}}}}function l(i,s){"use strict";var t=function(t,e,n,a){if(!angular.isObject(e)){var r=this||{__SCOPE_IS_NOT_AVAILABLE:"More info at https://github.com/angular/angular.js/commit/8863b9d04c722b278fa93c5d66ad1e578ad6eb1f"};e=i(e)(r)}return s.instant(t,e,n,a)};return s.statefulFilter()&&(t.$stateful=!0),t}function u(t){"use strict";return t("translations")}return t.$inject=["$translate"],e.$inject=["$STORAGE_KEY","$windowProvider","$translateSanitizationProvider","pascalprechtTranslateOverrider"],n.$inject=["$interpolate","$translateSanitization"],a.$inject=["$translate","$interpolate","$compile","$parse","$rootScope"],r.$inject=["$translate","$rootScope"],i.$inject=["$translate","$rootScope"],l.$inject=["$parse","$translate"],u.$inject=["$cacheFactory"],angular.module("pascalprecht.translate",["ng"]).run(t),t.displayName="runTranslate",angular.module("pascalprecht.translate").provider("$translateSanitization",function(){"use strict";var n,a,g,p=null,h=!1,d=!1;(g={sanitize:function(t,e){return"text"===e&&(t=i(t)),t},escape:function(t,e){return"text"===e&&(t=r(t)),t},sanitizeParameters:function(t,e){return"params"===e&&(t=o(t,i)),t},escapeParameters:function(t,e){return"params"===e&&(t=o(t,r)),t},sce:function(t,e,n){return"text"===e?t=s(t):"params"===e&&"filter"!==n&&(t=o(t,r)),t},sceParameters:function(t,e){return"params"===e&&(t=o(t,s)),t}}).escaped=g.escapeParameters,this.addStrategy=function(t,e){return g[t]=e,this},this.removeStrategy=function(t){return delete g[t],this},this.useStrategy=function(t){return h=!0,p=t,this},this.$get=["$injector","$log",function(u,c){var e,f={};return u.has("$sanitize")&&(n=u.get("$sanitize")),u.has("$sce")&&(a=u.get("$sce")),{useStrategy:(e=this,function(t){e.useStrategy(t)}),sanitize:function(t,e,n,a){if(p||h||d||(c.warn("pascalprecht.translate.$translateSanitization: No sanitization strategy has been configured. This can have serious security implications. See http://angular-translate.github.io/docs/#/guide/19_security for details."),d=!0),n||null===n||(n=p),!n)return t;a||(a="service");var r,i,s,o,l=angular.isArray(n)?n:[n];return r=t,i=e,s=a,o=l,angular.forEach(o,function(e){if(angular.isFunction(e))r=e(r,i,s);else if(angular.isFunction(g[e]))r=g[e](r,i,s);else{if(!angular.isString(g[e]))throw new Error("pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: '"+e+"'");if(!f[g[e]])try{f[g[e]]=u.get(g[e])}catch(t){throw f[g[e]]=function(){},new Error("pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: '"+e+"'")}r=f[g[e]](r,i,s)}}),r}}}];var r=function(t){var e=angular.element("<div></div>");return e.text(t),e.html()},i=function(t){if(!n)throw new Error("pascalprecht.translate.$translateSanitization: Error cannot find $sanitize service. Either include the ngSanitize module (https://docs.angularjs.org/api/ngSanitize) or use a sanitization strategy which does not depend on $sanitize, such as 'escape'.");return n(t)},s=function(t){if(!a)throw new Error("pascalprecht.translate.$translateSanitization: Error cannot find $sce service.");return a.trustAsHtml(t)},o=function(t,n,a){if(angular.isDate(t))return t;if(angular.isObject(t)){var r=angular.isArray(t)?[]:{};if(a){if(-1<a.indexOf(t))throw new Error("pascalprecht.translate.$translateSanitization: Error cannot interpolate parameter due recursive object")}else a=[];return a.push(t),angular.forEach(t,function(t,e){angular.isFunction(t)||(r[e]=o(t,n,a))}),a.splice(-1,1),r}return angular.isNumber(t)?t:!0===t||!1===t?t:angular.isUndefined(t)||null===t?t:n(t)}}),angular.module("pascalprecht.translate").constant("pascalprechtTranslateOverrider",{}).provider("$translate",e),e.displayName="displayName",angular.module("pascalprecht.translate").factory("$translateDefaultInterpolation",n),n.displayName="$translateDefaultInterpolation",angular.module("pascalprecht.translate").constant("$STORAGE_KEY","NG_TRANSLATE_LANG_KEY"),angular.module("pascalprecht.translate").directive("translate",a),a.displayName="translateDirective",angular.module("pascalprecht.translate").directive("translateAttr",r),r.displayName="translateAttrDirective",angular.module("pascalprecht.translate").directive("translateCloak",i),i.displayName="translateCloakDirective",angular.module("pascalprecht.translate").directive("translateNamespace",s),s.displayName="translateNamespaceDirective",angular.module("pascalprecht.translate").directive("translateLanguage",o),o.displayName="translateLanguageDirective",angular.module("pascalprecht.translate").filter("translate",l),l.displayName="translateFilterFactory",angular.module("pascalprecht.translate").factory("$translationCache",u),u.displayName="$translationCache","pascalprecht.translate"});
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./doc/images/gray-release/master-branch-instance-list.png
PNG  IHDRe IDATx ř{S[/o7d7lvfoW0QO@<Akf9fƁ~ŧުooOާBD"a " " " " " " " " " ]@˔Dp$B.F G"l˖-VUUeV8hԺwn=zP(q +%Bӯ Ԣ " " " "lǭa ȊRD@leeې!C$emM*{<U)" " " " fn:#DU!" L*x^ڶnj{3(9^s &Pj8p9/? = SD@C|{e=E@ߞ"twK#x֬YmYge99{Inڴy:u{L)t:|Sx~m۶u d1UXD&d}[mmn~a"|oذ!0>|~}Q(FrCo߾vYO>Ϳ0l0g򴭊SO=ep-+++½j$" " " DZ%#" ]._*`;яI4|u3͋l (--mDw٥֭[Zq#`}8#H$\~8Bc .8l_jÈG~!sOÿf?<@x53Y6駟>{jKijd?[UUWgW^yڐiPx EͻB>y'!X|OĩAᮜdD+V!" B2Wy~9I/1 v1x)4|M裏9<L'2/_W'y6a/2L~T)"q~SFl1c8sܨud-[fk׮Ebۚ5klȑG/5J?\c=Q< ;[mĉnֿ띈PF(C0{*aaGŋ䋴qlK$}\C%C}{/აזpQG9^EDXӧO[Q\**!}N =ClDk0/~#ClCc4eaqF'R2K~rv7uEZn:1cۅyq&H]J90UxgtBi1ȹR:nܸ݊~q2??]sv[1T6h/L }OF@2=#Հ>LkVXXh$1bľcCE[ywT$*'/0=7Ö-[ow '`ZB:EÃ:I%h"!qSr3?>=R5\4l.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uօJqHA. dzx> "$'!txr k-J5Ȥ焥:z~.|RHHy D'<ǗYSp5jT;OF?~|ȗYrd! B@! B@C I?c *^pxAAV[_^ c qxAZACOQO;\4]Oɾq;_fs8M<"}.9xv" /WP <gA C9$|, f//R_<vaTtB@! B@! ]rzy/aVW{UVVxdgQMY Y]'=!z,&-xAy`9kkq***?n͎aGxޤI}w H`Y.<qx+,?G/;:˅>óR $#cuB@! B@! ro…`袋2S`e 9H9| 1{ʽy-Y!νy oe?GE>^z1w֩;r7B(BAc?<x\ި[s!!x>^2{,%(G~,=c~t/S^&/^}сe/gBPC^a! B@! B@C }5׆%}Iy2SrVԃlP7i4Ã7orh<^x'/ "T@E5H59ȷ+W2H}ׯG1/q8ʣ#H'i(|幼C؝vi>` 6<O<#D$/z7ԙ<&O<x2ޏ<ÙgIHFZ<xjCxB%>WRB@! B@A~lHpۚ 6Tmr_ۊ2mXƎӺVIor?qX (:OZ yI} ud>I>;N"go^ʌU^_X17DkIivo֮YalMc+ )C! B@! B`@ jʥKZQQUդ_\mKe!dWgIEA&1TFGג>OKHx5O5[)CiB@! B@!  <=BåB@! B@! B Ä07IENDB`
-1
apolloconfig/apollo
3,545
misc change
## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-02-12T03:27:53Z"
"2021-02-12T11:26:18Z"
3f3c4edcdf28794df1e0000409c458092dd6c7c3
d82086b2be884c4aac536d4d099a7148daeadafa
misc change. ## What's the purpose of this PR fix some bugs and update the docs Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-configservice/src/test/java/com/ctrip/framework/apollo/configservice/util/InstanceConfigAuditUtilTest.java
package com.ctrip.framework.apollo.configservice.util; import com.ctrip.framework.apollo.biz.entity.Instance; import com.ctrip.framework.apollo.biz.entity.InstanceConfig; import com.ctrip.framework.apollo.biz.service.InstanceService; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.springframework.test.util.ReflectionTestUtils; import java.util.Objects; import java.util.concurrent.BlockingQueue; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.*; /** * @author Jason Song([email protected]) */ @RunWith(MockitoJUnitRunner.class) public class InstanceConfigAuditUtilTest { private InstanceConfigAuditUtil instanceConfigAuditUtil; @Mock private InstanceService instanceService; private BlockingQueue<InstanceConfigAuditUtil.InstanceConfigAuditModel> audits; private String someAppId; private String someConfigClusterName; private String someClusterName; private String someDataCenter; private String someIp; private String someConfigAppId; private String someConfigNamespace; private String someReleaseKey; private InstanceConfigAuditUtil.InstanceConfigAuditModel someAuditModel; @Before public void setUp() throws Exception { instanceConfigAuditUtil = new InstanceConfigAuditUtil(instanceService); audits = (BlockingQueue<InstanceConfigAuditUtil.InstanceConfigAuditModel>) ReflectionTestUtils.getField(instanceConfigAuditUtil, "audits"); someAppId = "someAppId"; someClusterName = "someClusterName"; someDataCenter = "someDataCenter"; someIp = "someIp"; someConfigAppId = "someConfigAppId"; someConfigClusterName = "someConfigClusterName"; someConfigNamespace = "someConfigNamespace"; someReleaseKey = "someReleaseKey"; someAuditModel = new InstanceConfigAuditUtil.InstanceConfigAuditModel(someAppId, someClusterName, someDataCenter, someIp, someConfigAppId, someConfigClusterName, someConfigNamespace, someReleaseKey); } @Test public void testAudit() throws Exception { boolean result = instanceConfigAuditUtil.audit(someAppId, someClusterName, someDataCenter, someIp, someConfigAppId, someConfigClusterName, someConfigNamespace, someReleaseKey); InstanceConfigAuditUtil.InstanceConfigAuditModel audit = audits.poll(); assertTrue(result); assertTrue(Objects.equals(someAuditModel, audit)); } @Test public void testDoAudit() throws Exception { long someInstanceId = 1; Instance someInstance = mock(Instance.class); when(someInstance.getId()).thenReturn(someInstanceId); when(instanceService.createInstance(any(Instance.class))).thenReturn(someInstance); instanceConfigAuditUtil.doAudit(someAuditModel); verify(instanceService, times(1)).findInstance(someAppId, someClusterName, someDataCenter, someIp); verify(instanceService, times(1)).createInstance(any(Instance.class)); verify(instanceService, times(1)).findInstanceConfig(someInstanceId, someConfigAppId, someConfigNamespace); verify(instanceService, times(1)).createInstanceConfig(any(InstanceConfig.class)); } }
package com.ctrip.framework.apollo.configservice.util; import com.ctrip.framework.apollo.biz.entity.Instance; import com.ctrip.framework.apollo.biz.entity.InstanceConfig; import com.ctrip.framework.apollo.biz.service.InstanceService; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.springframework.test.util.ReflectionTestUtils; import java.util.Objects; import java.util.concurrent.BlockingQueue; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.*; /** * @author Jason Song([email protected]) */ @RunWith(MockitoJUnitRunner.class) public class InstanceConfigAuditUtilTest { private InstanceConfigAuditUtil instanceConfigAuditUtil; @Mock private InstanceService instanceService; private BlockingQueue<InstanceConfigAuditUtil.InstanceConfigAuditModel> audits; private String someAppId; private String someConfigClusterName; private String someClusterName; private String someDataCenter; private String someIp; private String someConfigAppId; private String someConfigNamespace; private String someReleaseKey; private InstanceConfigAuditUtil.InstanceConfigAuditModel someAuditModel; @Before public void setUp() throws Exception { instanceConfigAuditUtil = new InstanceConfigAuditUtil(instanceService); audits = (BlockingQueue<InstanceConfigAuditUtil.InstanceConfigAuditModel>) ReflectionTestUtils.getField(instanceConfigAuditUtil, "audits"); someAppId = "someAppId"; someClusterName = "someClusterName"; someDataCenter = "someDataCenter"; someIp = "someIp"; someConfigAppId = "someConfigAppId"; someConfigClusterName = "someConfigClusterName"; someConfigNamespace = "someConfigNamespace"; someReleaseKey = "someReleaseKey"; someAuditModel = new InstanceConfigAuditUtil.InstanceConfigAuditModel(someAppId, someClusterName, someDataCenter, someIp, someConfigAppId, someConfigClusterName, someConfigNamespace, someReleaseKey); } @Test public void testAudit() throws Exception { boolean result = instanceConfigAuditUtil.audit(someAppId, someClusterName, someDataCenter, someIp, someConfigAppId, someConfigClusterName, someConfigNamespace, someReleaseKey); InstanceConfigAuditUtil.InstanceConfigAuditModel audit = audits.poll(); assertTrue(result); assertTrue(Objects.equals(someAuditModel, audit)); } @Test public void testDoAudit() throws Exception { long someInstanceId = 1; Instance someInstance = mock(Instance.class); when(someInstance.getId()).thenReturn(someInstanceId); when(instanceService.createInstance(any(Instance.class))).thenReturn(someInstance); instanceConfigAuditUtil.doAudit(someAuditModel); verify(instanceService, times(1)).findInstance(someAppId, someClusterName, someDataCenter, someIp); verify(instanceService, times(1)).createInstance(any(Instance.class)); verify(instanceService, times(1)).findInstanceConfig(someInstanceId, someConfigAppId, someConfigNamespace); verify(instanceService, times(1)).createInstanceConfig(any(InstanceConfig.class)); } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-portal/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/maven-v4_0_0.xsd"> <parent> <groupId>com.ctrip.framework.apollo</groupId> <artifactId>apollo</artifactId> <version>${revision}</version> <relativePath>../pom.xml</relativePath> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>apollo-portal</artifactId> <name>Apollo Portal</name> <properties> <github.path>${project.artifactId}</github.path> <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format> </properties> <dependencies> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-ldap</artifactId> </dependency> <dependency> <groupId>com.ctrip.framework.apollo</groupId> <artifactId>apollo-common</artifactId> </dependency> <dependency> <groupId>com.ctrip.framework.apollo</groupId> <artifactId>apollo-openapi</artifactId> </dependency> <!-- yml processing --> <dependency> <groupId>org.yaml</groupId> <artifactId>snakeyaml</artifactId> </dependency> <!-- end of yml processing --> <!-- JDK 1.8+ --> <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-impl</artifactId> </dependency> <dependency> <groupId>org.glassfish.jaxb</groupId> <artifactId>jaxb-runtime</artifactId> </dependency> <dependency> <groupId>javax.activation</groupId> <artifactId>activation</artifactId> </dependency> <dependency> <groupId>com.sun.mail</groupId> <artifactId>javax.mail</artifactId> </dependency> <!-- end of JDK 1.8+ --> <!-- JDK 11+ --> <dependency> <groupId>org.javassist</groupId> <artifactId>javassist</artifactId> </dependency> <!-- end of JDK 11+ --> <!-- test --> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-server</artifactId> <scope>test</scope> </dependency> <!-- end of test --> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <finalName>${project.artifactId}-${project.version}-${package.environment}</finalName> <appendAssemblyId>false</appendAssemblyId> <descriptors> <descriptor>src/assembly/assembly-descriptor.xml</descriptor> </descriptors> </configuration> </execution> </executions> </plugin> <plugin> <groupId>com.spotify</groupId> <artifactId>docker-maven-plugin</artifactId> <version>1.2.2</version> <configuration> <imageName>apolloconfig/${project.artifactId}</imageName> <imageTags> <imageTag>${project.version}</imageTag> <imageTag>latest</imageTag> </imageTags> <dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory> <serverId>docker-hub</serverId> <resources> <resource> <targetPath>/</targetPath> <directory>${project.build.directory}</directory> <include>*.zip</include> </resource> </resources> </configuration> </plugin> <plugin> <groupId>com.google.code.maven-replacer-plugin</groupId> <artifactId>replacer</artifactId> <version>1.5.3</version> <executions> <execution> <phase>prepare-package</phase> <goals> <goal>replace</goal> </goals> </execution> </executions> <configuration> <basedir>${project.build.directory}</basedir> <includes> <include>classes/static/*.html</include> <include>classes/static/**/*.html</include> </includes> <replacements> <replacement> <token>\.css\"</token> <value>.css?v=${maven.build.timestamp}\"</value> </replacement> <replacement> <token>\.js\"</token> <value>.js?v=${maven.build.timestamp}\"</value> </replacement> </replacements> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>ctrip</id> <dependencies> <dependency> <groupId>com.ctrip.framework.apollo-sso</groupId> <artifactId>apollo-sso-ctrip</artifactId> </dependency> <dependency> <groupId>com.ctrip.framework.apollo-ctrip-service</groupId> <artifactId>apollo-email-service</artifactId> </dependency> </dependencies> </profile> </profiles> </project>
<?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/maven-v4_0_0.xsd"> <parent> <groupId>com.ctrip.framework.apollo</groupId> <artifactId>apollo</artifactId> <version>${revision}</version> <relativePath>../pom.xml</relativePath> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>apollo-portal</artifactId> <name>Apollo Portal</name> <properties> <github.path>${project.artifactId}</github.path> <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format> </properties> <dependencies> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-ldap</artifactId> </dependency> <dependency> <groupId>com.ctrip.framework.apollo</groupId> <artifactId>apollo-common</artifactId> </dependency> <dependency> <groupId>com.ctrip.framework.apollo</groupId> <artifactId>apollo-openapi</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-oauth2-client</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-oauth2-resource-server</artifactId> </dependency> <!-- yml processing --> <dependency> <groupId>org.yaml</groupId> <artifactId>snakeyaml</artifactId> </dependency> <!-- end of yml processing --> <!-- JDK 1.8+ --> <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-impl</artifactId> </dependency> <dependency> <groupId>org.glassfish.jaxb</groupId> <artifactId>jaxb-runtime</artifactId> </dependency> <dependency> <groupId>javax.activation</groupId> <artifactId>activation</artifactId> </dependency> <dependency> <groupId>com.sun.mail</groupId> <artifactId>javax.mail</artifactId> </dependency> <!-- end of JDK 1.8+ --> <!-- JDK 11+ --> <dependency> <groupId>org.javassist</groupId> <artifactId>javassist</artifactId> </dependency> <!-- end of JDK 11+ --> <!-- test --> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-server</artifactId> <scope>test</scope> </dependency> <!-- end of test --> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <finalName>${project.artifactId}-${project.version}-${package.environment}</finalName> <appendAssemblyId>false</appendAssemblyId> <descriptors> <descriptor>src/assembly/assembly-descriptor.xml</descriptor> </descriptors> </configuration> </execution> </executions> </plugin> <plugin> <groupId>com.spotify</groupId> <artifactId>docker-maven-plugin</artifactId> <version>1.2.2</version> <configuration> <imageName>apolloconfig/${project.artifactId}</imageName> <imageTags> <imageTag>${project.version}</imageTag> <imageTag>latest</imageTag> </imageTags> <dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory> <serverId>docker-hub</serverId> <resources> <resource> <targetPath>/</targetPath> <directory>${project.build.directory}</directory> <include>*.zip</include> </resource> </resources> </configuration> </plugin> <plugin> <groupId>com.google.code.maven-replacer-plugin</groupId> <artifactId>replacer</artifactId> <version>1.5.3</version> <executions> <execution> <phase>prepare-package</phase> <goals> <goal>replace</goal> </goals> </execution> </executions> <configuration> <basedir>${project.build.directory}</basedir> <includes> <include>classes/static/*.html</include> <include>classes/static/**/*.html</include> </includes> <replacements> <replacement> <token>\.css\"</token> <value>.css?v=${maven.build.timestamp}\"</value> </replacement> <replacement> <token>\.js\"</token> <value>.js?v=${maven.build.timestamp}\"</value> </replacement> </replacements> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>ctrip</id> <dependencies> <dependency> <groupId>com.ctrip.framework.apollo-sso</groupId> <artifactId>apollo-sso-ctrip</artifactId> </dependency> <dependency> <groupId>com.ctrip.framework.apollo-ctrip-service</groupId> <artifactId>apollo-email-service</artifactId> </dependency> </dependencies> </profile> </profiles> </project>
1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java
package com.ctrip.framework.apollo.portal.spi.configuration; import com.ctrip.framework.apollo.common.condition.ConditionalOnMissingProfile; import com.ctrip.framework.apollo.core.utils.StringUtils; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import com.ctrip.framework.apollo.portal.spi.LogoutHandler; import com.ctrip.framework.apollo.portal.spi.SsoHeartbeatHandler; import com.ctrip.framework.apollo.portal.spi.UserInfoHolder; import com.ctrip.framework.apollo.portal.spi.UserService; import com.ctrip.framework.apollo.portal.spi.ctrip.CtripLogoutHandler; import com.ctrip.framework.apollo.portal.spi.ctrip.CtripSsoHeartbeatHandler; import com.ctrip.framework.apollo.portal.spi.ctrip.CtripUserInfoHolder; import com.ctrip.framework.apollo.portal.spi.ctrip.CtripUserService; import com.ctrip.framework.apollo.portal.spi.defaultimpl.DefaultLogoutHandler; import com.ctrip.framework.apollo.portal.spi.defaultimpl.DefaultSsoHeartbeatHandler; import com.ctrip.framework.apollo.portal.spi.defaultimpl.DefaultUserInfoHolder; import com.ctrip.framework.apollo.portal.spi.defaultimpl.DefaultUserService; import com.ctrip.framework.apollo.portal.spi.ldap.ApolloLdapAuthenticationProvider; import com.ctrip.framework.apollo.portal.spi.ldap.FilterLdapByGroupUserSearch; import com.ctrip.framework.apollo.portal.spi.ldap.LdapUserService; import com.ctrip.framework.apollo.portal.spi.springsecurity.SpringSecurityUserInfoHolder; import com.ctrip.framework.apollo.portal.spi.springsecurity.SpringSecurityUserService; import com.google.common.collect.Maps; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.annotation.Order; import org.springframework.core.env.Environment; import org.springframework.ldap.core.ContextSource; import org.springframework.ldap.core.LdapOperations; import org.springframework.ldap.core.LdapTemplate; import org.springframework.ldap.core.support.LdapContextSource; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.ldap.authentication.BindAuthenticator; import org.springframework.security.ldap.authentication.LdapAuthenticationProvider; import org.springframework.security.ldap.search.FilterBasedLdapUserSearch; import org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator; import org.springframework.security.provisioning.JdbcUserDetailsManager; import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint; import javax.servlet.Filter; import javax.sql.DataSource; import java.util.Collections; import java.util.EventListener; import java.util.Map; @Configuration public class AuthConfiguration { private static final String[] BY_PASS_URLS = {"/prometheus/**", "/metrics/**", "/openapi/**", "/vendor/**", "/styles/**", "/scripts/**", "/views/**", "/img/**", "/i18n/**", "/prefix-path", "/health"}; /** * spring.profiles.active = ctrip */ @Configuration @Profile("ctrip") static class CtripAuthAutoConfiguration { private final PortalConfig portalConfig; public CtripAuthAutoConfiguration(final PortalConfig portalConfig) { this.portalConfig = portalConfig; } @Bean public ServletListenerRegistrationBean redisAppSettingListner() { ServletListenerRegistrationBean redisAppSettingListener = new ServletListenerRegistrationBean(); redisAppSettingListener .setListener(listener("org.jasig.cas.client.credis.CRedisAppSettingListner")); return redisAppSettingListener; } @Bean public ServletListenerRegistrationBean singleSignOutHttpSessionListener() { ServletListenerRegistrationBean singleSignOutHttpSessionListener = new ServletListenerRegistrationBean(); singleSignOutHttpSessionListener .setListener(listener("org.jasig.cas.client.session.SingleSignOutHttpSessionListener")); return singleSignOutHttpSessionListener; } @Bean public FilterRegistrationBean casFilter() { FilterRegistrationBean singleSignOutFilter = new FilterRegistrationBean(); singleSignOutFilter.setFilter(filter("org.jasig.cas.client.session.SingleSignOutFilter")); singleSignOutFilter.addUrlPatterns("/*"); singleSignOutFilter.setOrder(1); return singleSignOutFilter; } @Bean public FilterRegistrationBean authenticationFilter() { FilterRegistrationBean casFilter = new FilterRegistrationBean(); Map<String, String> filterInitParam = Maps.newHashMap(); filterInitParam.put("redisClusterName", "casClientPrincipal"); filterInitParam.put("serverName", portalConfig.portalServerName()); filterInitParam.put("casServerLoginUrl", portalConfig.casServerLoginUrl()); //we don't want to use session to store login information, since we will be deployed to a cluster, not a single instance filterInitParam.put("useSession", "false"); filterInitParam.put("/openapi.*", "exclude"); casFilter.setInitParameters(filterInitParam); casFilter .setFilter(filter("com.ctrip.framework.apollo.sso.filter.ApolloAuthenticationFilter")); casFilter.addUrlPatterns("/*"); casFilter.setOrder(2); return casFilter; } @Bean public FilterRegistrationBean casValidationFilter() { FilterRegistrationBean casValidationFilter = new FilterRegistrationBean(); Map<String, String> filterInitParam = Maps.newHashMap(); filterInitParam.put("casServerUrlPrefix", portalConfig.casServerUrlPrefix()); filterInitParam.put("serverName", portalConfig.portalServerName()); filterInitParam.put("encoding", "UTF-8"); //we don't want to use session to store login information, since we will be deployed to a cluster, not a single instance filterInitParam.put("useSession", "false"); filterInitParam.put("useRedis", "true"); filterInitParam.put("redisClusterName", "casClientPrincipal"); casValidationFilter .setFilter( filter("org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter")); casValidationFilter.setInitParameters(filterInitParam); casValidationFilter.addUrlPatterns("/*"); casValidationFilter.setOrder(3); return casValidationFilter; } @Bean public FilterRegistrationBean assertionHolder() { FilterRegistrationBean assertionHolderFilter = new FilterRegistrationBean(); Map<String, String> filterInitParam = Maps.newHashMap(); filterInitParam.put("/openapi.*", "exclude"); assertionHolderFilter.setInitParameters(filterInitParam); assertionHolderFilter.setFilter( filter("com.ctrip.framework.apollo.sso.filter.ApolloAssertionThreadLocalFilter")); assertionHolderFilter.addUrlPatterns("/*"); assertionHolderFilter.setOrder(4); return assertionHolderFilter; } @Bean public CtripUserInfoHolder ctripUserInfoHolder() { return new CtripUserInfoHolder(); } @Bean public CtripLogoutHandler logoutHandler() { return new CtripLogoutHandler(); } private Filter filter(String className) { Class clazz = null; try { clazz = Class.forName(className); Object obj = clazz.newInstance(); return (Filter) obj; } catch (Exception e) { throw new RuntimeException("instance filter fail", e); } } private EventListener listener(String className) { Class clazz = null; try { clazz = Class.forName(className); Object obj = clazz.newInstance(); return (EventListener) obj; } catch (Exception e) { throw new RuntimeException("instance listener fail", e); } } @Bean public UserService ctripUserService(PortalConfig portalConfig) { return new CtripUserService(portalConfig); } @Bean public SsoHeartbeatHandler ctripSsoHeartbeatHandler() { return new CtripSsoHeartbeatHandler(); } } /** * spring.profiles.active = auth */ @Configuration @Profile("auth") static class SpringSecurityAuthAutoConfiguration { @Bean @ConditionalOnMissingBean(SsoHeartbeatHandler.class) public SsoHeartbeatHandler defaultSsoHeartbeatHandler() { return new DefaultSsoHeartbeatHandler(); } @Bean @ConditionalOnMissingBean(UserInfoHolder.class) public UserInfoHolder springSecurityUserInfoHolder() { return new SpringSecurityUserInfoHolder(); } @Bean @ConditionalOnMissingBean(LogoutHandler.class) public LogoutHandler logoutHandler() { return new DefaultLogoutHandler(); } @Bean public JdbcUserDetailsManager jdbcUserDetailsManager(AuthenticationManagerBuilder auth, DataSource datasource) throws Exception { JdbcUserDetailsManager jdbcUserDetailsManager = auth.jdbcAuthentication() .passwordEncoder(new BCryptPasswordEncoder()).dataSource(datasource) .usersByUsernameQuery("select Username,Password,Enabled from `Users` where Username = ?") .authoritiesByUsernameQuery( "select Username,Authority from `Authorities` where Username = ?") .getUserDetailsService(); jdbcUserDetailsManager.setUserExistsSql("select Username from `Users` where Username = ?"); jdbcUserDetailsManager .setCreateUserSql("insert into `Users` (Username, Password, Enabled) values (?,?,?)"); jdbcUserDetailsManager .setUpdateUserSql("update `Users` set Password = ?, Enabled = ? where id = (select u.id from (select id from `Users` where Username = ?) as u)"); jdbcUserDetailsManager.setDeleteUserSql("delete from `Users` where id = (select u.id from (select id from `Users` where Username = ?) as u)"); jdbcUserDetailsManager .setCreateAuthoritySql("insert into `Authorities` (Username, Authority) values (?,?)"); jdbcUserDetailsManager .setDeleteUserAuthoritiesSql("delete from `Authorities` where id in (select a.id from (select id from `Authorities` where Username = ?) as a)"); jdbcUserDetailsManager .setChangePasswordSql("update `Users` set Password = ? where id = (select u.id from (select id from `Users` where Username = ?) as u)"); return jdbcUserDetailsManager; } @Bean @ConditionalOnMissingBean(UserService.class) public UserService springSecurityUserService() { return new SpringSecurityUserService(); } } @Order(99) @Profile("auth") @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) static class SpringSecurityConfigurer extends WebSecurityConfigurerAdapter { public static final String USER_ROLE = "user"; @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable(); http.headers().frameOptions().sameOrigin(); http.authorizeRequests() .antMatchers(BY_PASS_URLS).permitAll() .antMatchers("/**").hasAnyRole(USER_ROLE); http.formLogin().loginPage("/signin").defaultSuccessUrl("/", true).permitAll().failureUrl("/signin?#/error").and() .httpBasic(); http.logout().logoutUrl("/user/logout").invalidateHttpSession(true).clearAuthentication(true) .logoutSuccessUrl("/signin?#/logout"); http.exceptionHandling().authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/signin")); } } /** * spring.profiles.active = ldap */ @Configuration @Profile("ldap") @EnableConfigurationProperties({LdapProperties.class,LdapExtendProperties.class}) static class SpringSecurityLDAPAuthAutoConfiguration { private final LdapProperties properties; private final Environment environment; public SpringSecurityLDAPAuthAutoConfiguration(final LdapProperties properties, final Environment environment) { this.properties = properties; this.environment = environment; } @Bean @ConditionalOnMissingBean(SsoHeartbeatHandler.class) public SsoHeartbeatHandler defaultSsoHeartbeatHandler() { return new DefaultSsoHeartbeatHandler(); } @Bean @ConditionalOnMissingBean(UserInfoHolder.class) public UserInfoHolder springSecurityUserInfoHolder() { return new SpringSecurityUserInfoHolder(); } @Bean @ConditionalOnMissingBean(LogoutHandler.class) public LogoutHandler logoutHandler() { return new DefaultLogoutHandler(); } @Bean @ConditionalOnMissingBean(UserService.class) public UserService springSecurityUserService() { return new LdapUserService(); } @Bean @ConditionalOnMissingBean public ContextSource ldapContextSource() { LdapContextSource source = new LdapContextSource(); source.setUserDn(this.properties.getUsername()); source.setPassword(this.properties.getPassword()); source.setAnonymousReadOnly(this.properties.getAnonymousReadOnly()); source.setBase(this.properties.getBase()); source.setUrls(this.properties.determineUrls(this.environment)); source.setBaseEnvironmentProperties( Collections.unmodifiableMap(this.properties.getBaseEnvironment())); return source; } @Bean @ConditionalOnMissingBean(LdapOperations.class) public LdapTemplate ldapTemplate(ContextSource contextSource) { LdapTemplate ldapTemplate = new LdapTemplate(contextSource); ldapTemplate.setIgnorePartialResultException(true); return ldapTemplate; } } @Order(99) @Profile("ldap") @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) static class SpringSecurityLDAPConfigurer extends WebSecurityConfigurerAdapter { private final LdapProperties ldapProperties; private final LdapContextSource ldapContextSource; private final LdapExtendProperties ldapExtendProperties; public SpringSecurityLDAPConfigurer(final LdapProperties ldapProperties, final LdapContextSource ldapContextSource, final LdapExtendProperties ldapExtendProperties) { this.ldapProperties = ldapProperties; this.ldapContextSource = ldapContextSource; this.ldapExtendProperties = ldapExtendProperties; } @Bean public FilterBasedLdapUserSearch userSearch() { if (ldapExtendProperties.getGroup() == null || StringUtils .isBlank(ldapExtendProperties.getGroup().getGroupSearch())) { FilterBasedLdapUserSearch filterBasedLdapUserSearch = new FilterBasedLdapUserSearch("", ldapProperties.getSearchFilter(), ldapContextSource); filterBasedLdapUserSearch.setSearchSubtree(true); return filterBasedLdapUserSearch; } FilterLdapByGroupUserSearch filterLdapByGroupUserSearch = new FilterLdapByGroupUserSearch( ldapProperties.getBase(), ldapProperties.getSearchFilter(), ldapExtendProperties.getGroup().getGroupBase(), ldapContextSource, ldapExtendProperties.getGroup().getGroupSearch(), ldapExtendProperties.getMapping().getRdnKey(), ldapExtendProperties.getGroup().getGroupMembership(),ldapExtendProperties.getMapping().getLoginId()); filterLdapByGroupUserSearch.setSearchSubtree(true); return filterLdapByGroupUserSearch; } @Bean public LdapAuthenticationProvider ldapAuthProvider() { BindAuthenticator bindAuthenticator = new BindAuthenticator(ldapContextSource); bindAuthenticator.setUserSearch(userSearch()); DefaultLdapAuthoritiesPopulator defaultAuthAutoConfiguration = new DefaultLdapAuthoritiesPopulator( ldapContextSource, null); defaultAuthAutoConfiguration.setIgnorePartialResultException(true); defaultAuthAutoConfiguration.setSearchSubtree(true); // Rewrite the logic of LdapAuthenticationProvider with ApolloLdapAuthenticationProvider, // use userId in LDAP system instead of userId input by user. return new ApolloLdapAuthenticationProvider( bindAuthenticator, defaultAuthAutoConfiguration, ldapExtendProperties); } @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable(); http.headers().frameOptions().sameOrigin(); http.authorizeRequests() .antMatchers(BY_PASS_URLS).permitAll() .antMatchers("/**").authenticated(); http.formLogin().loginPage("/signin").defaultSuccessUrl("/", true).permitAll().failureUrl("/signin?#/error").and() .httpBasic(); http.logout().logoutUrl("/user/logout").invalidateHttpSession(true).clearAuthentication(true) .logoutSuccessUrl("/signin?#/logout"); http.exceptionHandling().authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/signin")); } @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.authenticationProvider(ldapAuthProvider()); } } /** * default profile */ @Configuration @ConditionalOnMissingProfile({"ctrip", "auth", "ldap"}) static class DefaultAuthAutoConfiguration { @Bean @ConditionalOnMissingBean(SsoHeartbeatHandler.class) public SsoHeartbeatHandler defaultSsoHeartbeatHandler() { return new DefaultSsoHeartbeatHandler(); } @Bean @ConditionalOnMissingBean(UserInfoHolder.class) public DefaultUserInfoHolder defaultUserInfoHolder() { return new DefaultUserInfoHolder(); } @Bean @ConditionalOnMissingBean(LogoutHandler.class) public DefaultLogoutHandler logoutHandler() { return new DefaultLogoutHandler(); } @Bean @ConditionalOnMissingBean(UserService.class) public UserService defaultUserService() { return new DefaultUserService(); } } @ConditionalOnMissingProfile({"auth", "ldap"}) @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) static class DefaultWebSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable(); http.headers().frameOptions().sameOrigin(); } } }
package com.ctrip.framework.apollo.portal.spi.configuration; import com.ctrip.framework.apollo.common.condition.ConditionalOnMissingProfile; import com.ctrip.framework.apollo.core.utils.StringUtils; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import com.ctrip.framework.apollo.portal.repository.UserRepository; import com.ctrip.framework.apollo.portal.spi.LogoutHandler; import com.ctrip.framework.apollo.portal.spi.SsoHeartbeatHandler; import com.ctrip.framework.apollo.portal.spi.UserInfoHolder; import com.ctrip.framework.apollo.portal.spi.UserService; import com.ctrip.framework.apollo.portal.spi.ctrip.CtripLogoutHandler; import com.ctrip.framework.apollo.portal.spi.ctrip.CtripSsoHeartbeatHandler; import com.ctrip.framework.apollo.portal.spi.ctrip.CtripUserInfoHolder; import com.ctrip.framework.apollo.portal.spi.ctrip.CtripUserService; import com.ctrip.framework.apollo.portal.spi.defaultimpl.DefaultLogoutHandler; import com.ctrip.framework.apollo.portal.spi.defaultimpl.DefaultSsoHeartbeatHandler; import com.ctrip.framework.apollo.portal.spi.defaultimpl.DefaultUserInfoHolder; import com.ctrip.framework.apollo.portal.spi.defaultimpl.DefaultUserService; import com.ctrip.framework.apollo.portal.spi.ldap.ApolloLdapAuthenticationProvider; import com.ctrip.framework.apollo.portal.spi.ldap.FilterLdapByGroupUserSearch; import com.ctrip.framework.apollo.portal.spi.ldap.LdapUserService; import com.ctrip.framework.apollo.portal.spi.oidc.ExcludeClientCredentialsClientRegistrationRepository; import com.ctrip.framework.apollo.portal.spi.oidc.OidcAuthenticationSuccessEventListener; import com.ctrip.framework.apollo.portal.spi.oidc.OidcLocalUserService; import com.ctrip.framework.apollo.portal.spi.oidc.OidcLogoutHandler; import com.ctrip.framework.apollo.portal.spi.oidc.OidcUserInfoHolder; import com.ctrip.framework.apollo.portal.spi.springsecurity.SpringSecurityUserInfoHolder; import com.ctrip.framework.apollo.portal.spi.springsecurity.SpringSecurityUserService; import com.google.common.collect.Maps; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientProperties; import org.springframework.boot.autoconfigure.security.oauth2.resource.OAuth2ResourceServerProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.annotation.Order; import org.springframework.core.env.Environment; import org.springframework.ldap.core.ContextSource; import org.springframework.ldap.core.LdapOperations; import org.springframework.ldap.core.LdapTemplate; import org.springframework.ldap.core.support.LdapContextSource; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.ldap.authentication.BindAuthenticator; import org.springframework.security.ldap.authentication.LdapAuthenticationProvider; import org.springframework.security.ldap.search.FilterBasedLdapUserSearch; import org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator; import org.springframework.security.oauth2.client.oidc.web.logout.OidcClientInitiatedLogoutSuccessHandler; import org.springframework.security.oauth2.client.registration.InMemoryClientRegistrationRepository; import org.springframework.security.provisioning.JdbcUserDetailsManager; import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint; import javax.servlet.Filter; import javax.sql.DataSource; import java.util.Collections; import java.util.EventListener; import java.util.Map; @Configuration public class AuthConfiguration { private static final String[] BY_PASS_URLS = {"/prometheus/**", "/metrics/**", "/openapi/**", "/vendor/**", "/styles/**", "/scripts/**", "/views/**", "/img/**", "/i18n/**", "/prefix-path", "/health"}; /** * spring.profiles.active = ctrip */ @Configuration @Profile("ctrip") static class CtripAuthAutoConfiguration { private final PortalConfig portalConfig; public CtripAuthAutoConfiguration(final PortalConfig portalConfig) { this.portalConfig = portalConfig; } @Bean public ServletListenerRegistrationBean redisAppSettingListner() { ServletListenerRegistrationBean redisAppSettingListener = new ServletListenerRegistrationBean(); redisAppSettingListener .setListener(listener("org.jasig.cas.client.credis.CRedisAppSettingListner")); return redisAppSettingListener; } @Bean public ServletListenerRegistrationBean singleSignOutHttpSessionListener() { ServletListenerRegistrationBean singleSignOutHttpSessionListener = new ServletListenerRegistrationBean(); singleSignOutHttpSessionListener .setListener(listener("org.jasig.cas.client.session.SingleSignOutHttpSessionListener")); return singleSignOutHttpSessionListener; } @Bean public FilterRegistrationBean casFilter() { FilterRegistrationBean singleSignOutFilter = new FilterRegistrationBean(); singleSignOutFilter.setFilter(filter("org.jasig.cas.client.session.SingleSignOutFilter")); singleSignOutFilter.addUrlPatterns("/*"); singleSignOutFilter.setOrder(1); return singleSignOutFilter; } @Bean public FilterRegistrationBean authenticationFilter() { FilterRegistrationBean casFilter = new FilterRegistrationBean(); Map<String, String> filterInitParam = Maps.newHashMap(); filterInitParam.put("redisClusterName", "casClientPrincipal"); filterInitParam.put("serverName", portalConfig.portalServerName()); filterInitParam.put("casServerLoginUrl", portalConfig.casServerLoginUrl()); //we don't want to use session to store login information, since we will be deployed to a cluster, not a single instance filterInitParam.put("useSession", "false"); filterInitParam.put("/openapi.*", "exclude"); casFilter.setInitParameters(filterInitParam); casFilter .setFilter(filter("com.ctrip.framework.apollo.sso.filter.ApolloAuthenticationFilter")); casFilter.addUrlPatterns("/*"); casFilter.setOrder(2); return casFilter; } @Bean public FilterRegistrationBean casValidationFilter() { FilterRegistrationBean casValidationFilter = new FilterRegistrationBean(); Map<String, String> filterInitParam = Maps.newHashMap(); filterInitParam.put("casServerUrlPrefix", portalConfig.casServerUrlPrefix()); filterInitParam.put("serverName", portalConfig.portalServerName()); filterInitParam.put("encoding", "UTF-8"); //we don't want to use session to store login information, since we will be deployed to a cluster, not a single instance filterInitParam.put("useSession", "false"); filterInitParam.put("useRedis", "true"); filterInitParam.put("redisClusterName", "casClientPrincipal"); casValidationFilter .setFilter( filter("org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter")); casValidationFilter.setInitParameters(filterInitParam); casValidationFilter.addUrlPatterns("/*"); casValidationFilter.setOrder(3); return casValidationFilter; } @Bean public FilterRegistrationBean assertionHolder() { FilterRegistrationBean assertionHolderFilter = new FilterRegistrationBean(); Map<String, String> filterInitParam = Maps.newHashMap(); filterInitParam.put("/openapi.*", "exclude"); assertionHolderFilter.setInitParameters(filterInitParam); assertionHolderFilter.setFilter( filter("com.ctrip.framework.apollo.sso.filter.ApolloAssertionThreadLocalFilter")); assertionHolderFilter.addUrlPatterns("/*"); assertionHolderFilter.setOrder(4); return assertionHolderFilter; } @Bean public CtripUserInfoHolder ctripUserInfoHolder() { return new CtripUserInfoHolder(); } @Bean public CtripLogoutHandler logoutHandler() { return new CtripLogoutHandler(); } private Filter filter(String className) { Class clazz = null; try { clazz = Class.forName(className); Object obj = clazz.newInstance(); return (Filter) obj; } catch (Exception e) { throw new RuntimeException("instance filter fail", e); } } private EventListener listener(String className) { Class clazz = null; try { clazz = Class.forName(className); Object obj = clazz.newInstance(); return (EventListener) obj; } catch (Exception e) { throw new RuntimeException("instance listener fail", e); } } @Bean public UserService ctripUserService(PortalConfig portalConfig) { return new CtripUserService(portalConfig); } @Bean public SsoHeartbeatHandler ctripSsoHeartbeatHandler() { return new CtripSsoHeartbeatHandler(); } } /** * spring.profiles.active = auth */ @Configuration @Profile("auth") static class SpringSecurityAuthAutoConfiguration { @Bean @ConditionalOnMissingBean(SsoHeartbeatHandler.class) public SsoHeartbeatHandler defaultSsoHeartbeatHandler() { return new DefaultSsoHeartbeatHandler(); } @Bean @ConditionalOnMissingBean(UserInfoHolder.class) public UserInfoHolder springSecurityUserInfoHolder() { return new SpringSecurityUserInfoHolder(); } @Bean @ConditionalOnMissingBean(LogoutHandler.class) public LogoutHandler logoutHandler() { return new DefaultLogoutHandler(); } @Bean public JdbcUserDetailsManager jdbcUserDetailsManager(AuthenticationManagerBuilder auth, DataSource datasource) throws Exception { JdbcUserDetailsManager jdbcUserDetailsManager = auth.jdbcAuthentication() .passwordEncoder(new BCryptPasswordEncoder()).dataSource(datasource) .usersByUsernameQuery("select Username,Password,Enabled from `Users` where Username = ?") .authoritiesByUsernameQuery( "select Username,Authority from `Authorities` where Username = ?") .getUserDetailsService(); jdbcUserDetailsManager.setUserExistsSql("select Username from `Users` where Username = ?"); jdbcUserDetailsManager .setCreateUserSql("insert into `Users` (Username, Password, Enabled) values (?,?,?)"); jdbcUserDetailsManager .setUpdateUserSql("update `Users` set Password = ?, Enabled = ? where id = (select u.id from (select id from `Users` where Username = ?) as u)"); jdbcUserDetailsManager.setDeleteUserSql("delete from `Users` where id = (select u.id from (select id from `Users` where Username = ?) as u)"); jdbcUserDetailsManager .setCreateAuthoritySql("insert into `Authorities` (Username, Authority) values (?,?)"); jdbcUserDetailsManager .setDeleteUserAuthoritiesSql("delete from `Authorities` where id in (select a.id from (select id from `Authorities` where Username = ?) as a)"); jdbcUserDetailsManager .setChangePasswordSql("update `Users` set Password = ? where id = (select u.id from (select id from `Users` where Username = ?) as u)"); return jdbcUserDetailsManager; } @Bean @ConditionalOnMissingBean(UserService.class) public UserService springSecurityUserService() { return new SpringSecurityUserService(); } } @Order(99) @Profile("auth") @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) static class SpringSecurityConfigurer extends WebSecurityConfigurerAdapter { public static final String USER_ROLE = "user"; @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable(); http.headers().frameOptions().sameOrigin(); http.authorizeRequests() .antMatchers(BY_PASS_URLS).permitAll() .antMatchers("/**").hasAnyRole(USER_ROLE); http.formLogin().loginPage("/signin").defaultSuccessUrl("/", true).permitAll().failureUrl("/signin?#/error").and() .httpBasic(); http.logout().logoutUrl("/user/logout").invalidateHttpSession(true).clearAuthentication(true) .logoutSuccessUrl("/signin?#/logout"); http.exceptionHandling().authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/signin")); } } /** * spring.profiles.active = ldap */ @Configuration @Profile("ldap") @EnableConfigurationProperties({LdapProperties.class,LdapExtendProperties.class}) static class SpringSecurityLDAPAuthAutoConfiguration { private final LdapProperties properties; private final Environment environment; public SpringSecurityLDAPAuthAutoConfiguration(final LdapProperties properties, final Environment environment) { this.properties = properties; this.environment = environment; } @Bean @ConditionalOnMissingBean(SsoHeartbeatHandler.class) public SsoHeartbeatHandler defaultSsoHeartbeatHandler() { return new DefaultSsoHeartbeatHandler(); } @Bean @ConditionalOnMissingBean(UserInfoHolder.class) public UserInfoHolder springSecurityUserInfoHolder() { return new SpringSecurityUserInfoHolder(); } @Bean @ConditionalOnMissingBean(LogoutHandler.class) public LogoutHandler logoutHandler() { return new DefaultLogoutHandler(); } @Bean @ConditionalOnMissingBean(UserService.class) public UserService springSecurityUserService() { return new LdapUserService(); } @Bean @ConditionalOnMissingBean public ContextSource ldapContextSource() { LdapContextSource source = new LdapContextSource(); source.setUserDn(this.properties.getUsername()); source.setPassword(this.properties.getPassword()); source.setAnonymousReadOnly(this.properties.getAnonymousReadOnly()); source.setBase(this.properties.getBase()); source.setUrls(this.properties.determineUrls(this.environment)); source.setBaseEnvironmentProperties( Collections.unmodifiableMap(this.properties.getBaseEnvironment())); return source; } @Bean @ConditionalOnMissingBean(LdapOperations.class) public LdapTemplate ldapTemplate(ContextSource contextSource) { LdapTemplate ldapTemplate = new LdapTemplate(contextSource); ldapTemplate.setIgnorePartialResultException(true); return ldapTemplate; } } @Order(99) @Profile("ldap") @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) static class SpringSecurityLDAPConfigurer extends WebSecurityConfigurerAdapter { private final LdapProperties ldapProperties; private final LdapContextSource ldapContextSource; private final LdapExtendProperties ldapExtendProperties; public SpringSecurityLDAPConfigurer(final LdapProperties ldapProperties, final LdapContextSource ldapContextSource, final LdapExtendProperties ldapExtendProperties) { this.ldapProperties = ldapProperties; this.ldapContextSource = ldapContextSource; this.ldapExtendProperties = ldapExtendProperties; } @Bean public FilterBasedLdapUserSearch userSearch() { if (ldapExtendProperties.getGroup() == null || StringUtils .isBlank(ldapExtendProperties.getGroup().getGroupSearch())) { FilterBasedLdapUserSearch filterBasedLdapUserSearch = new FilterBasedLdapUserSearch("", ldapProperties.getSearchFilter(), ldapContextSource); filterBasedLdapUserSearch.setSearchSubtree(true); return filterBasedLdapUserSearch; } FilterLdapByGroupUserSearch filterLdapByGroupUserSearch = new FilterLdapByGroupUserSearch( ldapProperties.getBase(), ldapProperties.getSearchFilter(), ldapExtendProperties.getGroup().getGroupBase(), ldapContextSource, ldapExtendProperties.getGroup().getGroupSearch(), ldapExtendProperties.getMapping().getRdnKey(), ldapExtendProperties.getGroup().getGroupMembership(),ldapExtendProperties.getMapping().getLoginId()); filterLdapByGroupUserSearch.setSearchSubtree(true); return filterLdapByGroupUserSearch; } @Bean public LdapAuthenticationProvider ldapAuthProvider() { BindAuthenticator bindAuthenticator = new BindAuthenticator(ldapContextSource); bindAuthenticator.setUserSearch(userSearch()); DefaultLdapAuthoritiesPopulator defaultAuthAutoConfiguration = new DefaultLdapAuthoritiesPopulator( ldapContextSource, null); defaultAuthAutoConfiguration.setIgnorePartialResultException(true); defaultAuthAutoConfiguration.setSearchSubtree(true); // Rewrite the logic of LdapAuthenticationProvider with ApolloLdapAuthenticationProvider, // use userId in LDAP system instead of userId input by user. return new ApolloLdapAuthenticationProvider( bindAuthenticator, defaultAuthAutoConfiguration, ldapExtendProperties); } @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable(); http.headers().frameOptions().sameOrigin(); http.authorizeRequests() .antMatchers(BY_PASS_URLS).permitAll() .antMatchers("/**").authenticated(); http.formLogin().loginPage("/signin").defaultSuccessUrl("/", true).permitAll().failureUrl("/signin?#/error").and() .httpBasic(); http.logout().logoutUrl("/user/logout").invalidateHttpSession(true).clearAuthentication(true) .logoutSuccessUrl("/signin?#/logout"); http.exceptionHandling().authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/signin")); } @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.authenticationProvider(ldapAuthProvider()); } } @Profile("oidc") @EnableConfigurationProperties({OAuth2ClientProperties.class, OAuth2ResourceServerProperties.class}) @Configuration static class OidcAuthAutoConfiguration { @Bean @ConditionalOnMissingBean(SsoHeartbeatHandler.class) public SsoHeartbeatHandler defaultSsoHeartbeatHandler() { return new DefaultSsoHeartbeatHandler(); } @Bean @ConditionalOnMissingBean(UserInfoHolder.class) public UserInfoHolder oidcUserInfoHolder() { return new OidcUserInfoHolder(); } @Bean @ConditionalOnMissingBean(LogoutHandler.class) public LogoutHandler oidcLogoutHandler() { return new OidcLogoutHandler(); } @Bean @ConditionalOnMissingBean(JdbcUserDetailsManager.class) public JdbcUserDetailsManager jdbcUserDetailsManager(AuthenticationManagerBuilder auth, DataSource datasource) throws Exception { return new SpringSecurityAuthAutoConfiguration().jdbcUserDetailsManager(auth, datasource); } @Bean @ConditionalOnMissingBean(UserService.class) public OidcLocalUserService oidcLocalUserService(JdbcUserDetailsManager userDetailsManager, UserRepository userRepository) { return new OidcLocalUserService(userDetailsManager, userRepository); } @Bean public OidcAuthenticationSuccessEventListener oidcAuthenticationSuccessEventListener(OidcLocalUserService oidcLocalUserService) { return new OidcAuthenticationSuccessEventListener(oidcLocalUserService); } } @Profile("oidc") @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) @Configuration static class OidcWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter { private final InMemoryClientRegistrationRepository clientRegistrationRepository; private final OAuth2ResourceServerProperties oauth2ResourceServerProperties; public OidcWebSecurityConfigurerAdapter( InMemoryClientRegistrationRepository clientRegistrationRepository, OAuth2ResourceServerProperties oauth2ResourceServerProperties) { this.clientRegistrationRepository = clientRegistrationRepository; this.oauth2ResourceServerProperties = oauth2ResourceServerProperties; } @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable(); http.authorizeRequests(requests -> requests.antMatchers(BY_PASS_URLS).permitAll()); http.authorizeRequests(requests -> requests.anyRequest().authenticated()); http.oauth2Login(configure -> configure.clientRegistrationRepository( new ExcludeClientCredentialsClientRegistrationRepository( this.clientRegistrationRepository))); http.oauth2Client(); http.logout(configure -> { OidcClientInitiatedLogoutSuccessHandler logoutSuccessHandler = new OidcClientInitiatedLogoutSuccessHandler( this.clientRegistrationRepository); logoutSuccessHandler.setPostLogoutRedirectUri("{baseUrl}"); configure.logoutSuccessHandler(logoutSuccessHandler); }); // make jwt optional String jwtIssuerUri = this.oauth2ResourceServerProperties.getJwt().getIssuerUri(); if (!StringUtils.isBlank(jwtIssuerUri)) { http.oauth2ResourceServer().jwt(); } } } /** * default profile */ @Configuration @ConditionalOnMissingProfile({"ctrip", "auth", "ldap", "oidc"}) static class DefaultAuthAutoConfiguration { @Bean @ConditionalOnMissingBean(SsoHeartbeatHandler.class) public SsoHeartbeatHandler defaultSsoHeartbeatHandler() { return new DefaultSsoHeartbeatHandler(); } @Bean @ConditionalOnMissingBean(UserInfoHolder.class) public DefaultUserInfoHolder defaultUserInfoHolder() { return new DefaultUserInfoHolder(); } @Bean @ConditionalOnMissingBean(LogoutHandler.class) public DefaultLogoutHandler logoutHandler() { return new DefaultLogoutHandler(); } @Bean @ConditionalOnMissingBean(UserService.class) public UserService defaultUserService() { return new DefaultUserService(); } } @ConditionalOnMissingProfile({"auth", "ldap", "oidc"}) @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) static class DefaultWebSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable(); http.headers().frameOptions().sameOrigin(); } } }
1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./docs/zh/development/portal-how-to-implement-user-login-function.md
Apollo是配置管理系统,会提供权限管理(Authorization),理论上是不负责用户登录认证功能的实现(Authentication)。 所以Apollo定义了一些SPI用来解耦,Apollo接入登录的关键就是实现这些SPI。 ## 实现方式一:使用Apollo提供的Spring Security简单认证 可能很多公司并没有统一的登录认证系统,如果自己实现一套会比较麻烦。Apollo针对这种情况,从0.9.0开始提供了利用Spring Security实现的Http Basic简单认证版本。 使用步骤如下: ### 1. 安装0.9.0以上版本 >如果之前是0.8.0版本,需要导入[apolloportaldb-v080-v090.sql](https://github.com/ctripcorp/apollo/blob/master/scripts/sql/delta/v080-v090/apolloportaldb-v080-v090.sql) 查看ApolloPortalDB,应该已经存在`Users`表,并有一条初始记录。初始用户名是apollo,密码是admin。 |Id|Username|Password|Email|Enabled| |-|-|-|-|-| |1|apollo|$2a$10$7r20uS.BQ9uBpf3Baj3uQOZvMVvB1RN3PYoKE94gtz2.WAOuiiwXS|[email protected]|1| ### 2. 重启Portal 如果是IDE启动的话,确保`-Dapollo_profile=github,auth` ### 3. 添加用户 超级管理员登录系统后打开`管理员工具 - 用户管理`即可添加用户。 ### 4. 修改用户密码 超级管理员登录系统后打开`管理员工具 - 用户管理`,输入用户名和密码后即可修改用户密码,建议同时修改超级管理员apollo的密码。 ## 实现方式二: 接入LDAP 从1.2.0版本开始,Apollo支持了ldap协议的登录,按照如下方式配置即可。 > 如果采用helm chart部署方式,建议通过配置方式实现,不用修改镜像,可以参考[启用 LDAP 支持](zh/deployment/distributed-deployment-guide#_241449-启用-ldap-支持) ### 1. OpenLDAP接入方式 #### 1.1 配置`application-ldap.yml` 解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/config/application-ldap-openldap-sample.yml)),相关的内容需要按照具体情况调整: ```yml spring: ldap: base: "dc=example,dc=org" username: "cn=admin,dc=example,dc=org" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id userDisplayName: "cn" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 ``` ##### 1.1.1 基于memberOf过滤用户 OpenLDAP[开启memberOf特性](https://myanbin.github.io/post/enable-memberof-in-openldap.html)后,可以配置filter从而缩小用户搜索的范围: ```yml spring: ldap: base: "dc=example,dc=org" username: "cn=admin,dc=example,dc=org" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id userDisplayName: "cn" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 filter: # 配置过滤,目前只支持 memberOf memberOf: "cn=ServiceDEV,ou=DEV,dc=example,dc=org|cn=WebDEV,ou=DEV,dc=example,dc=org" # 只允许 memberOf 属性为 ServiceDEV 和 WebDEV 的用户访问 ``` ##### 1.1.2 基于Group过滤用户 从1.3.0版本开始支持基于Group过滤用户,从而可以控制只有特定Group的用户可以登录和使用apollo: ```yml spring: ldap: base: "dc=example,dc=org" username: "cn=admin,dc=example,dc=org" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id rdnKey: "uid" # ldap rdn key userDisplayName: "cn" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 group: # 启用group search,启用后只有特定group的用户可以登录apollo objectClass: "posixGroup" # 配置groupClassName groupBase: "ou=group" # group search base groupSearch: "(&(cn=dev))" # group filter groupMembership: "memberUid" # group memberShip eg. member or memberUid ``` #### 1.2 配置`startup.sh` 修改`scripts/startup.sh`,指定`spring.profiles.active`为`github,ldap`。 ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=/opt/logs/100003173 ## Adjust server port if necessary SERVER_PORT=8070 export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,ldap" ``` ### 2. Active Directory接入方式 #### 2.1 配置`application-ldap.yml` 解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/config/application-ldap-activedirectory-sample.yml)),相关的内容需要按照具体情况调整: ```yml spring: ldap: base: "dc=example,dc=com" username: "admin" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(sAMAccountName={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://1.1.1.1:389" ldap: mapping: # 配置 ldap 属性 objectClass: "user" # ldap 用户 objectClass 配置 loginId: "sAMAccountName" # ldap 用户惟一 id,用来作为登录的 id userDisplayName: "cn" # ldap 用户名,用来作为显示名 email: "userPrincipalName" # ldap 邮箱属性 filter: # 可选项,配置过滤,目前只支持 memberOf memberOf: "CN=ServiceDEV,OU=test,DC=example,DC=com|CN=WebDEV,OU=test,DC=example,DC=com" # 只允许 memberOf 属性为 ServiceDEV 和 WebDEV 的用户访问 ``` #### 2.2 配置`startup.sh` 修改`scripts/startup.sh`,指定`spring.profiles.active`为`github,ldap`。 ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=/opt/logs/100003173 ## Adjust server port if necessary SERVER_PORT=8070 export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,ldap" ``` ### 3. ApacheDS接入方式 #### 3.1 配置`application-ldap.yml` 解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/config/application-ldap-apacheds-sample.yml)),相关的内容需要按照具体情况调整: ```yml spring: ldap: base: "dc=example,dc=com" username: "uid=admin,ou=system" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:10389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id userDisplayName: "displayName" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 ``` ##### 3.1.1 基于Group过滤用户 从1.3.0版本开始支持基于Group过滤用户,从而可以控制只有特定Group的用户可以登录和使用apollo: ```yml spring: ldap: base: "dc=example,dc=com" username: "uid=admin,ou=system" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:10389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id rdnKey: "cn" # ldap rdn key userDisplayName: "displayName" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 group: # 配置ldap group,启用后只有特定group的用户可以登录apollo objectClass: "groupOfNames" # 配置groupClassName groupBase: "ou=group" # group search base groupSearch: "(&(cn=dev))" # group filter groupMembership: "member" # group memberShip eg. member or memberUid ``` #### 3.2 配置`startup.sh` 修改`scripts/startup.sh`,指定`spring.profiles.active`为`github,ldap`。 ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=/opt/logs/100003173 ## Adjust server port if necessary SERVER_PORT=8070 export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,ldap" ``` ## 实现方式三: 接入公司的统一登录认证系统 这种实现方式的前提是公司已经有统一的登录认证系统,最常见的比如SSO、LDAP等。接入时,实现以下SPI。其中UserService和UserInfoHolder是必须要实现的。 接口说明如下: * UserService(Required):用户服务,用来给Portal提供用户搜索相关功能 * UserInfoHolder(Required):获取当前登录用户信息,SSO一般都是把当前登录用户信息放在线程ThreadLocal上 * LogoutHandler(Optional):用来实现登出功能 * SsoHeartbeatHandler(Optional):Portal页面如果长时间不刷新,登录信息会过期。通过此接口来刷新登录信息 可以参考apollo-portal下的[com.ctrip.framework.apollo.portal.spi](https://github.com/ctripcorp/apollo/tree/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi)这个包下面的四个实现: 1. defaultimpl:默认实现,全局只有apollo一个账号 2. ctrip:ctrip实现,接入了SSO并实现用户搜索、查询接口 3. springsecurity: spring security实现,可以新增用户,修改用户密码等 4. ldap: [@pandalin](https://github.com/pandalin)和[codepiano](https://github.com/codepiano)贡献的ldap实现 实现了相关接口后,可以通过[com.ctrip.framework.apollo.portal.configuration.AuthConfiguration](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java)在运行时替换默认的实现。 接入SSO的思路如下: 1. SSO会提供一个jar包,需要配置一个filter 2. filter会拦截所有请求,检查是否已经登录 3. 如果没有登录,那么就会跳转到SSO的登录页面 4. 在SSO登录页面登录成功后,会跳转回apollo的页面,带上认证的信息 5. 再次进入SSO的filter,校验认证信息,把用户的信息保存下来,并且把用户凭证写入cookie或分布式session,以免下次还要重新登录 6. 进入Apollo的代码,Apollo的代码会调用UserInfoHolder.getUser获取当前登录用户 注意,以上1-5这几步都是SSO的代码,不是Apollo的代码,Apollo的代码只需要你实现第6步。 >注:运行时使用不同的实现是通过[Profiles](http://docs.spring.io/autorepo/docs/spring-boot/current/reference/html/boot-features-profiles.html)实现的,比如你自己的sso实现是在`custom` profile中的话,在打包脚本中可以指定-Dapollo_profile=github,custom。其中`github`是Apollo必须的一个profile,用于数据库的配置,`custom`是你自己实现的profile。同时需要注意在[AuthConfiguration](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java)中修改默认实现的条件 ,从`@ConditionalOnMissingProfile({"ctrip", "auth", "ldap"})`改为`@ConditionalOnMissingProfile({"ctrip", "auth", "ldap", "custom"})`。
Apollo是配置管理系统,会提供权限管理(Authorization),理论上是不负责用户登录认证功能的实现(Authentication)。 所以Apollo定义了一些SPI用来解耦,Apollo接入登录的关键就是实现这些SPI。 ## 实现方式一:使用Apollo提供的Spring Security简单认证 可能很多公司并没有统一的登录认证系统,如果自己实现一套会比较麻烦。Apollo针对这种情况,从0.9.0开始提供了利用Spring Security实现的Http Basic简单认证版本。 使用步骤如下: ### 1. 安装0.9.0以上版本 >如果之前是0.8.0版本,需要导入[apolloportaldb-v080-v090.sql](https://github.com/ctripcorp/apollo/blob/master/scripts/sql/delta/v080-v090/apolloportaldb-v080-v090.sql) 查看ApolloPortalDB,应该已经存在`Users`表,并有一条初始记录。初始用户名是apollo,密码是admin。 |Id|Username|Password|Email|Enabled| |-|-|-|-|-| |1|apollo|$2a$10$7r20uS.BQ9uBpf3Baj3uQOZvMVvB1RN3PYoKE94gtz2.WAOuiiwXS|[email protected]|1| ### 2. 重启Portal 如果是IDE启动的话,确保`-Dapollo_profile=github,auth` ### 3. 添加用户 超级管理员登录系统后打开`管理员工具 - 用户管理`即可添加用户。 ### 4. 修改用户密码 超级管理员登录系统后打开`管理员工具 - 用户管理`,输入用户名和密码后即可修改用户密码,建议同时修改超级管理员apollo的密码。 ## 实现方式二: 接入LDAP 从1.2.0版本开始,Apollo支持了ldap协议的登录,按照如下方式配置即可。 > 如果采用helm chart部署方式,建议通过配置方式实现,不用修改镜像,可以参考[启用 LDAP 支持](zh/deployment/distributed-deployment-guide#_241449-启用-ldap-支持) ### 1. OpenLDAP接入方式 #### 1.1 配置`application-ldap.yml` 解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/config/application-ldap-openldap-sample.yml)),相关的内容需要按照具体情况调整: ```yml spring: ldap: base: "dc=example,dc=org" username: "cn=admin,dc=example,dc=org" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id userDisplayName: "cn" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 ``` ##### 1.1.1 基于memberOf过滤用户 OpenLDAP[开启memberOf特性](https://myanbin.github.io/post/enable-memberof-in-openldap.html)后,可以配置filter从而缩小用户搜索的范围: ```yml spring: ldap: base: "dc=example,dc=org" username: "cn=admin,dc=example,dc=org" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id userDisplayName: "cn" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 filter: # 配置过滤,目前只支持 memberOf memberOf: "cn=ServiceDEV,ou=DEV,dc=example,dc=org|cn=WebDEV,ou=DEV,dc=example,dc=org" # 只允许 memberOf 属性为 ServiceDEV 和 WebDEV 的用户访问 ``` ##### 1.1.2 基于Group过滤用户 从1.3.0版本开始支持基于Group过滤用户,从而可以控制只有特定Group的用户可以登录和使用apollo: ```yml spring: ldap: base: "dc=example,dc=org" username: "cn=admin,dc=example,dc=org" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id rdnKey: "uid" # ldap rdn key userDisplayName: "cn" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 group: # 启用group search,启用后只有特定group的用户可以登录apollo objectClass: "posixGroup" # 配置groupClassName groupBase: "ou=group" # group search base groupSearch: "(&(cn=dev))" # group filter groupMembership: "memberUid" # group memberShip eg. member or memberUid ``` #### 1.2 配置`startup.sh` 修改`scripts/startup.sh`,指定`spring.profiles.active`为`github,ldap`。 ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=/opt/logs/100003173 ## Adjust server port if necessary SERVER_PORT=8070 export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,ldap" ``` ### 2. Active Directory接入方式 #### 2.1 配置`application-ldap.yml` 解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/config/application-ldap-activedirectory-sample.yml)),相关的内容需要按照具体情况调整: ```yml spring: ldap: base: "dc=example,dc=com" username: "admin" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(sAMAccountName={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://1.1.1.1:389" ldap: mapping: # 配置 ldap 属性 objectClass: "user" # ldap 用户 objectClass 配置 loginId: "sAMAccountName" # ldap 用户惟一 id,用来作为登录的 id userDisplayName: "cn" # ldap 用户名,用来作为显示名 email: "userPrincipalName" # ldap 邮箱属性 filter: # 可选项,配置过滤,目前只支持 memberOf memberOf: "CN=ServiceDEV,OU=test,DC=example,DC=com|CN=WebDEV,OU=test,DC=example,DC=com" # 只允许 memberOf 属性为 ServiceDEV 和 WebDEV 的用户访问 ``` #### 2.2 配置`startup.sh` 修改`scripts/startup.sh`,指定`spring.profiles.active`为`github,ldap`。 ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=/opt/logs/100003173 ## Adjust server port if necessary SERVER_PORT=8070 export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,ldap" ``` ### 3. ApacheDS接入方式 #### 3.1 配置`application-ldap.yml` 解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/config/application-ldap-apacheds-sample.yml)),相关的内容需要按照具体情况调整: ```yml spring: ldap: base: "dc=example,dc=com" username: "uid=admin,ou=system" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:10389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id userDisplayName: "displayName" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 ``` ##### 3.1.1 基于Group过滤用户 从1.3.0版本开始支持基于Group过滤用户,从而可以控制只有特定Group的用户可以登录和使用apollo: ```yml spring: ldap: base: "dc=example,dc=com" username: "uid=admin,ou=system" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:10389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id rdnKey: "cn" # ldap rdn key userDisplayName: "displayName" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 group: # 配置ldap group,启用后只有特定group的用户可以登录apollo objectClass: "groupOfNames" # 配置groupClassName groupBase: "ou=group" # group search base groupSearch: "(&(cn=dev))" # group filter groupMembership: "member" # group memberShip eg. member or memberUid ``` #### 3.2 配置`startup.sh` 修改`scripts/startup.sh`,指定`spring.profiles.active`为`github,ldap`。 ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=/opt/logs/100003173 ## Adjust server port if necessary SERVER_PORT=8070 export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,ldap" ``` ## 实现方式三: 接入OIDC 从 1.8.0 版本开始支持 OpenID Connect 登录, 这种实现方式的前提是已经部署了 OpenID Connect 登录服务 配置前需要准备: * OpenID Connect 的提供者配置端点(符合 RFC 8414 标准的 issuer-uri), 需要是 **https** 的, 例如 https://host:port/auth/realms/apollo/.well-known/openid-configuration * 在 OpenID Connect 服务里创建一个 client, 获取 client-id 以及对应的 client-secret ### 1. 配置 `application-oidc.yml` 解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-oidc.yml`,内容参考如下([样例](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/config/application-oidc-sample.yml)),相关的内容需要按照具体情况调整: #### 1.1 最小配置 ```yml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri # 例如 你的 issuer-uri 是 https://host:port/auth/realms/apollo/.well-known/openid-configuration, 那么此处只需要配置 https://host:port/auth/realms/apollo 即可, spring boot 处理的时候会加上 /.well-known/openid-configuration 的后缀 issuer-uri: https://host:port/auth/realms/apollo registration: # registration-name 是 oidc 客户端的名称, 任意字符均可, oidc 登录必须配置一个 authorization_code 类型的 registration registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name # openid 为 oidc 登录的必须 scope, 此处可以添加其它自定义的 scope scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 从安全角度考虑更推荐使用环境变量来配置, 环境变量的命名规则为: 将配置项的 key 当中的 点(.)、横杠(-)替换为下划线(_), 然后将所有字母改为大写, spring boot 会自动处理符合此规则的环境变量 # 例如 spring.security.oauth2.client.registration.registration-name.client-secret -> SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 可以替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx ``` #### 1.2 扩展配置 * 如果 OpenID Connect 登录服务支持 client_credentials 模式, 还可以再配置一个 client_credentials 类型的 registration, 用于 apollo-portal 作为客户端请求其它被 oidc 保护的资源 * 如果 OpenID Connect 登录服务支持 jwt, 还可以配置 ${spring.security.oauth2.resourceserver.jwt.issuer-uri}, 以支持通过 jwt 访问 apollo-portal ```yml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可, oidc 登录必须配置一个 authorization_code 类型的 registration registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name # openid 为 oidc 登录的必须 scope, 此处可以添加其它自定义的 scope scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 从安全角度考虑更推荐使用环境变量来配置, 环境变量的命名规则为: 将配置项的 key 当中的 点(.)、横杠(-)替换为下划线(_), 然后将所有字母改为大写, spring boot 会自动处理符合此规则的环境变量 # 例如 spring.security.oauth2.client.registration.registration-name.client-secret -> SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 可以替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 用于 apollo-portal 作为客户端请求其它被 oidc 保护的资源, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name # openid 为 oidc 登录的必须 scope, 此处可以添加其它自定义的 scope scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri # 例如 你的 issuer-uri 是 https://host:port/auth/realms/apollo/.well-known/openid-configuration, 那么此处只需要配置 https://host:port/auth/realms/apollo 即可, spring boot 处理的时候会自动加上 /.well-known/openid-configuration 的后缀 issuer-uri: https://host:port/auth/realms/apollo ``` ### 2. 配置 `startup.sh` 修改`scripts/startup.sh`,指定`spring.profiles.active`为`github,oidc`。 ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=/opt/logs/100003173 ## Adjust server port if necessary SERVER_PORT=8070 export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,oidc" ``` ## 实现方式四: 接入公司的统一登录认证系统 这种实现方式的前提是公司已经有统一的登录认证系统,最常见的比如SSO、LDAP等。接入时,实现以下SPI。其中UserService和UserInfoHolder是必须要实现的。 接口说明如下: * UserService(Required):用户服务,用来给Portal提供用户搜索相关功能 * UserInfoHolder(Required):获取当前登录用户信息,SSO一般都是把当前登录用户信息放在线程ThreadLocal上 * LogoutHandler(Optional):用来实现登出功能 * SsoHeartbeatHandler(Optional):Portal页面如果长时间不刷新,登录信息会过期。通过此接口来刷新登录信息 可以参考apollo-portal下的[com.ctrip.framework.apollo.portal.spi](https://github.com/ctripcorp/apollo/tree/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi)这个包下面的四个实现: 1. defaultimpl:默认实现,全局只有apollo一个账号 2. ctrip:ctrip实现,接入了SSO并实现用户搜索、查询接口 3. springsecurity: spring security实现,可以新增用户,修改用户密码等 4. ldap: [@pandalin](https://github.com/pandalin)和[codepiano](https://github.com/codepiano)贡献的ldap实现 实现了相关接口后,可以通过[com.ctrip.framework.apollo.portal.configuration.AuthConfiguration](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java)在运行时替换默认的实现。 接入SSO的思路如下: 1. SSO会提供一个jar包,需要配置一个filter 2. filter会拦截所有请求,检查是否已经登录 3. 如果没有登录,那么就会跳转到SSO的登录页面 4. 在SSO登录页面登录成功后,会跳转回apollo的页面,带上认证的信息 5. 再次进入SSO的filter,校验认证信息,把用户的信息保存下来,并且把用户凭证写入cookie或分布式session,以免下次还要重新登录 6. 进入Apollo的代码,Apollo的代码会调用UserInfoHolder.getUser获取当前登录用户 注意,以上1-5这几步都是SSO的代码,不是Apollo的代码,Apollo的代码只需要你实现第6步。 >注:运行时使用不同的实现是通过[Profiles](http://docs.spring.io/autorepo/docs/spring-boot/current/reference/html/boot-features-profiles.html)实现的,比如你自己的sso实现是在`custom` profile中的话,在打包脚本中可以指定-Dapollo_profile=github,custom。其中`github`是Apollo必须的一个profile,用于数据库的配置,`custom`是你自己实现的profile。同时需要注意在[AuthConfiguration](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java)中修改默认实现的条件 ,从`@ConditionalOnMissingProfile({"ctrip", "auth", "ldap"})`改为`@ConditionalOnMissingProfile({"ctrip", "auth", "ldap", "custom"})`。
1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ClusterController.java
package com.ctrip.framework.apollo.portal.controller; import com.ctrip.framework.apollo.common.dto.ClusterDTO; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.service.ClusterService; import com.ctrip.framework.apollo.portal.spi.UserInfoHolder; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.validation.Valid; @RestController public class ClusterController { private final ClusterService clusterService; private final UserInfoHolder userInfoHolder; public ClusterController(final ClusterService clusterService, final UserInfoHolder userInfoHolder) { this.clusterService = clusterService; this.userInfoHolder = userInfoHolder; } @PreAuthorize(value = "@permissionValidator.hasCreateClusterPermission(#appId)") @PostMapping(value = "apps/{appId}/envs/{env}/clusters") public ClusterDTO createCluster(@PathVariable String appId, @PathVariable String env, @Valid @RequestBody ClusterDTO cluster) { String operator = userInfoHolder.getUser().getUserId(); cluster.setDataChangeLastModifiedBy(operator); cluster.setDataChangeCreatedBy(operator); return clusterService.createCluster(Env.valueOf(env), cluster); } @PreAuthorize(value = "@permissionValidator.isSuperAdmin()") @DeleteMapping(value = "apps/{appId}/envs/{env}/clusters/{clusterName:.+}") public ResponseEntity<Void> deleteCluster(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName){ clusterService.deleteCluster(Env.valueOf(env), appId, clusterName); return ResponseEntity.ok().build(); } @GetMapping(value = "apps/{appId}/envs/{env}/clusters/{clusterName:.+}") public ClusterDTO loadCluster(@PathVariable("appId") String appId, @PathVariable String env, @PathVariable("clusterName") String clusterName) { return clusterService.loadCluster(appId, Env.valueOf(env), clusterName); } }
package com.ctrip.framework.apollo.portal.controller; import com.ctrip.framework.apollo.common.dto.ClusterDTO; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.service.ClusterService; import com.ctrip.framework.apollo.portal.spi.UserInfoHolder; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.validation.Valid; @RestController public class ClusterController { private final ClusterService clusterService; private final UserInfoHolder userInfoHolder; public ClusterController(final ClusterService clusterService, final UserInfoHolder userInfoHolder) { this.clusterService = clusterService; this.userInfoHolder = userInfoHolder; } @PreAuthorize(value = "@permissionValidator.hasCreateClusterPermission(#appId)") @PostMapping(value = "apps/{appId}/envs/{env}/clusters") public ClusterDTO createCluster(@PathVariable String appId, @PathVariable String env, @Valid @RequestBody ClusterDTO cluster) { String operator = userInfoHolder.getUser().getUserId(); cluster.setDataChangeLastModifiedBy(operator); cluster.setDataChangeCreatedBy(operator); return clusterService.createCluster(Env.valueOf(env), cluster); } @PreAuthorize(value = "@permissionValidator.isSuperAdmin()") @DeleteMapping(value = "apps/{appId}/envs/{env}/clusters/{clusterName:.+}") public ResponseEntity<Void> deleteCluster(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName){ clusterService.deleteCluster(Env.valueOf(env), appId, clusterName); return ResponseEntity.ok().build(); } @GetMapping(value = "apps/{appId}/envs/{env}/clusters/{clusterName:.+}") public ClusterDTO loadCluster(@PathVariable("appId") String appId, @PathVariable String env, @PathVariable("clusterName") String clusterName) { return clusterService.loadCluster(appId, Env.valueOf(env), clusterName); } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/repository/RoleRepository.java
package com.ctrip.framework.apollo.portal.repository; import com.ctrip.framework.apollo.portal.entity.po.Role; import java.util.List; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; /** * @author Jason Song([email protected]) */ public interface RoleRepository extends PagingAndSortingRepository<Role, Long> { /** * find role by role name */ Role findTopByRoleName(String roleName); @Query("SELECT r.id from Role r where (r.roleName = CONCAT('Master+', ?1) " + "OR r.roleName like CONCAT('ModifyNamespace+', ?1, '+%') " + "OR r.roleName like CONCAT('ReleaseNamespace+', ?1, '+%') " + "OR r.roleName = CONCAT('ManageAppMaster+', ?1))") List<Long> findRoleIdsByAppId(String appId); @Query("SELECT r.id from Role r where (r.roleName = CONCAT('ModifyNamespace+', ?1, '+', ?2) " + "OR r.roleName = CONCAT('ReleaseNamespace+', ?1, '+', ?2))") List<Long> findRoleIdsByAppIdAndNamespace(String appId, String namespaceName); @Modifying @Query("UPDATE Role SET IsDeleted=1, DataChange_LastModifiedBy = ?2 WHERE Id in ?1") Integer batchDelete(List<Long> roleIds, String operator); }
package com.ctrip.framework.apollo.portal.repository; import com.ctrip.framework.apollo.portal.entity.po.Role; import java.util.List; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; /** * @author Jason Song([email protected]) */ public interface RoleRepository extends PagingAndSortingRepository<Role, Long> { /** * find role by role name */ Role findTopByRoleName(String roleName); @Query("SELECT r.id from Role r where (r.roleName = CONCAT('Master+', ?1) " + "OR r.roleName like CONCAT('ModifyNamespace+', ?1, '+%') " + "OR r.roleName like CONCAT('ReleaseNamespace+', ?1, '+%') " + "OR r.roleName = CONCAT('ManageAppMaster+', ?1))") List<Long> findRoleIdsByAppId(String appId); @Query("SELECT r.id from Role r where (r.roleName = CONCAT('ModifyNamespace+', ?1, '+', ?2) " + "OR r.roleName = CONCAT('ReleaseNamespace+', ?1, '+', ?2))") List<Long> findRoleIdsByAppIdAndNamespace(String appId, String namespaceName); @Modifying @Query("UPDATE Role SET IsDeleted=1, DataChange_LastModifiedBy = ?2 WHERE Id in ?1") Integer batchDelete(List<Long> roleIds, String operator); }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-configservice/src/test/java/com/ctrip/framework/apollo/configservice/util/InstanceConfigAuditUtilTest.java
package com.ctrip.framework.apollo.configservice.util; import com.ctrip.framework.apollo.biz.entity.Instance; import com.ctrip.framework.apollo.biz.entity.InstanceConfig; import com.ctrip.framework.apollo.biz.service.InstanceService; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.springframework.test.util.ReflectionTestUtils; import java.util.Objects; import java.util.concurrent.BlockingQueue; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.*; /** * @author Jason Song([email protected]) */ @RunWith(MockitoJUnitRunner.class) public class InstanceConfigAuditUtilTest { private InstanceConfigAuditUtil instanceConfigAuditUtil; @Mock private InstanceService instanceService; private BlockingQueue<InstanceConfigAuditUtil.InstanceConfigAuditModel> audits; private String someAppId; private String someConfigClusterName; private String someClusterName; private String someDataCenter; private String someIp; private String someConfigAppId; private String someConfigNamespace; private String someReleaseKey; private InstanceConfigAuditUtil.InstanceConfigAuditModel someAuditModel; @Before public void setUp() throws Exception { instanceConfigAuditUtil = new InstanceConfigAuditUtil(instanceService); audits = (BlockingQueue<InstanceConfigAuditUtil.InstanceConfigAuditModel>) ReflectionTestUtils.getField(instanceConfigAuditUtil, "audits"); someAppId = "someAppId"; someClusterName = "someClusterName"; someDataCenter = "someDataCenter"; someIp = "someIp"; someConfigAppId = "someConfigAppId"; someConfigClusterName = "someConfigClusterName"; someConfigNamespace = "someConfigNamespace"; someReleaseKey = "someReleaseKey"; someAuditModel = new InstanceConfigAuditUtil.InstanceConfigAuditModel(someAppId, someClusterName, someDataCenter, someIp, someConfigAppId, someConfigClusterName, someConfigNamespace, someReleaseKey); } @Test public void testAudit() throws Exception { boolean result = instanceConfigAuditUtil.audit(someAppId, someClusterName, someDataCenter, someIp, someConfigAppId, someConfigClusterName, someConfigNamespace, someReleaseKey); InstanceConfigAuditUtil.InstanceConfigAuditModel audit = audits.poll(); assertTrue(result); assertTrue(Objects.equals(someAuditModel, audit)); } @Test public void testDoAudit() throws Exception { long someInstanceId = 1; Instance someInstance = mock(Instance.class); when(someInstance.getId()).thenReturn(someInstanceId); when(instanceService.createInstance(any(Instance.class))).thenReturn(someInstance); instanceConfigAuditUtil.doAudit(someAuditModel); verify(instanceService, times(1)).findInstance(someAppId, someClusterName, someDataCenter, someIp); verify(instanceService, times(1)).createInstance(any(Instance.class)); verify(instanceService, times(1)).findInstanceConfig(someInstanceId, someConfigAppId, someConfigNamespace); verify(instanceService, times(1)).createInstanceConfig(any(InstanceConfig.class)); } }
package com.ctrip.framework.apollo.configservice.util; import com.ctrip.framework.apollo.biz.entity.Instance; import com.ctrip.framework.apollo.biz.entity.InstanceConfig; import com.ctrip.framework.apollo.biz.service.InstanceService; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.springframework.test.util.ReflectionTestUtils; import java.util.Objects; import java.util.concurrent.BlockingQueue; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.*; /** * @author Jason Song([email protected]) */ @RunWith(MockitoJUnitRunner.class) public class InstanceConfigAuditUtilTest { private InstanceConfigAuditUtil instanceConfigAuditUtil; @Mock private InstanceService instanceService; private BlockingQueue<InstanceConfigAuditUtil.InstanceConfigAuditModel> audits; private String someAppId; private String someConfigClusterName; private String someClusterName; private String someDataCenter; private String someIp; private String someConfigAppId; private String someConfigNamespace; private String someReleaseKey; private InstanceConfigAuditUtil.InstanceConfigAuditModel someAuditModel; @Before public void setUp() throws Exception { instanceConfigAuditUtil = new InstanceConfigAuditUtil(instanceService); audits = (BlockingQueue<InstanceConfigAuditUtil.InstanceConfigAuditModel>) ReflectionTestUtils.getField(instanceConfigAuditUtil, "audits"); someAppId = "someAppId"; someClusterName = "someClusterName"; someDataCenter = "someDataCenter"; someIp = "someIp"; someConfigAppId = "someConfigAppId"; someConfigClusterName = "someConfigClusterName"; someConfigNamespace = "someConfigNamespace"; someReleaseKey = "someReleaseKey"; someAuditModel = new InstanceConfigAuditUtil.InstanceConfigAuditModel(someAppId, someClusterName, someDataCenter, someIp, someConfigAppId, someConfigClusterName, someConfigNamespace, someReleaseKey); } @Test public void testAudit() throws Exception { boolean result = instanceConfigAuditUtil.audit(someAppId, someClusterName, someDataCenter, someIp, someConfigAppId, someConfigClusterName, someConfigNamespace, someReleaseKey); InstanceConfigAuditUtil.InstanceConfigAuditModel audit = audits.poll(); assertTrue(result); assertTrue(Objects.equals(someAuditModel, audit)); } @Test public void testDoAudit() throws Exception { long someInstanceId = 1; Instance someInstance = mock(Instance.class); when(someInstance.getId()).thenReturn(someInstanceId); when(instanceService.createInstance(any(Instance.class))).thenReturn(someInstance); instanceConfigAuditUtil.doAudit(someAuditModel); verify(instanceService, times(1)).findInstance(someAppId, someClusterName, someDataCenter, someIp); verify(instanceService, times(1)).createInstance(any(Instance.class)); verify(instanceService, times(1)).findInstanceConfig(someInstanceId, someConfigAppId, someConfigNamespace); verify(instanceService, times(1)).createInstanceConfig(any(InstanceConfig.class)); } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/emailbuilder/MergeEmailBuilder.java
package com.ctrip.framework.apollo.portal.component.emailbuilder; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.entity.bo.ReleaseHistoryBO; import org.springframework.stereotype.Component; @Component public class MergeEmailBuilder extends ConfigPublishEmailBuilder { private static final String EMAIL_SUBJECT = "[Apollo] 全量发布"; @Override protected String subject() { return EMAIL_SUBJECT; } @Override protected String emailContent(Env env, ReleaseHistoryBO releaseHistory) { return renderEmailCommonContent(env, releaseHistory); } @Override protected String getTemplateFramework() { return portalConfig.emailTemplateFramework(); } @Override protected String getDiffModuleTemplate() { return portalConfig.emailReleaseDiffModuleTemplate(); } }
package com.ctrip.framework.apollo.portal.component.emailbuilder; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.entity.bo.ReleaseHistoryBO; import org.springframework.stereotype.Component; @Component public class MergeEmailBuilder extends ConfigPublishEmailBuilder { private static final String EMAIL_SUBJECT = "[Apollo] 全量发布"; @Override protected String subject() { return EMAIL_SUBJECT; } @Override protected String emailContent(Env env, ReleaseHistoryBO releaseHistory) { return renderEmailCommonContent(env, releaseHistory); } @Override protected String getTemplateFramework() { return portalConfig.emailTemplateFramework(); } @Override protected String getDiffModuleTemplate() { return portalConfig.emailReleaseDiffModuleTemplate(); } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-demo/src/main/resources/spring.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:apollo="http://www.ctrip.com/schema/apollo" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd"> <apollo:config order="10"/> <apollo:config namespaces="TEST1.apollo,application.yaml" order="11"/> <bean class="com.ctrip.framework.apollo.demo.spring.xmlConfigDemo.bean.XmlBean"> <property name="timeout" value="${timeout:200}"/> <property name="batch" value="${batch:100}"/> </bean> <context:annotation-config /> </beans>
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:apollo="http://www.ctrip.com/schema/apollo" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd"> <apollo:config order="10"/> <apollo:config namespaces="TEST1.apollo,application.yaml" order="11"/> <bean class="com.ctrip.framework.apollo.demo.spring.xmlConfigDemo.bean.XmlBean"> <property name="timeout" value="${timeout:200}"/> <property name="batch" value="${batch:100}"/> </bean> <context:annotation-config /> </beans>
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./docs/zh/usage/dotnet-sdk-user-guide.md
>注意:本文档适用对象是Apollo系统的使用者,如果你是公司内Apollo系统的开发者/维护人员,建议先参考[Apollo开发指南](zh/development/apollo-development-guide)。 # &nbsp; # 一、准备工作 ## 1.1 环境要求 * .Net: 4.0+ ## 1.2 必选设置 Apollo客户端依赖于`AppId`,`Environment`等环境信息来工作,所以请确保阅读下面的说明并且做正确的配置: ### 1.2.1 AppId AppId是应用的身份信息,是从服务端获取配置的一个重要信息。 请确保在app.config或web.config有AppID的配置,其中内容形如: ```xml <?xml version="1.0"?> <configuration> <appSettings> <!-- Change to the actual app id --> <add key="AppID" value="100004458"/> </appSettings> </configuration> ``` > 注:app.id是用来标识应用身份的唯一id,格式为string。 ### 1.2.2 Environment Apollo支持应用在不同的环境有不同的配置,所以Environment是另一个从服务器获取配置的重要信息。 Environment通过配置文件来指定,文件位置为`C:\opt\settings\server.properties`,文件内容形如: ```properties env=DEV ``` 目前,`env`支持以下几个值(大小写不敏感): * DEV * Development environment * FAT * Feature Acceptance Test environment * UAT * User Acceptance Test environment * PRO * Production environment ### 1.2.3 服务地址 Apollo客户端针对不同的环境会从不同的服务器获取配置,所以请确保在app.config或web.config正确配置了服务器地址(Apollo.{ENV}.Meta),其中内容形如: ```xml <?xml version="1.0"?> <configuration> <appSettings> <!-- Change to the actual app id --> <add key="AppID" value="100004458"/> <!-- Should change the apollo config service url for each environment --> <add key="Apollo.DEV.Meta" value="http://dev-configservice:8080"/> <add key="Apollo.FAT.Meta" value="http://fat-configservice:8080"/> <add key="Apollo.UAT.Meta" value="http://uat-configservice:8080"/> <add key="Apollo.PRO.Meta" value="http://pro-configservice:8080"/> </appSettings> </configuration> ``` ### 1.2.4 本地缓存路径 Apollo客户端会把从服务端获取到的配置在本地文件系统缓存一份,用于在遇到服务不可用,或网络不通的时候,依然能从本地恢复配置,不影响应用正常运行。 本地缓存路径位于`C:\opt\data\{appId}\config-cache`,所以请确保`C:\opt\data\`目录存在,且应用有读写权限。 ### 1.2.5 可选设置 **Cluster**(集群) Apollo支持配置按照集群划分,也就是说对于一个appId和一个环境,对不同的集群可以有不同的配置。 如果需要使用这个功能,你可以通过以下方式来指定运行时的集群: 1. 通过App Config * 我们可以在App.config文件中设置Apollo.Cluster来指定运行时集群(注意大小写) * 例如,下面的截图配置指定了运行时的集群为SomeCluster * ![apollo-net-apollo-cluster](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-net-apollo-cluster.png) 2. 通过配置文件 * 首先确保`C:\opt\settings\server.properties`在目标机器上存在 * 在这个文件中,可以设置数据中心集群,如`idc=xxx` * 注意key为全小写 **Cluster Precedence**(集群顺序) 1. 如果`Apollo.Cluster`和`idc`同时指定: * 我们会首先尝试从`Apollo.Cluster`指定的集群加载配置 * 如果没找到任何配置,会尝试从`idc`指定的集群加载配置 * 如果还是没找到,会从默认的集群(`default`)加载 2. 如果只指定了`Apollo.Cluster`: * 我们会首先尝试从`Apollo.Cluster`指定的集群加载配置 * 如果没找到,会从默认的集群(`default`)加载 3. 如果只指定了`idc`: * 我们会首先尝试从`idc`指定的集群加载配置 * 如果没找到,会从默认的集群(`default`)加载 4. 如果`Apollo.Cluster`和`idc`都没有指定: * 我们会从默认的集群(`default`)加载配置 # 二、DLL引用 .Net客户端项目地址位于:[https://github.com/ctripcorp/apollo.net](https://github.com/ctripcorp/apollo.net)。 将项目下载到本地,切换到`Release`配置,编译Solution后会在`apollo.net\Apollo\bin\Release`中生成`Framework.Apollo.Client.dll`。 在应用中引用`Framework.Apollo.Client.dll`即可。 如果需要支持.Net Core的Apollo版本,可以参考[dotnet-core](https://github.com/ctripcorp/apollo.net/tree/dotnet-core)以及[nuget仓库](https://www.nuget.org/packages?q=Com.Ctrip.Framework.Apollo) # 三、客户端用法 ## 3.1 获取默认namespace的配置(application) ```c# Config config = ConfigService.GetAppConfig(); //config instance is singleton for each namespace and is never null string someKey = "someKeyFromDefaultNamespace"; string someDefaultValue = "someDefaultValueForTheKey"; string value = config.GetProperty(someKey, someDefaultValue); ``` 通过上述的**config.GetProperty**可以获取到someKey对应的实时最新的配置值。 另外,配置值从内存中获取,所以不需要应用自己做缓存。 ## 3.2 监听配置变化事件 监听配置变化事件只在应用真的关心配置变化,需要在配置变化时得到通知时使用,比如:数据库连接串变化后需要重建连接等。 如果只是希望每次都取到最新的配置的话,只需要按照上面的例子,调用**config.GetProperty**即可。 ```c# Config config = ConfigService.GetAppConfig(); //config instance is singleton for each namespace and is never null config.ConfigChanged += new ConfigChangeEvent(OnChanged); private void OnChanged(object sender, ConfigChangeEventArgs changeEvent) { Console.WriteLine("Changes for namespace {0}", changeEvent.Namespace); foreach (string key in changeEvent.ChangedKeys) { ConfigChange change = changeEvent.GetChange(key); Console.WriteLine("Change - key: {0}, oldValue: {1}, newValue: {2}, changeType: {3}", change.PropertyName, change.OldValue, change.NewValue, change.ChangeType); } } ``` ## 3.3 获取公共Namespace的配置 ```c# string somePublicNamespace = "CAT"; Config config = ConfigService.GetConfig(somePublicNamespace); //config instance is singleton for each namespace and is never null string someKey = "someKeyFromPublicNamespace"; string someDefaultValue = "someDefaultValueForTheKey"; string value = config.GetProperty(someKey, someDefaultValue); ``` ## 3.4 Demo apollo.net项目中有一个样例客户端的项目:`ApolloDemo`,具体信息可以参考[Apollo开发指南](zh/development/apollo-development-guide)中的[2.4 .Net样例客户端启动](zh/development/apollo-development-guide?id=_24-net样例客户端启动)部分。 >注:Apollo .Net客户端开源版目前默认会把日志直接输出到Console,大家可以自己实现Logging相关功能。 > > 详见[https://github.com/ctripcorp/apollo.net/tree/master/Apollo/Logging/Spi](https://github.com/ctripcorp/apollo.net/tree/master/Apollo/Logging/Spi) # 四、客户端设计 ![client-architecture](https://github.com/ctripcorp/apollo/raw/master/doc/images/client-architecture.png) 上图简要描述了Apollo客户端的实现原理: 1. 客户端和服务端保持了一个长连接,从而能第一时间获得配置更新的推送。(通过Http Long Polling实现) 2. 客户端还会定时从Apollo配置中心服务端拉取应用的最新配置。 * 这是一个fallback机制,为了防止推送机制失效导致配置不更新 * 客户端定时拉取会上报本地版本,所以一般情况下,对于定时拉取的操作,服务端都会返回304 - Not Modified * 定时频率默认为每5分钟拉取一次,客户端也可以通过App.config设置`Apollo.RefreshInterval`来覆盖,单位为毫秒。 3. 客户端从Apollo配置中心服务端获取到应用的最新配置后,会保存在内存中 4. 客户端会把从服务端获取到的配置在本地文件系统缓存一份 * 在遇到服务不可用,或网络不通的时候,依然能从本地恢复配置 5. 应用程序可以从Apollo客户端获取最新的配置、订阅配置更新通知 # 五、本地开发模式 Apollo客户端还支持本地开发模式,这个主要用于当开发环境无法连接Apollo服务器的时候,比如在邮轮、飞机上做相关功能开发。 在本地开发模式下,Apollo只会从本地文件读取配置信息,不会从Apollo服务器读取配置。 可以通过下面的步骤开启Apollo本地开发模式。 ## 5.1 修改环境 修改C:\opt\settings\server.properties文件,设置env为Local: ```properties env=Local ``` ## 5.2 准备本地配置文件 在本地开发模式下,Apollo客户端会从本地读取文件,所以我们需要事先准备好配置文件。 ### 5.2.1 本地配置目录 本地配置目录位于:C:\opt\data\\{_appId_}\config-cache。 appId就是应用的appId,如100004458。 请确保该目录存在,且应用程序对该目录有读权限。 **【小技巧】** 推荐的方式是先在普通模式下使用Apollo,这样Apollo会自动创建该目录并在目录下生成配置文件。 ### 5.2.2 本地配置文件 本地配置文件需要按照一定的文件名格式放置于本地配置目录下,文件名格式如下: **_{appId}+{cluster}+{namespace}.json_** * appId就是应用自己的appId,如100004458 * cluster就是应用使用的集群,一般在本地模式下没有做过配置的话,就是default * namespace就是应用使用配置namespace,一般是application ![client-local-cache](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-net-config-cache.png) 文件内容以json格式存储,比如如果有两个key,一个是request.timeout,另一个是batch,那么文件内容就是如下格式: ```json { "request.timeout":"1000", "batch":"2000" } ``` ## 5.3 修改配置 在本地开发模式下,Apollo不会实时监测文件内容是否有变化,所以如果修改了配置,需要重启应用生效。
>注意:本文档适用对象是Apollo系统的使用者,如果你是公司内Apollo系统的开发者/维护人员,建议先参考[Apollo开发指南](zh/development/apollo-development-guide)。 # &nbsp; # 一、准备工作 ## 1.1 环境要求 * .Net: 4.0+ ## 1.2 必选设置 Apollo客户端依赖于`AppId`,`Environment`等环境信息来工作,所以请确保阅读下面的说明并且做正确的配置: ### 1.2.1 AppId AppId是应用的身份信息,是从服务端获取配置的一个重要信息。 请确保在app.config或web.config有AppID的配置,其中内容形如: ```xml <?xml version="1.0"?> <configuration> <appSettings> <!-- Change to the actual app id --> <add key="AppID" value="100004458"/> </appSettings> </configuration> ``` > 注:app.id是用来标识应用身份的唯一id,格式为string。 ### 1.2.2 Environment Apollo支持应用在不同的环境有不同的配置,所以Environment是另一个从服务器获取配置的重要信息。 Environment通过配置文件来指定,文件位置为`C:\opt\settings\server.properties`,文件内容形如: ```properties env=DEV ``` 目前,`env`支持以下几个值(大小写不敏感): * DEV * Development environment * FAT * Feature Acceptance Test environment * UAT * User Acceptance Test environment * PRO * Production environment ### 1.2.3 服务地址 Apollo客户端针对不同的环境会从不同的服务器获取配置,所以请确保在app.config或web.config正确配置了服务器地址(Apollo.{ENV}.Meta),其中内容形如: ```xml <?xml version="1.0"?> <configuration> <appSettings> <!-- Change to the actual app id --> <add key="AppID" value="100004458"/> <!-- Should change the apollo config service url for each environment --> <add key="Apollo.DEV.Meta" value="http://dev-configservice:8080"/> <add key="Apollo.FAT.Meta" value="http://fat-configservice:8080"/> <add key="Apollo.UAT.Meta" value="http://uat-configservice:8080"/> <add key="Apollo.PRO.Meta" value="http://pro-configservice:8080"/> </appSettings> </configuration> ``` ### 1.2.4 本地缓存路径 Apollo客户端会把从服务端获取到的配置在本地文件系统缓存一份,用于在遇到服务不可用,或网络不通的时候,依然能从本地恢复配置,不影响应用正常运行。 本地缓存路径位于`C:\opt\data\{appId}\config-cache`,所以请确保`C:\opt\data\`目录存在,且应用有读写权限。 ### 1.2.5 可选设置 **Cluster**(集群) Apollo支持配置按照集群划分,也就是说对于一个appId和一个环境,对不同的集群可以有不同的配置。 如果需要使用这个功能,你可以通过以下方式来指定运行时的集群: 1. 通过App Config * 我们可以在App.config文件中设置Apollo.Cluster来指定运行时集群(注意大小写) * 例如,下面的截图配置指定了运行时的集群为SomeCluster * ![apollo-net-apollo-cluster](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-net-apollo-cluster.png) 2. 通过配置文件 * 首先确保`C:\opt\settings\server.properties`在目标机器上存在 * 在这个文件中,可以设置数据中心集群,如`idc=xxx` * 注意key为全小写 **Cluster Precedence**(集群顺序) 1. 如果`Apollo.Cluster`和`idc`同时指定: * 我们会首先尝试从`Apollo.Cluster`指定的集群加载配置 * 如果没找到任何配置,会尝试从`idc`指定的集群加载配置 * 如果还是没找到,会从默认的集群(`default`)加载 2. 如果只指定了`Apollo.Cluster`: * 我们会首先尝试从`Apollo.Cluster`指定的集群加载配置 * 如果没找到,会从默认的集群(`default`)加载 3. 如果只指定了`idc`: * 我们会首先尝试从`idc`指定的集群加载配置 * 如果没找到,会从默认的集群(`default`)加载 4. 如果`Apollo.Cluster`和`idc`都没有指定: * 我们会从默认的集群(`default`)加载配置 # 二、DLL引用 .Net客户端项目地址位于:[https://github.com/ctripcorp/apollo.net](https://github.com/ctripcorp/apollo.net)。 将项目下载到本地,切换到`Release`配置,编译Solution后会在`apollo.net\Apollo\bin\Release`中生成`Framework.Apollo.Client.dll`。 在应用中引用`Framework.Apollo.Client.dll`即可。 如果需要支持.Net Core的Apollo版本,可以参考[dotnet-core](https://github.com/ctripcorp/apollo.net/tree/dotnet-core)以及[nuget仓库](https://www.nuget.org/packages?q=Com.Ctrip.Framework.Apollo) # 三、客户端用法 ## 3.1 获取默认namespace的配置(application) ```c# Config config = ConfigService.GetAppConfig(); //config instance is singleton for each namespace and is never null string someKey = "someKeyFromDefaultNamespace"; string someDefaultValue = "someDefaultValueForTheKey"; string value = config.GetProperty(someKey, someDefaultValue); ``` 通过上述的**config.GetProperty**可以获取到someKey对应的实时最新的配置值。 另外,配置值从内存中获取,所以不需要应用自己做缓存。 ## 3.2 监听配置变化事件 监听配置变化事件只在应用真的关心配置变化,需要在配置变化时得到通知时使用,比如:数据库连接串变化后需要重建连接等。 如果只是希望每次都取到最新的配置的话,只需要按照上面的例子,调用**config.GetProperty**即可。 ```c# Config config = ConfigService.GetAppConfig(); //config instance is singleton for each namespace and is never null config.ConfigChanged += new ConfigChangeEvent(OnChanged); private void OnChanged(object sender, ConfigChangeEventArgs changeEvent) { Console.WriteLine("Changes for namespace {0}", changeEvent.Namespace); foreach (string key in changeEvent.ChangedKeys) { ConfigChange change = changeEvent.GetChange(key); Console.WriteLine("Change - key: {0}, oldValue: {1}, newValue: {2}, changeType: {3}", change.PropertyName, change.OldValue, change.NewValue, change.ChangeType); } } ``` ## 3.3 获取公共Namespace的配置 ```c# string somePublicNamespace = "CAT"; Config config = ConfigService.GetConfig(somePublicNamespace); //config instance is singleton for each namespace and is never null string someKey = "someKeyFromPublicNamespace"; string someDefaultValue = "someDefaultValueForTheKey"; string value = config.GetProperty(someKey, someDefaultValue); ``` ## 3.4 Demo apollo.net项目中有一个样例客户端的项目:`ApolloDemo`,具体信息可以参考[Apollo开发指南](zh/development/apollo-development-guide)中的[2.4 .Net样例客户端启动](zh/development/apollo-development-guide?id=_24-net样例客户端启动)部分。 >注:Apollo .Net客户端开源版目前默认会把日志直接输出到Console,大家可以自己实现Logging相关功能。 > > 详见[https://github.com/ctripcorp/apollo.net/tree/master/Apollo/Logging/Spi](https://github.com/ctripcorp/apollo.net/tree/master/Apollo/Logging/Spi) # 四、客户端设计 ![client-architecture](https://github.com/ctripcorp/apollo/raw/master/doc/images/client-architecture.png) 上图简要描述了Apollo客户端的实现原理: 1. 客户端和服务端保持了一个长连接,从而能第一时间获得配置更新的推送。(通过Http Long Polling实现) 2. 客户端还会定时从Apollo配置中心服务端拉取应用的最新配置。 * 这是一个fallback机制,为了防止推送机制失效导致配置不更新 * 客户端定时拉取会上报本地版本,所以一般情况下,对于定时拉取的操作,服务端都会返回304 - Not Modified * 定时频率默认为每5分钟拉取一次,客户端也可以通过App.config设置`Apollo.RefreshInterval`来覆盖,单位为毫秒。 3. 客户端从Apollo配置中心服务端获取到应用的最新配置后,会保存在内存中 4. 客户端会把从服务端获取到的配置在本地文件系统缓存一份 * 在遇到服务不可用,或网络不通的时候,依然能从本地恢复配置 5. 应用程序可以从Apollo客户端获取最新的配置、订阅配置更新通知 # 五、本地开发模式 Apollo客户端还支持本地开发模式,这个主要用于当开发环境无法连接Apollo服务器的时候,比如在邮轮、飞机上做相关功能开发。 在本地开发模式下,Apollo只会从本地文件读取配置信息,不会从Apollo服务器读取配置。 可以通过下面的步骤开启Apollo本地开发模式。 ## 5.1 修改环境 修改C:\opt\settings\server.properties文件,设置env为Local: ```properties env=Local ``` ## 5.2 准备本地配置文件 在本地开发模式下,Apollo客户端会从本地读取文件,所以我们需要事先准备好配置文件。 ### 5.2.1 本地配置目录 本地配置目录位于:C:\opt\data\\{_appId_}\config-cache。 appId就是应用的appId,如100004458。 请确保该目录存在,且应用程序对该目录有读权限。 **【小技巧】** 推荐的方式是先在普通模式下使用Apollo,这样Apollo会自动创建该目录并在目录下生成配置文件。 ### 5.2.2 本地配置文件 本地配置文件需要按照一定的文件名格式放置于本地配置目录下,文件名格式如下: **_{appId}+{cluster}+{namespace}.json_** * appId就是应用自己的appId,如100004458 * cluster就是应用使用的集群,一般在本地模式下没有做过配置的话,就是default * namespace就是应用使用配置namespace,一般是application ![client-local-cache](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-net-config-cache.png) 文件内容以json格式存储,比如如果有两个key,一个是request.timeout,另一个是batch,那么文件内容就是如下格式: ```json { "request.timeout":"1000", "batch":"2000" } ``` ## 5.3 修改配置 在本地开发模式下,Apollo不会实时监测文件内容是否有变化,所以如果修改了配置,需要重启应用生效。
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-openapi/src/main/java/com/ctrip/framework/apollo/openapi/dto/NamespaceReleaseDTO.java
package com.ctrip.framework.apollo.openapi.dto; public class NamespaceReleaseDTO { private String releaseTitle; private String releaseComment; private String releasedBy; private boolean isEmergencyPublish; public String getReleaseTitle() { return releaseTitle; } public void setReleaseTitle(String releaseTitle) { this.releaseTitle = releaseTitle; } public String getReleaseComment() { return releaseComment; } public void setReleaseComment(String releaseComment) { this.releaseComment = releaseComment; } public String getReleasedBy() { return releasedBy; } public void setReleasedBy(String releasedBy) { this.releasedBy = releasedBy; } public boolean isEmergencyPublish() { return isEmergencyPublish; } public void setEmergencyPublish(boolean emergencyPublish) { isEmergencyPublish = emergencyPublish; } }
package com.ctrip.framework.apollo.openapi.dto; public class NamespaceReleaseDTO { private String releaseTitle; private String releaseComment; private String releasedBy; private boolean isEmergencyPublish; public String getReleaseTitle() { return releaseTitle; } public void setReleaseTitle(String releaseTitle) { this.releaseTitle = releaseTitle; } public String getReleaseComment() { return releaseComment; } public void setReleaseComment(String releaseComment) { this.releaseComment = releaseComment; } public String getReleasedBy() { return releasedBy; } public void setReleasedBy(String releasedBy) { this.releasedBy = releasedBy; } public boolean isEmergencyPublish() { return isEmergencyPublish; } public void setEmergencyPublish(boolean emergencyPublish) { isEmergencyPublish = emergencyPublish; } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-client/src/main/java/com/ctrip/framework/apollo/spring/annotation/ApolloConfig.java
package com.ctrip.framework.apollo.spring.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import com.ctrip.framework.apollo.core.ConfigConsts; /** * Use this annotation to inject Apollo Config Instance. * * <p>Usage example:</p> * <pre class="code"> * //Inject the config for "someNamespace" * &#064;ApolloConfig("someNamespace") * private Config config; * </pre> * * <p>Usage example with placeholder:</p> * <pre class="code"> * // The namespace could also be specified as a placeholder, e.g. ${redis.namespace:xxx}, * // which will use the value of the key "redis.namespace" or "xxx" if this key is not configured. * &#064;ApolloConfig("${redis.namespace:xxx}") * private Config config; * </pre> * * * @author Jason Song([email protected]) */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) @Documented public @interface ApolloConfig { /** * Apollo namespace for the config, if not specified then default to application */ String value() default ConfigConsts.NAMESPACE_APPLICATION; }
package com.ctrip.framework.apollo.spring.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import com.ctrip.framework.apollo.core.ConfigConsts; /** * Use this annotation to inject Apollo Config Instance. * * <p>Usage example:</p> * <pre class="code"> * //Inject the config for "someNamespace" * &#064;ApolloConfig("someNamespace") * private Config config; * </pre> * * <p>Usage example with placeholder:</p> * <pre class="code"> * // The namespace could also be specified as a placeholder, e.g. ${redis.namespace:xxx}, * // which will use the value of the key "redis.namespace" or "xxx" if this key is not configured. * &#064;ApolloConfig("${redis.namespace:xxx}") * private Config config; * </pre> * * * @author Jason Song([email protected]) */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) @Documented public @interface ApolloConfig { /** * Apollo namespace for the config, if not specified then default to application */ String value() default ConfigConsts.NAMESPACE_APPLICATION; }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/defaultimpl/DefaultRoleInitializationService.java
package com.ctrip.framework.apollo.portal.spi.defaultimpl; import com.ctrip.framework.apollo.common.entity.App; import com.ctrip.framework.apollo.common.entity.BaseEntity; import com.ctrip.framework.apollo.core.ConfigConsts; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import com.ctrip.framework.apollo.portal.constant.PermissionType; import com.ctrip.framework.apollo.portal.constant.RoleType; import com.ctrip.framework.apollo.portal.entity.po.Permission; import com.ctrip.framework.apollo.portal.entity.po.Role; import com.ctrip.framework.apollo.portal.repository.PermissionRepository; import com.ctrip.framework.apollo.portal.service.RoleInitializationService; import com.ctrip.framework.apollo.portal.service.RolePermissionService; import com.ctrip.framework.apollo.portal.service.SystemRoleManagerService; import com.ctrip.framework.apollo.portal.util.RoleUtils; import com.google.common.collect.Sets; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; /** * Created by timothy on 2017/4/26. */ public class DefaultRoleInitializationService implements RoleInitializationService { @Autowired private RolePermissionService rolePermissionService; @Autowired private PortalConfig portalConfig; @Autowired private PermissionRepository permissionRepository; @Transactional public void initAppRoles(App app) { String appId = app.getAppId(); String appMasterRoleName = RoleUtils.buildAppMasterRoleName(appId); //has created before if (rolePermissionService.findRoleByRoleName(appMasterRoleName) != null) { return; } String operator = app.getDataChangeCreatedBy(); //create app permissions createAppMasterRole(appId, operator); //create manageAppMaster permission createManageAppMasterRole(appId, operator); //assign master role to user rolePermissionService .assignRoleToUsers(RoleUtils.buildAppMasterRoleName(appId), Sets.newHashSet(app.getOwnerName()), operator); initNamespaceRoles(appId, ConfigConsts.NAMESPACE_APPLICATION, operator); initNamespaceEnvRoles(appId, ConfigConsts.NAMESPACE_APPLICATION, operator); //assign modify、release namespace role to user rolePermissionService.assignRoleToUsers( RoleUtils.buildNamespaceRoleName(appId, ConfigConsts.NAMESPACE_APPLICATION, RoleType.MODIFY_NAMESPACE), Sets.newHashSet(operator), operator); rolePermissionService.assignRoleToUsers( RoleUtils.buildNamespaceRoleName(appId, ConfigConsts.NAMESPACE_APPLICATION, RoleType.RELEASE_NAMESPACE), Sets.newHashSet(operator), operator); } @Transactional public void initNamespaceRoles(String appId, String namespaceName, String operator) { String modifyNamespaceRoleName = RoleUtils.buildModifyNamespaceRoleName(appId, namespaceName); if (rolePermissionService.findRoleByRoleName(modifyNamespaceRoleName) == null) { createNamespaceRole(appId, namespaceName, PermissionType.MODIFY_NAMESPACE, modifyNamespaceRoleName, operator); } String releaseNamespaceRoleName = RoleUtils.buildReleaseNamespaceRoleName(appId, namespaceName); if (rolePermissionService.findRoleByRoleName(releaseNamespaceRoleName) == null) { createNamespaceRole(appId, namespaceName, PermissionType.RELEASE_NAMESPACE, releaseNamespaceRoleName, operator); } } @Transactional public void initNamespaceEnvRoles(String appId, String namespaceName, String operator) { List<Env> portalEnvs = portalConfig.portalSupportedEnvs(); for (Env env : portalEnvs) { initNamespaceSpecificEnvRoles(appId, namespaceName, env.toString(), operator); } } @Transactional public void initNamespaceSpecificEnvRoles(String appId, String namespaceName, String env, String operator) { String modifyNamespaceEnvRoleName = RoleUtils.buildModifyNamespaceRoleName(appId, namespaceName, env); if (rolePermissionService.findRoleByRoleName(modifyNamespaceEnvRoleName) == null) { createNamespaceEnvRole(appId, namespaceName, PermissionType.MODIFY_NAMESPACE, env, modifyNamespaceEnvRoleName, operator); } String releaseNamespaceEnvRoleName = RoleUtils.buildReleaseNamespaceRoleName(appId, namespaceName, env); if (rolePermissionService.findRoleByRoleName(releaseNamespaceEnvRoleName) == null) { createNamespaceEnvRole(appId, namespaceName, PermissionType.RELEASE_NAMESPACE, env, releaseNamespaceEnvRoleName, operator); } } @Transactional public void initCreateAppRole() { if (rolePermissionService.findRoleByRoleName(SystemRoleManagerService.CREATE_APPLICATION_ROLE_NAME) != null) { return; } Permission createAppPermission = permissionRepository.findTopByPermissionTypeAndTargetId(PermissionType.CREATE_APPLICATION, SystemRoleManagerService.SYSTEM_PERMISSION_TARGET_ID); if (createAppPermission == null) { // create application permission init createAppPermission = createPermission(SystemRoleManagerService.SYSTEM_PERMISSION_TARGET_ID, PermissionType.CREATE_APPLICATION, "apollo"); rolePermissionService.createPermission(createAppPermission); } // create application role init Role createAppRole = createRole(SystemRoleManagerService.CREATE_APPLICATION_ROLE_NAME, "apollo"); rolePermissionService.createRoleWithPermissions(createAppRole, Sets.newHashSet(createAppPermission.getId())); } @Transactional private void createManageAppMasterRole(String appId, String operator) { Permission permission = createPermission(appId, PermissionType.MANAGE_APP_MASTER, operator); rolePermissionService.createPermission(permission); Role role = createRole(RoleUtils.buildAppRoleName(appId, PermissionType.MANAGE_APP_MASTER), operator); Set<Long> permissionIds = new HashSet<>(); permissionIds.add(permission.getId()); rolePermissionService.createRoleWithPermissions(role, permissionIds); } // fix historical data @Transactional public void initManageAppMasterRole(String appId, String operator) { String manageAppMasterRoleName = RoleUtils.buildAppRoleName(appId, PermissionType.MANAGE_APP_MASTER); if (rolePermissionService.findRoleByRoleName(manageAppMasterRoleName) != null) { return; } synchronized (DefaultRoleInitializationService.class) { createManageAppMasterRole(appId, operator); } } private void createAppMasterRole(String appId, String operator) { Set<Permission> appPermissions = Stream.of(PermissionType.CREATE_CLUSTER, PermissionType.CREATE_NAMESPACE, PermissionType.ASSIGN_ROLE) .map(permissionType -> createPermission(appId, permissionType, operator)).collect(Collectors.toSet()); Set<Permission> createdAppPermissions = rolePermissionService.createPermissions(appPermissions); Set<Long> appPermissionIds = createdAppPermissions.stream().map(BaseEntity::getId).collect(Collectors.toSet()); //create app master role Role appMasterRole = createRole(RoleUtils.buildAppMasterRoleName(appId), operator); rolePermissionService.createRoleWithPermissions(appMasterRole, appPermissionIds); } private Permission createPermission(String targetId, String permissionType, String operator) { Permission permission = new Permission(); permission.setPermissionType(permissionType); permission.setTargetId(targetId); permission.setDataChangeCreatedBy(operator); permission.setDataChangeLastModifiedBy(operator); return permission; } private Role createRole(String roleName, String operator) { Role role = new Role(); role.setRoleName(roleName); role.setDataChangeCreatedBy(operator); role.setDataChangeLastModifiedBy(operator); return role; } private void createNamespaceRole(String appId, String namespaceName, String permissionType, String roleName, String operator) { Permission permission = createPermission(RoleUtils.buildNamespaceTargetId(appId, namespaceName), permissionType, operator); Permission createdPermission = rolePermissionService.createPermission(permission); Role role = createRole(roleName, operator); rolePermissionService .createRoleWithPermissions(role, Sets.newHashSet(createdPermission.getId())); } private void createNamespaceEnvRole(String appId, String namespaceName, String permissionType, String env, String roleName, String operator) { Permission permission = createPermission(RoleUtils.buildNamespaceTargetId(appId, namespaceName, env), permissionType, operator); Permission createdPermission = rolePermissionService.createPermission(permission); Role role = createRole(roleName, operator); rolePermissionService .createRoleWithPermissions(role, Sets.newHashSet(createdPermission.getId())); } }
package com.ctrip.framework.apollo.portal.spi.defaultimpl; import com.ctrip.framework.apollo.common.entity.App; import com.ctrip.framework.apollo.common.entity.BaseEntity; import com.ctrip.framework.apollo.core.ConfigConsts; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import com.ctrip.framework.apollo.portal.constant.PermissionType; import com.ctrip.framework.apollo.portal.constant.RoleType; import com.ctrip.framework.apollo.portal.entity.po.Permission; import com.ctrip.framework.apollo.portal.entity.po.Role; import com.ctrip.framework.apollo.portal.repository.PermissionRepository; import com.ctrip.framework.apollo.portal.service.RoleInitializationService; import com.ctrip.framework.apollo.portal.service.RolePermissionService; import com.ctrip.framework.apollo.portal.service.SystemRoleManagerService; import com.ctrip.framework.apollo.portal.util.RoleUtils; import com.google.common.collect.Sets; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; /** * Created by timothy on 2017/4/26. */ public class DefaultRoleInitializationService implements RoleInitializationService { @Autowired private RolePermissionService rolePermissionService; @Autowired private PortalConfig portalConfig; @Autowired private PermissionRepository permissionRepository; @Transactional public void initAppRoles(App app) { String appId = app.getAppId(); String appMasterRoleName = RoleUtils.buildAppMasterRoleName(appId); //has created before if (rolePermissionService.findRoleByRoleName(appMasterRoleName) != null) { return; } String operator = app.getDataChangeCreatedBy(); //create app permissions createAppMasterRole(appId, operator); //create manageAppMaster permission createManageAppMasterRole(appId, operator); //assign master role to user rolePermissionService .assignRoleToUsers(RoleUtils.buildAppMasterRoleName(appId), Sets.newHashSet(app.getOwnerName()), operator); initNamespaceRoles(appId, ConfigConsts.NAMESPACE_APPLICATION, operator); initNamespaceEnvRoles(appId, ConfigConsts.NAMESPACE_APPLICATION, operator); //assign modify、release namespace role to user rolePermissionService.assignRoleToUsers( RoleUtils.buildNamespaceRoleName(appId, ConfigConsts.NAMESPACE_APPLICATION, RoleType.MODIFY_NAMESPACE), Sets.newHashSet(operator), operator); rolePermissionService.assignRoleToUsers( RoleUtils.buildNamespaceRoleName(appId, ConfigConsts.NAMESPACE_APPLICATION, RoleType.RELEASE_NAMESPACE), Sets.newHashSet(operator), operator); } @Transactional public void initNamespaceRoles(String appId, String namespaceName, String operator) { String modifyNamespaceRoleName = RoleUtils.buildModifyNamespaceRoleName(appId, namespaceName); if (rolePermissionService.findRoleByRoleName(modifyNamespaceRoleName) == null) { createNamespaceRole(appId, namespaceName, PermissionType.MODIFY_NAMESPACE, modifyNamespaceRoleName, operator); } String releaseNamespaceRoleName = RoleUtils.buildReleaseNamespaceRoleName(appId, namespaceName); if (rolePermissionService.findRoleByRoleName(releaseNamespaceRoleName) == null) { createNamespaceRole(appId, namespaceName, PermissionType.RELEASE_NAMESPACE, releaseNamespaceRoleName, operator); } } @Transactional public void initNamespaceEnvRoles(String appId, String namespaceName, String operator) { List<Env> portalEnvs = portalConfig.portalSupportedEnvs(); for (Env env : portalEnvs) { initNamespaceSpecificEnvRoles(appId, namespaceName, env.toString(), operator); } } @Transactional public void initNamespaceSpecificEnvRoles(String appId, String namespaceName, String env, String operator) { String modifyNamespaceEnvRoleName = RoleUtils.buildModifyNamespaceRoleName(appId, namespaceName, env); if (rolePermissionService.findRoleByRoleName(modifyNamespaceEnvRoleName) == null) { createNamespaceEnvRole(appId, namespaceName, PermissionType.MODIFY_NAMESPACE, env, modifyNamespaceEnvRoleName, operator); } String releaseNamespaceEnvRoleName = RoleUtils.buildReleaseNamespaceRoleName(appId, namespaceName, env); if (rolePermissionService.findRoleByRoleName(releaseNamespaceEnvRoleName) == null) { createNamespaceEnvRole(appId, namespaceName, PermissionType.RELEASE_NAMESPACE, env, releaseNamespaceEnvRoleName, operator); } } @Transactional public void initCreateAppRole() { if (rolePermissionService.findRoleByRoleName(SystemRoleManagerService.CREATE_APPLICATION_ROLE_NAME) != null) { return; } Permission createAppPermission = permissionRepository.findTopByPermissionTypeAndTargetId(PermissionType.CREATE_APPLICATION, SystemRoleManagerService.SYSTEM_PERMISSION_TARGET_ID); if (createAppPermission == null) { // create application permission init createAppPermission = createPermission(SystemRoleManagerService.SYSTEM_PERMISSION_TARGET_ID, PermissionType.CREATE_APPLICATION, "apollo"); rolePermissionService.createPermission(createAppPermission); } // create application role init Role createAppRole = createRole(SystemRoleManagerService.CREATE_APPLICATION_ROLE_NAME, "apollo"); rolePermissionService.createRoleWithPermissions(createAppRole, Sets.newHashSet(createAppPermission.getId())); } @Transactional private void createManageAppMasterRole(String appId, String operator) { Permission permission = createPermission(appId, PermissionType.MANAGE_APP_MASTER, operator); rolePermissionService.createPermission(permission); Role role = createRole(RoleUtils.buildAppRoleName(appId, PermissionType.MANAGE_APP_MASTER), operator); Set<Long> permissionIds = new HashSet<>(); permissionIds.add(permission.getId()); rolePermissionService.createRoleWithPermissions(role, permissionIds); } // fix historical data @Transactional public void initManageAppMasterRole(String appId, String operator) { String manageAppMasterRoleName = RoleUtils.buildAppRoleName(appId, PermissionType.MANAGE_APP_MASTER); if (rolePermissionService.findRoleByRoleName(manageAppMasterRoleName) != null) { return; } synchronized (DefaultRoleInitializationService.class) { createManageAppMasterRole(appId, operator); } } private void createAppMasterRole(String appId, String operator) { Set<Permission> appPermissions = Stream.of(PermissionType.CREATE_CLUSTER, PermissionType.CREATE_NAMESPACE, PermissionType.ASSIGN_ROLE) .map(permissionType -> createPermission(appId, permissionType, operator)).collect(Collectors.toSet()); Set<Permission> createdAppPermissions = rolePermissionService.createPermissions(appPermissions); Set<Long> appPermissionIds = createdAppPermissions.stream().map(BaseEntity::getId).collect(Collectors.toSet()); //create app master role Role appMasterRole = createRole(RoleUtils.buildAppMasterRoleName(appId), operator); rolePermissionService.createRoleWithPermissions(appMasterRole, appPermissionIds); } private Permission createPermission(String targetId, String permissionType, String operator) { Permission permission = new Permission(); permission.setPermissionType(permissionType); permission.setTargetId(targetId); permission.setDataChangeCreatedBy(operator); permission.setDataChangeLastModifiedBy(operator); return permission; } private Role createRole(String roleName, String operator) { Role role = new Role(); role.setRoleName(roleName); role.setDataChangeCreatedBy(operator); role.setDataChangeLastModifiedBy(operator); return role; } private void createNamespaceRole(String appId, String namespaceName, String permissionType, String roleName, String operator) { Permission permission = createPermission(RoleUtils.buildNamespaceTargetId(appId, namespaceName), permissionType, operator); Permission createdPermission = rolePermissionService.createPermission(permission); Role role = createRole(roleName, operator); rolePermissionService .createRoleWithPermissions(role, Sets.newHashSet(createdPermission.getId())); } private void createNamespaceEnvRole(String appId, String namespaceName, String permissionType, String env, String roleName, String operator) { Permission permission = createPermission(RoleUtils.buildNamespaceTargetId(appId, namespaceName, env), permissionType, operator); Permission createdPermission = rolePermissionService.createPermission(permission); Role role = createRole(roleName, operator); rolePermissionService .createRoleWithPermissions(role, Sets.newHashSet(createdPermission.getId())); } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/CommitService.java
package com.ctrip.framework.apollo.biz.service; import com.ctrip.framework.apollo.biz.entity.Commit; import com.ctrip.framework.apollo.biz.repository.CommitRepository; import java.util.Date; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; @Service public class CommitService { private final CommitRepository commitRepository; public CommitService(final CommitRepository commitRepository) { this.commitRepository = commitRepository; } @Transactional public Commit save(Commit commit){ commit.setId(0);//protection return commitRepository.save(commit); } public List<Commit> find(String appId, String clusterName, String namespaceName, Pageable page){ return commitRepository.findByAppIdAndClusterNameAndNamespaceNameOrderByIdDesc(appId, clusterName, namespaceName, page); } public List<Commit> find(String appId, String clusterName, String namespaceName, Date lastModifiedTime, Pageable page) { return commitRepository .findByAppIdAndClusterNameAndNamespaceNameAndDataChangeLastModifiedTimeGreaterThanEqualOrderByIdDesc( appId, clusterName, namespaceName, lastModifiedTime, page); } @Transactional public int batchDelete(String appId, String clusterName, String namespaceName, String operator){ return commitRepository.batchDelete(appId, clusterName, namespaceName, operator); } }
package com.ctrip.framework.apollo.biz.service; import com.ctrip.framework.apollo.biz.entity.Commit; import com.ctrip.framework.apollo.biz.repository.CommitRepository; import java.util.Date; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; @Service public class CommitService { private final CommitRepository commitRepository; public CommitService(final CommitRepository commitRepository) { this.commitRepository = commitRepository; } @Transactional public Commit save(Commit commit){ commit.setId(0);//protection return commitRepository.save(commit); } public List<Commit> find(String appId, String clusterName, String namespaceName, Pageable page){ return commitRepository.findByAppIdAndClusterNameAndNamespaceNameOrderByIdDesc(appId, clusterName, namespaceName, page); } public List<Commit> find(String appId, String clusterName, String namespaceName, Date lastModifiedTime, Pageable page) { return commitRepository .findByAppIdAndClusterNameAndNamespaceNameAndDataChangeLastModifiedTimeGreaterThanEqualOrderByIdDesc( appId, clusterName, namespaceName, lastModifiedTime, page); } @Transactional public int batchDelete(String appId, String clusterName, String namespaceName, String operator){ return commitRepository.batchDelete(appId, clusterName, namespaceName, operator); } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-client/src/test/java/com/ctrip/framework/apollo/internals/ConfigServiceLocatorTest.java
package com.ctrip.framework.apollo.internals; import static org.junit.Assert.assertEquals; import com.ctrip.framework.apollo.core.dto.ServiceDTO; import java.util.List; import org.junit.After; import org.junit.Test; public class ConfigServiceLocatorTest { @After public void tearDown() throws Exception { System.clearProperty("apollo.configService"); } @Test public void testGetConfigServicesWithSystemProperty() throws Exception { String someConfigServiceUrl = " someConfigServiceUrl "; String anotherConfigServiceUrl = " anotherConfigServiceUrl "; System.setProperty("apollo.configService", someConfigServiceUrl + "," + anotherConfigServiceUrl); ConfigServiceLocator configServiceLocator = new ConfigServiceLocator(); List<ServiceDTO> result = configServiceLocator.getConfigServices(); assertEquals(2, result.size()); assertEquals(someConfigServiceUrl.trim(), result.get(0).getHomepageUrl()); assertEquals(anotherConfigServiceUrl.trim(), result.get(1).getHomepageUrl()); } }
package com.ctrip.framework.apollo.internals; import static org.junit.Assert.assertEquals; import com.ctrip.framework.apollo.core.dto.ServiceDTO; import java.util.List; import org.junit.After; import org.junit.Test; public class ConfigServiceLocatorTest { @After public void tearDown() throws Exception { System.clearProperty("apollo.configService"); } @Test public void testGetConfigServicesWithSystemProperty() throws Exception { String someConfigServiceUrl = " someConfigServiceUrl "; String anotherConfigServiceUrl = " anotherConfigServiceUrl "; System.setProperty("apollo.configService", someConfigServiceUrl + "," + anotherConfigServiceUrl); ConfigServiceLocator configServiceLocator = new ConfigServiceLocator(); List<ServiceDTO> result = configServiceLocator.getConfigServices(); assertEquals(2, result.size()); assertEquals(someConfigServiceUrl.trim(), result.get(0).getHomepageUrl()); assertEquals(anotherConfigServiceUrl.trim(), result.get(1).getHomepageUrl()); } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/api/ApolloConfigDemo.java
package com.ctrip.framework.apollo.demo.api; import com.ctrip.framework.apollo.internals.YamlConfigFile; import com.google.common.base.Charsets; import com.ctrip.framework.apollo.Config; import com.ctrip.framework.apollo.ConfigChangeListener; import com.ctrip.framework.apollo.ConfigFile; import com.ctrip.framework.apollo.ConfigFileChangeListener; import com.ctrip.framework.apollo.ConfigService; import com.ctrip.framework.apollo.core.enums.ConfigFileFormat; import com.ctrip.framework.apollo.model.ConfigChange; import com.ctrip.framework.apollo.model.ConfigChangeEvent; import com.ctrip.framework.apollo.model.ConfigFileChangeEvent; import com.ctrip.framework.foundation.Foundation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /** * @author Jason Song([email protected]) */ public class ApolloConfigDemo { private static final Logger logger = LoggerFactory.getLogger(ApolloConfigDemo.class); private String DEFAULT_VALUE = "undefined"; private Config config; private Config yamlConfig; private Config publicConfig; private ConfigFile applicationConfigFile; private ConfigFile xmlConfigFile; private YamlConfigFile yamlConfigFile; public ApolloConfigDemo() { ConfigChangeListener changeListener = new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { logger.info("Changes for namespace {}", changeEvent.getNamespace()); for (String key : changeEvent.changedKeys()) { ConfigChange change = changeEvent.getChange(key); logger.info("Change - key: {}, oldValue: {}, newValue: {}, changeType: {}", change.getPropertyName(), change.getOldValue(), change.getNewValue(), change.getChangeType()); } } }; config = ConfigService.getAppConfig(); config.addChangeListener(changeListener); yamlConfig = ConfigService.getConfig("application.yaml"); yamlConfig.addChangeListener(changeListener); publicConfig = ConfigService.getConfig("TEST1.apollo"); publicConfig.addChangeListener(changeListener); applicationConfigFile = ConfigService.getConfigFile("application", ConfigFileFormat.Properties); // datasources.xml xmlConfigFile = ConfigService.getConfigFile("datasources", ConfigFileFormat.XML); xmlConfigFile.addChangeListener(new ConfigFileChangeListener() { @Override public void onChange(ConfigFileChangeEvent changeEvent) { logger.info(changeEvent.toString()); } }); // application.yaml yamlConfigFile = (YamlConfigFile) ConfigService.getConfigFile("application", ConfigFileFormat.YAML); } private String getConfig(String key) { String result = config.getProperty(key, DEFAULT_VALUE); if (DEFAULT_VALUE.equals(result)) { result = publicConfig.getProperty(key, DEFAULT_VALUE); } if (DEFAULT_VALUE.equals(result)) { result = yamlConfig.getProperty(key, DEFAULT_VALUE); } logger.info(String.format("Loading key : %s with value: %s", key, result)); return result; } private void print(String namespace) { switch (namespace) { case "application": print(applicationConfigFile); return; case "xml": print(xmlConfigFile); return; case "yaml": printYaml(yamlConfigFile); return; } } private void print(ConfigFile configFile) { if (!configFile.hasContent()) { System.out.println("No config file content found for " + configFile.getNamespace()); return; } System.out.println("=== Config File Content for " + configFile.getNamespace() + " is as follows: "); System.out.println(configFile.getContent()); } private void printYaml(YamlConfigFile configFile) { System.out.println("=== Properties for " + configFile.getNamespace() + " is as follows: "); System.out.println(configFile.asProperties()); } private void printEnvInfo() { String message = String.format("AppId: %s, Env: %s, DC: %s, IP: %s", Foundation.app() .getAppId(), Foundation.server().getEnvType(), Foundation.server().getDataCenter(), Foundation.net().getHostAddress()); System.out.println(message); } public static void main(String[] args) throws IOException { ApolloConfigDemo apolloConfigDemo = new ApolloConfigDemo(); apolloConfigDemo.printEnvInfo(); System.out.println( "Apollo Config Demo. Please input key to get the value."); while (true) { System.out.print("> "); String input = new BufferedReader(new InputStreamReader(System.in, Charsets.UTF_8)).readLine(); if (input == null || input.length() == 0) { continue; } input = input.trim(); try { if (input.equalsIgnoreCase("application")) { apolloConfigDemo.print("application"); continue; } if (input.equalsIgnoreCase("xml")) { apolloConfigDemo.print("xml"); continue; } if (input.equalsIgnoreCase("yaml") || input.equalsIgnoreCase("yml")) { apolloConfigDemo.print("yaml"); continue; } if (input.equalsIgnoreCase("quit")) { System.exit(0); } apolloConfigDemo.getConfig(input); } catch (Throwable ex) { logger.error("some error occurred", ex); } } } }
package com.ctrip.framework.apollo.demo.api; import com.ctrip.framework.apollo.internals.YamlConfigFile; import com.google.common.base.Charsets; import com.ctrip.framework.apollo.Config; import com.ctrip.framework.apollo.ConfigChangeListener; import com.ctrip.framework.apollo.ConfigFile; import com.ctrip.framework.apollo.ConfigFileChangeListener; import com.ctrip.framework.apollo.ConfigService; import com.ctrip.framework.apollo.core.enums.ConfigFileFormat; import com.ctrip.framework.apollo.model.ConfigChange; import com.ctrip.framework.apollo.model.ConfigChangeEvent; import com.ctrip.framework.apollo.model.ConfigFileChangeEvent; import com.ctrip.framework.foundation.Foundation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /** * @author Jason Song([email protected]) */ public class ApolloConfigDemo { private static final Logger logger = LoggerFactory.getLogger(ApolloConfigDemo.class); private String DEFAULT_VALUE = "undefined"; private Config config; private Config yamlConfig; private Config publicConfig; private ConfigFile applicationConfigFile; private ConfigFile xmlConfigFile; private YamlConfigFile yamlConfigFile; public ApolloConfigDemo() { ConfigChangeListener changeListener = new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { logger.info("Changes for namespace {}", changeEvent.getNamespace()); for (String key : changeEvent.changedKeys()) { ConfigChange change = changeEvent.getChange(key); logger.info("Change - key: {}, oldValue: {}, newValue: {}, changeType: {}", change.getPropertyName(), change.getOldValue(), change.getNewValue(), change.getChangeType()); } } }; config = ConfigService.getAppConfig(); config.addChangeListener(changeListener); yamlConfig = ConfigService.getConfig("application.yaml"); yamlConfig.addChangeListener(changeListener); publicConfig = ConfigService.getConfig("TEST1.apollo"); publicConfig.addChangeListener(changeListener); applicationConfigFile = ConfigService.getConfigFile("application", ConfigFileFormat.Properties); // datasources.xml xmlConfigFile = ConfigService.getConfigFile("datasources", ConfigFileFormat.XML); xmlConfigFile.addChangeListener(new ConfigFileChangeListener() { @Override public void onChange(ConfigFileChangeEvent changeEvent) { logger.info(changeEvent.toString()); } }); // application.yaml yamlConfigFile = (YamlConfigFile) ConfigService.getConfigFile("application", ConfigFileFormat.YAML); } private String getConfig(String key) { String result = config.getProperty(key, DEFAULT_VALUE); if (DEFAULT_VALUE.equals(result)) { result = publicConfig.getProperty(key, DEFAULT_VALUE); } if (DEFAULT_VALUE.equals(result)) { result = yamlConfig.getProperty(key, DEFAULT_VALUE); } logger.info(String.format("Loading key : %s with value: %s", key, result)); return result; } private void print(String namespace) { switch (namespace) { case "application": print(applicationConfigFile); return; case "xml": print(xmlConfigFile); return; case "yaml": printYaml(yamlConfigFile); return; } } private void print(ConfigFile configFile) { if (!configFile.hasContent()) { System.out.println("No config file content found for " + configFile.getNamespace()); return; } System.out.println("=== Config File Content for " + configFile.getNamespace() + " is as follows: "); System.out.println(configFile.getContent()); } private void printYaml(YamlConfigFile configFile) { System.out.println("=== Properties for " + configFile.getNamespace() + " is as follows: "); System.out.println(configFile.asProperties()); } private void printEnvInfo() { String message = String.format("AppId: %s, Env: %s, DC: %s, IP: %s", Foundation.app() .getAppId(), Foundation.server().getEnvType(), Foundation.server().getDataCenter(), Foundation.net().getHostAddress()); System.out.println(message); } public static void main(String[] args) throws IOException { ApolloConfigDemo apolloConfigDemo = new ApolloConfigDemo(); apolloConfigDemo.printEnvInfo(); System.out.println( "Apollo Config Demo. Please input key to get the value."); while (true) { System.out.print("> "); String input = new BufferedReader(new InputStreamReader(System.in, Charsets.UTF_8)).readLine(); if (input == null || input.length() == 0) { continue; } input = input.trim(); try { if (input.equalsIgnoreCase("application")) { apolloConfigDemo.print("application"); continue; } if (input.equalsIgnoreCase("xml")) { apolloConfigDemo.print("xml"); continue; } if (input.equalsIgnoreCase("yaml") || input.equalsIgnoreCase("yml")) { apolloConfigDemo.print("yaml"); continue; } if (input.equalsIgnoreCase("quit")) { System.exit(0); } apolloConfigDemo.getConfig(input); } catch (Throwable ex) { logger.error("some error occurred", ex); } } } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/util/KeyValueUtilsTest.java
package com.ctrip.framework.apollo.portal.util; import org.junit.Test; import java.util.HashMap; import java.util.Map; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class KeyValueUtilsTest { @Test public void testFilterWithKeyEndswith() { // map Map<String, String> map = new HashMap<>(); map.put("abc.met", "none"); map.put("abc_meta", "none"); map.put("2bc.meta", "none"); map.put("abc?met", "none"); Map<String, String> afterFilter = KeyValueUtils.filterWithKeyIgnoreCaseEndsWith(map, "_meta"); for(Map.Entry<String, String> entry : afterFilter.entrySet()) { String key = entry.getKey(); assertTrue(key.endsWith("_meta")); } } @Test public void testRemoveKeySuffix() { Map<String, String> map = new HashMap<>(); map.put("abc_meta", "none"); map.put("234_meta", "none"); map.put("888_meta", "none"); Map<String, String> afterFilter = KeyValueUtils.removeKeySuffix(map, "_meta".length()); for(Map.Entry<String, String> entry : afterFilter.entrySet()) { String key = entry.getKey(); assertFalse(key.endsWith("_meta")); assertFalse(key.contains("_meta")); } } }
package com.ctrip.framework.apollo.portal.util; import org.junit.Test; import java.util.HashMap; import java.util.Map; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class KeyValueUtilsTest { @Test public void testFilterWithKeyEndswith() { // map Map<String, String> map = new HashMap<>(); map.put("abc.met", "none"); map.put("abc_meta", "none"); map.put("2bc.meta", "none"); map.put("abc?met", "none"); Map<String, String> afterFilter = KeyValueUtils.filterWithKeyIgnoreCaseEndsWith(map, "_meta"); for(Map.Entry<String, String> entry : afterFilter.entrySet()) { String key = entry.getKey(); assertTrue(key.endsWith("_meta")); } } @Test public void testRemoveKeySuffix() { Map<String, String> map = new HashMap<>(); map.put("abc_meta", "none"); map.put("234_meta", "none"); map.put("888_meta", "none"); Map<String, String> afterFilter = KeyValueUtils.removeKeySuffix(map, "_meta".length()); for(Map.Entry<String, String> entry : afterFilter.entrySet()) { String key = entry.getKey(); assertFalse(key.endsWith("_meta")); assertFalse(key.contains("_meta")); } } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-client/src/main/java/com/ctrip/framework/apollo/spring/annotation/ApolloProcessor.java
package com.ctrip.framework.apollo.spring.annotation; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.LinkedList; import java.util.List; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.core.Ordered; import org.springframework.core.PriorityOrdered; import org.springframework.util.ReflectionUtils; /** * Create by zhangzheng on 2018/2/6 */ public abstract class ApolloProcessor implements BeanPostProcessor, PriorityOrdered { @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { Class clazz = bean.getClass(); for (Field field : findAllField(clazz)) { processField(bean, beanName, field); } for (Method method : findAllMethod(clazz)) { processMethod(bean, beanName, method); } return bean; } @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { return bean; } /** * subclass should implement this method to process field */ protected abstract void processField(Object bean, String beanName, Field field); /** * subclass should implement this method to process method */ protected abstract void processMethod(Object bean, String beanName, Method method); @Override public int getOrder() { //make it as late as possible return Ordered.LOWEST_PRECEDENCE; } private List<Field> findAllField(Class clazz) { final List<Field> res = new LinkedList<>(); ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() { @Override public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException { res.add(field); } }); return res; } private List<Method> findAllMethod(Class clazz) { final List<Method> res = new LinkedList<>(); ReflectionUtils.doWithMethods(clazz, new ReflectionUtils.MethodCallback() { @Override public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException { res.add(method); } }); return res; } }
package com.ctrip.framework.apollo.spring.annotation; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.LinkedList; import java.util.List; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.core.Ordered; import org.springframework.core.PriorityOrdered; import org.springframework.util.ReflectionUtils; /** * Create by zhangzheng on 2018/2/6 */ public abstract class ApolloProcessor implements BeanPostProcessor, PriorityOrdered { @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { Class clazz = bean.getClass(); for (Field field : findAllField(clazz)) { processField(bean, beanName, field); } for (Method method : findAllMethod(clazz)) { processMethod(bean, beanName, method); } return bean; } @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { return bean; } /** * subclass should implement this method to process field */ protected abstract void processField(Object bean, String beanName, Field field); /** * subclass should implement this method to process method */ protected abstract void processMethod(Object bean, String beanName, Method method); @Override public int getOrder() { //make it as late as possible return Ordered.LOWEST_PRECEDENCE; } private List<Field> findAllField(Class clazz) { final List<Field> res = new LinkedList<>(); ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() { @Override public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException { res.add(field); } }); return res; } private List<Method> findAllMethod(Class clazz) { final List<Method> res = new LinkedList<>(); ReflectionUtils.doWithMethods(clazz, new ReflectionUtils.MethodCallback() { @Override public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException { res.add(method); } }); return res; } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-portal/src/test/java/com/ctrip/framework/apollo/openapi/util/ConsumerAuditUtilTest.java
package com.ctrip.framework.apollo.openapi.util; import com.ctrip.framework.apollo.openapi.entity.ConsumerAudit; import com.ctrip.framework.apollo.openapi.service.ConsumerService; import com.google.common.util.concurrent.SettableFuture; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.mockito.stubbing.Answer; import org.springframework.test.util.ReflectionTestUtils; import javax.servlet.http.HttpServletRequest; import java.util.List; import java.util.concurrent.TimeUnit; import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.anyCollection; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.when; /** * @author Jason Song([email protected]) */ @RunWith(MockitoJUnitRunner.class) public class ConsumerAuditUtilTest { private ConsumerAuditUtil consumerAuditUtil; @Mock private ConsumerService consumerService; @Mock private HttpServletRequest request; private long batchTimeout = 50; private TimeUnit batchTimeUnit = TimeUnit.MILLISECONDS; @Before public void setUp() throws Exception { consumerAuditUtil = new ConsumerAuditUtil(consumerService); ReflectionTestUtils.setField(consumerAuditUtil, "BATCH_TIMEOUT", batchTimeout); ReflectionTestUtils.setField(consumerAuditUtil, "BATCH_TIMEUNIT", batchTimeUnit); consumerAuditUtil.afterPropertiesSet(); } @After public void tearDown() throws Exception { consumerAuditUtil.stopAudit(); } @Test public void audit() throws Exception { long someConsumerId = 1; String someUri = "someUri"; String someQuery = "someQuery"; String someMethod = "someMethod"; when(request.getRequestURI()).thenReturn(someUri); when(request.getQueryString()).thenReturn(someQuery); when(request.getMethod()).thenReturn(someMethod); SettableFuture<List<ConsumerAudit>> result = SettableFuture.create(); doAnswer((Answer<Void>) invocation -> { Object[] args = invocation.getArguments(); result.set((List<ConsumerAudit>) args[0]); return null; }).when(consumerService).createConsumerAudits(anyCollection()); consumerAuditUtil.audit(request, someConsumerId); List<ConsumerAudit> audits = result.get(batchTimeout * 5, batchTimeUnit); assertEquals(1, audits.size()); ConsumerAudit audit = audits.get(0); assertEquals(String.format("%s?%s", someUri, someQuery), audit.getUri()); assertEquals(someMethod, audit.getMethod()); assertEquals(someConsumerId, audit.getConsumerId()); } }
package com.ctrip.framework.apollo.openapi.util; import com.ctrip.framework.apollo.openapi.entity.ConsumerAudit; import com.ctrip.framework.apollo.openapi.service.ConsumerService; import com.google.common.util.concurrent.SettableFuture; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.mockito.stubbing.Answer; import org.springframework.test.util.ReflectionTestUtils; import javax.servlet.http.HttpServletRequest; import java.util.List; import java.util.concurrent.TimeUnit; import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.anyCollection; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.when; /** * @author Jason Song([email protected]) */ @RunWith(MockitoJUnitRunner.class) public class ConsumerAuditUtilTest { private ConsumerAuditUtil consumerAuditUtil; @Mock private ConsumerService consumerService; @Mock private HttpServletRequest request; private long batchTimeout = 50; private TimeUnit batchTimeUnit = TimeUnit.MILLISECONDS; @Before public void setUp() throws Exception { consumerAuditUtil = new ConsumerAuditUtil(consumerService); ReflectionTestUtils.setField(consumerAuditUtil, "BATCH_TIMEOUT", batchTimeout); ReflectionTestUtils.setField(consumerAuditUtil, "BATCH_TIMEUNIT", batchTimeUnit); consumerAuditUtil.afterPropertiesSet(); } @After public void tearDown() throws Exception { consumerAuditUtil.stopAudit(); } @Test public void audit() throws Exception { long someConsumerId = 1; String someUri = "someUri"; String someQuery = "someQuery"; String someMethod = "someMethod"; when(request.getRequestURI()).thenReturn(someUri); when(request.getQueryString()).thenReturn(someQuery); when(request.getMethod()).thenReturn(someMethod); SettableFuture<List<ConsumerAudit>> result = SettableFuture.create(); doAnswer((Answer<Void>) invocation -> { Object[] args = invocation.getArguments(); result.set((List<ConsumerAudit>) args[0]); return null; }).when(consumerService).createConsumerAudits(anyCollection()); consumerAuditUtil.audit(request, someConsumerId); List<ConsumerAudit> audits = result.get(batchTimeout * 5, batchTimeUnit); assertEquals(1, audits.size()); ConsumerAudit audit = audits.get(0); assertEquals(String.format("%s?%s", someUri, someQuery), audit.getUri()); assertEquals(someMethod, audit.getMethod()); assertEquals(someConsumerId, audit.getConsumerId()); } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-core/src/test/java/com/ctrip/framework/apollo/tracer/internals/MockMessageProducerManager.java
package com.ctrip.framework.apollo.tracer.internals; import com.ctrip.framework.apollo.tracer.spi.MessageProducer; import com.ctrip.framework.apollo.tracer.spi.MessageProducerManager; /** * @author Jason Song([email protected]) */ public class MockMessageProducerManager implements MessageProducerManager { private static MessageProducer s_producer; @Override public MessageProducer getProducer() { return s_producer; } public static void setProducer(MessageProducer producer) { s_producer = producer; } }
package com.ctrip.framework.apollo.tracer.internals; import com.ctrip.framework.apollo.tracer.spi.MessageProducer; import com.ctrip.framework.apollo.tracer.spi.MessageProducerManager; /** * @author Jason Song([email protected]) */ public class MockMessageProducerManager implements MessageProducerManager { private static MessageProducer s_producer; @Override public MessageProducer getProducer() { return s_producer; } public static void setProducer(MessageProducer producer) { s_producer = producer; } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-client/src/main/java/com/ctrip/framework/apollo/spring/config/ConfigPropertySource.java
package com.ctrip.framework.apollo.spring.config; import com.ctrip.framework.apollo.ConfigChangeListener; import java.util.Set; import org.springframework.core.env.EnumerablePropertySource; import com.ctrip.framework.apollo.Config; /** * Property source wrapper for Config * * @author Jason Song([email protected]) */ public class ConfigPropertySource extends EnumerablePropertySource<Config> { private static final String[] EMPTY_ARRAY = new String[0]; ConfigPropertySource(String name, Config source) { super(name, source); } @Override public String[] getPropertyNames() { Set<String> propertyNames = this.source.getPropertyNames(); if (propertyNames.isEmpty()) { return EMPTY_ARRAY; } return propertyNames.toArray(new String[propertyNames.size()]); } @Override public Object getProperty(String name) { return this.source.getProperty(name, null); } public void addChangeListener(ConfigChangeListener listener) { this.source.addChangeListener(listener); } }
package com.ctrip.framework.apollo.spring.config; import com.ctrip.framework.apollo.ConfigChangeListener; import java.util.Set; import org.springframework.core.env.EnumerablePropertySource; import com.ctrip.framework.apollo.Config; /** * Property source wrapper for Config * * @author Jason Song([email protected]) */ public class ConfigPropertySource extends EnumerablePropertySource<Config> { private static final String[] EMPTY_ARRAY = new String[0]; ConfigPropertySource(String name, Config source) { super(name, source); } @Override public String[] getPropertyNames() { Set<String> propertyNames = this.source.getPropertyNames(); if (propertyNames.isEmpty()) { return EMPTY_ARRAY; } return propertyNames.toArray(new String[propertyNames.size()]); } @Override public Object getProperty(String name) { return this.source.getProperty(name, null); } public void addChangeListener(ConfigChangeListener listener) { this.source.addChangeListener(listener); } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/service/ReleaseMessageServiceWithCache.java
package com.ctrip.framework.apollo.configservice.service; import com.ctrip.framework.apollo.biz.config.BizConfig; import com.ctrip.framework.apollo.biz.entity.ReleaseMessage; import com.ctrip.framework.apollo.biz.message.ReleaseMessageListener; import com.ctrip.framework.apollo.biz.message.Topics; import com.ctrip.framework.apollo.biz.repository.ReleaseMessageRepository; import com.ctrip.framework.apollo.core.utils.ApolloThreadFactory; import com.ctrip.framework.apollo.tracer.Tracer; import com.ctrip.framework.apollo.tracer.spi.Transaction; import com.google.common.base.Strings; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.InitializingBean; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.Collections; import java.util.List; import java.util.Set; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; /** * @author Jason Song([email protected]) */ @Service public class ReleaseMessageServiceWithCache implements ReleaseMessageListener, InitializingBean { private static final Logger logger = LoggerFactory.getLogger(ReleaseMessageServiceWithCache .class); private final ReleaseMessageRepository releaseMessageRepository; private final BizConfig bizConfig; private int scanInterval; private TimeUnit scanIntervalTimeUnit; private volatile long maxIdScanned; private ConcurrentMap<String, ReleaseMessage> releaseMessageCache; private AtomicBoolean doScan; private ExecutorService executorService; public ReleaseMessageServiceWithCache( final ReleaseMessageRepository releaseMessageRepository, final BizConfig bizConfig) { this.releaseMessageRepository = releaseMessageRepository; this.bizConfig = bizConfig; initialize(); } private void initialize() { releaseMessageCache = Maps.newConcurrentMap(); doScan = new AtomicBoolean(true); executorService = Executors.newSingleThreadExecutor(ApolloThreadFactory .create("ReleaseMessageServiceWithCache", true)); } public ReleaseMessage findLatestReleaseMessageForMessages(Set<String> messages) { if (CollectionUtils.isEmpty(messages)) { return null; } long maxReleaseMessageId = 0; ReleaseMessage result = null; for (String message : messages) { ReleaseMessage releaseMessage = releaseMessageCache.get(message); if (releaseMessage != null && releaseMessage.getId() > maxReleaseMessageId) { maxReleaseMessageId = releaseMessage.getId(); result = releaseMessage; } } return result; } public List<ReleaseMessage> findLatestReleaseMessagesGroupByMessages(Set<String> messages) { if (CollectionUtils.isEmpty(messages)) { return Collections.emptyList(); } List<ReleaseMessage> releaseMessages = Lists.newArrayList(); for (String message : messages) { ReleaseMessage releaseMessage = releaseMessageCache.get(message); if (releaseMessage != null) { releaseMessages.add(releaseMessage); } } return releaseMessages; } @Override public void handleMessage(ReleaseMessage message, String channel) { //Could stop once the ReleaseMessageScanner starts to work doScan.set(false); logger.info("message received - channel: {}, message: {}", channel, message); String content = message.getMessage(); Tracer.logEvent("Apollo.ReleaseMessageService.UpdateCache", String.valueOf(message.getId())); if (!Topics.APOLLO_RELEASE_TOPIC.equals(channel) || Strings.isNullOrEmpty(content)) { return; } long gap = message.getId() - maxIdScanned; if (gap == 1) { mergeReleaseMessage(message); } else if (gap > 1) { //gap found! loadReleaseMessages(maxIdScanned); } } @Override public void afterPropertiesSet() throws Exception { populateDataBaseInterval(); //block the startup process until load finished //this should happen before ReleaseMessageScanner due to autowire loadReleaseMessages(0); executorService.submit(() -> { while (doScan.get() && !Thread.currentThread().isInterrupted()) { Transaction transaction = Tracer.newTransaction("Apollo.ReleaseMessageServiceWithCache", "scanNewReleaseMessages"); try { loadReleaseMessages(maxIdScanned); transaction.setStatus(Transaction.SUCCESS); } catch (Throwable ex) { transaction.setStatus(ex); logger.error("Scan new release messages failed", ex); } finally { transaction.complete(); } try { scanIntervalTimeUnit.sleep(scanInterval); } catch (InterruptedException e) { //ignore } } }); } private synchronized void mergeReleaseMessage(ReleaseMessage releaseMessage) { ReleaseMessage old = releaseMessageCache.get(releaseMessage.getMessage()); if (old == null || releaseMessage.getId() > old.getId()) { releaseMessageCache.put(releaseMessage.getMessage(), releaseMessage); maxIdScanned = releaseMessage.getId(); } } private void loadReleaseMessages(long startId) { boolean hasMore = true; while (hasMore && !Thread.currentThread().isInterrupted()) { //current batch is 500 List<ReleaseMessage> releaseMessages = releaseMessageRepository .findFirst500ByIdGreaterThanOrderByIdAsc(startId); if (CollectionUtils.isEmpty(releaseMessages)) { break; } releaseMessages.forEach(this::mergeReleaseMessage); int scanned = releaseMessages.size(); startId = releaseMessages.get(scanned - 1).getId(); hasMore = scanned == 500; logger.info("Loaded {} release messages with startId {}", scanned, startId); } } private void populateDataBaseInterval() { scanInterval = bizConfig.releaseMessageCacheScanInterval(); scanIntervalTimeUnit = bizConfig.releaseMessageCacheScanIntervalTimeUnit(); } //only for test use private void reset() throws Exception { executorService.shutdownNow(); initialize(); afterPropertiesSet(); } }
package com.ctrip.framework.apollo.configservice.service; import com.ctrip.framework.apollo.biz.config.BizConfig; import com.ctrip.framework.apollo.biz.entity.ReleaseMessage; import com.ctrip.framework.apollo.biz.message.ReleaseMessageListener; import com.ctrip.framework.apollo.biz.message.Topics; import com.ctrip.framework.apollo.biz.repository.ReleaseMessageRepository; import com.ctrip.framework.apollo.core.utils.ApolloThreadFactory; import com.ctrip.framework.apollo.tracer.Tracer; import com.ctrip.framework.apollo.tracer.spi.Transaction; import com.google.common.base.Strings; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.InitializingBean; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.Collections; import java.util.List; import java.util.Set; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; /** * @author Jason Song([email protected]) */ @Service public class ReleaseMessageServiceWithCache implements ReleaseMessageListener, InitializingBean { private static final Logger logger = LoggerFactory.getLogger(ReleaseMessageServiceWithCache .class); private final ReleaseMessageRepository releaseMessageRepository; private final BizConfig bizConfig; private int scanInterval; private TimeUnit scanIntervalTimeUnit; private volatile long maxIdScanned; private ConcurrentMap<String, ReleaseMessage> releaseMessageCache; private AtomicBoolean doScan; private ExecutorService executorService; public ReleaseMessageServiceWithCache( final ReleaseMessageRepository releaseMessageRepository, final BizConfig bizConfig) { this.releaseMessageRepository = releaseMessageRepository; this.bizConfig = bizConfig; initialize(); } private void initialize() { releaseMessageCache = Maps.newConcurrentMap(); doScan = new AtomicBoolean(true); executorService = Executors.newSingleThreadExecutor(ApolloThreadFactory .create("ReleaseMessageServiceWithCache", true)); } public ReleaseMessage findLatestReleaseMessageForMessages(Set<String> messages) { if (CollectionUtils.isEmpty(messages)) { return null; } long maxReleaseMessageId = 0; ReleaseMessage result = null; for (String message : messages) { ReleaseMessage releaseMessage = releaseMessageCache.get(message); if (releaseMessage != null && releaseMessage.getId() > maxReleaseMessageId) { maxReleaseMessageId = releaseMessage.getId(); result = releaseMessage; } } return result; } public List<ReleaseMessage> findLatestReleaseMessagesGroupByMessages(Set<String> messages) { if (CollectionUtils.isEmpty(messages)) { return Collections.emptyList(); } List<ReleaseMessage> releaseMessages = Lists.newArrayList(); for (String message : messages) { ReleaseMessage releaseMessage = releaseMessageCache.get(message); if (releaseMessage != null) { releaseMessages.add(releaseMessage); } } return releaseMessages; } @Override public void handleMessage(ReleaseMessage message, String channel) { //Could stop once the ReleaseMessageScanner starts to work doScan.set(false); logger.info("message received - channel: {}, message: {}", channel, message); String content = message.getMessage(); Tracer.logEvent("Apollo.ReleaseMessageService.UpdateCache", String.valueOf(message.getId())); if (!Topics.APOLLO_RELEASE_TOPIC.equals(channel) || Strings.isNullOrEmpty(content)) { return; } long gap = message.getId() - maxIdScanned; if (gap == 1) { mergeReleaseMessage(message); } else if (gap > 1) { //gap found! loadReleaseMessages(maxIdScanned); } } @Override public void afterPropertiesSet() throws Exception { populateDataBaseInterval(); //block the startup process until load finished //this should happen before ReleaseMessageScanner due to autowire loadReleaseMessages(0); executorService.submit(() -> { while (doScan.get() && !Thread.currentThread().isInterrupted()) { Transaction transaction = Tracer.newTransaction("Apollo.ReleaseMessageServiceWithCache", "scanNewReleaseMessages"); try { loadReleaseMessages(maxIdScanned); transaction.setStatus(Transaction.SUCCESS); } catch (Throwable ex) { transaction.setStatus(ex); logger.error("Scan new release messages failed", ex); } finally { transaction.complete(); } try { scanIntervalTimeUnit.sleep(scanInterval); } catch (InterruptedException e) { //ignore } } }); } private synchronized void mergeReleaseMessage(ReleaseMessage releaseMessage) { ReleaseMessage old = releaseMessageCache.get(releaseMessage.getMessage()); if (old == null || releaseMessage.getId() > old.getId()) { releaseMessageCache.put(releaseMessage.getMessage(), releaseMessage); maxIdScanned = releaseMessage.getId(); } } private void loadReleaseMessages(long startId) { boolean hasMore = true; while (hasMore && !Thread.currentThread().isInterrupted()) { //current batch is 500 List<ReleaseMessage> releaseMessages = releaseMessageRepository .findFirst500ByIdGreaterThanOrderByIdAsc(startId); if (CollectionUtils.isEmpty(releaseMessages)) { break; } releaseMessages.forEach(this::mergeReleaseMessage); int scanned = releaseMessages.size(); startId = releaseMessages.get(scanned - 1).getId(); hasMore = scanned == 500; logger.info("Loaded {} release messages with startId {}", scanned, startId); } } private void populateDataBaseInterval() { scanInterval = bizConfig.releaseMessageCacheScanInterval(); scanIntervalTimeUnit = bizConfig.releaseMessageCacheScanIntervalTimeUnit(); } //only for test use private void reset() throws Exception { executorService.shutdownNow(); initialize(); afterPropertiesSet(); } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./mvnw.cmd
@REM ---------------------------------------------------------------------------- @REM Licensed to the Apache Software Foundation (ASF) under one @REM or more contributor license agreements. See the NOTICE file @REM distributed with this work for additional information @REM regarding copyright ownership. The ASF licenses this file @REM to you under the Apache License, Version 2.0 (the @REM "License"); you may not use this file except in compliance @REM with the License. You may obtain a copy of the License at @REM @REM http://www.apache.org/licenses/LICENSE-2.0 @REM @REM Unless required by applicable law or agreed to in writing, @REM software distributed under the License is distributed on an @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @REM KIND, either express or implied. See the License for the @REM specific language governing permissions and limitations @REM under the License. @REM ---------------------------------------------------------------------------- @REM ---------------------------------------------------------------------------- @REM Maven2 Start Up Batch script @REM @REM Required ENV vars: @REM JAVA_HOME - location of a JDK home dir @REM @REM Optional ENV vars @REM M2_HOME - location of maven2's installed home dir @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven @REM e.g. to debug Maven itself, use @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files @REM ---------------------------------------------------------------------------- @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' @echo off @REM set title of command window title %0 @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% @REM set %HOME% to equivalent of $HOME if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") @REM Execute a user defined script before this one if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre @REM check for pre script, once with legacy .bat ending and once with .cmd ending if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" :skipRcPre @setlocal set ERROR_CODE=0 @REM To isolate internal variables from possible post scripts, we use another setlocal @setlocal @REM ==== START VALIDATION ==== if not "%JAVA_HOME%" == "" goto OkJHome echo. echo Error: JAVA_HOME not found in your environment. >&2 echo Please set the JAVA_HOME variable in your environment to match the >&2 echo location of your Java installation. >&2 echo. goto error :OkJHome if exist "%JAVA_HOME%\bin\java.exe" goto init echo. echo Error: JAVA_HOME is set to an invalid directory. >&2 echo JAVA_HOME = "%JAVA_HOME%" >&2 echo Please set the JAVA_HOME variable in your environment to match the >&2 echo location of your Java installation. >&2 echo. goto error @REM ==== END VALIDATION ==== :init @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". @REM Fallback to current working directory if not found. set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir set EXEC_DIR=%CD% set WDIR=%EXEC_DIR% :findBaseDir IF EXIST "%WDIR%"\.mvn goto baseDirFound cd .. IF "%WDIR%"=="%CD%" goto baseDirNotFound set WDIR=%CD% goto findBaseDir :baseDirFound set MAVEN_PROJECTBASEDIR=%WDIR% cd "%EXEC_DIR%" goto endDetectBaseDir :baseDirNotFound set MAVEN_PROJECTBASEDIR=%EXEC_DIR% cd "%EXEC_DIR%" :endDetectBaseDir IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig @setlocal EnableExtensions EnableDelayedExpansion for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% :endReadAdditionalConfig SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B ) @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central @REM This allows using the maven wrapper in projects that prohibit checking in binary data. if exist %WRAPPER_JAR% ( echo Found %WRAPPER_JAR% ) else ( echo Couldn't find %WRAPPER_JAR%, downloading it ... echo Downloading from: %DOWNLOAD_URL% powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" echo Finished downloading %WRAPPER_JAR% ) @REM End of extension %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* if ERRORLEVEL 1 goto error goto end :error set ERROR_CODE=1 :end @endlocal & set ERROR_CODE=%ERROR_CODE% if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost @REM check for post script, once with legacy .bat ending and once with .cmd ending if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" :skipRcPost @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' if "%MAVEN_BATCH_PAUSE%" == "on" pause if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% exit /B %ERROR_CODE%
@REM ---------------------------------------------------------------------------- @REM Licensed to the Apache Software Foundation (ASF) under one @REM or more contributor license agreements. See the NOTICE file @REM distributed with this work for additional information @REM regarding copyright ownership. The ASF licenses this file @REM to you under the Apache License, Version 2.0 (the @REM "License"); you may not use this file except in compliance @REM with the License. You may obtain a copy of the License at @REM @REM http://www.apache.org/licenses/LICENSE-2.0 @REM @REM Unless required by applicable law or agreed to in writing, @REM software distributed under the License is distributed on an @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @REM KIND, either express or implied. See the License for the @REM specific language governing permissions and limitations @REM under the License. @REM ---------------------------------------------------------------------------- @REM ---------------------------------------------------------------------------- @REM Maven2 Start Up Batch script @REM @REM Required ENV vars: @REM JAVA_HOME - location of a JDK home dir @REM @REM Optional ENV vars @REM M2_HOME - location of maven2's installed home dir @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven @REM e.g. to debug Maven itself, use @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files @REM ---------------------------------------------------------------------------- @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' @echo off @REM set title of command window title %0 @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% @REM set %HOME% to equivalent of $HOME if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") @REM Execute a user defined script before this one if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre @REM check for pre script, once with legacy .bat ending and once with .cmd ending if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" :skipRcPre @setlocal set ERROR_CODE=0 @REM To isolate internal variables from possible post scripts, we use another setlocal @setlocal @REM ==== START VALIDATION ==== if not "%JAVA_HOME%" == "" goto OkJHome echo. echo Error: JAVA_HOME not found in your environment. >&2 echo Please set the JAVA_HOME variable in your environment to match the >&2 echo location of your Java installation. >&2 echo. goto error :OkJHome if exist "%JAVA_HOME%\bin\java.exe" goto init echo. echo Error: JAVA_HOME is set to an invalid directory. >&2 echo JAVA_HOME = "%JAVA_HOME%" >&2 echo Please set the JAVA_HOME variable in your environment to match the >&2 echo location of your Java installation. >&2 echo. goto error @REM ==== END VALIDATION ==== :init @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". @REM Fallback to current working directory if not found. set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir set EXEC_DIR=%CD% set WDIR=%EXEC_DIR% :findBaseDir IF EXIST "%WDIR%"\.mvn goto baseDirFound cd .. IF "%WDIR%"=="%CD%" goto baseDirNotFound set WDIR=%CD% goto findBaseDir :baseDirFound set MAVEN_PROJECTBASEDIR=%WDIR% cd "%EXEC_DIR%" goto endDetectBaseDir :baseDirNotFound set MAVEN_PROJECTBASEDIR=%EXEC_DIR% cd "%EXEC_DIR%" :endDetectBaseDir IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig @setlocal EnableExtensions EnableDelayedExpansion for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% :endReadAdditionalConfig SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B ) @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central @REM This allows using the maven wrapper in projects that prohibit checking in binary data. if exist %WRAPPER_JAR% ( echo Found %WRAPPER_JAR% ) else ( echo Couldn't find %WRAPPER_JAR%, downloading it ... echo Downloading from: %DOWNLOAD_URL% powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" echo Finished downloading %WRAPPER_JAR% ) @REM End of extension %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* if ERRORLEVEL 1 goto error goto end :error set ERROR_CODE=1 :end @endlocal & set ERROR_CODE=%ERROR_CODE% if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost @REM check for post script, once with legacy .bat ending and once with .cmd ending if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" :skipRcPost @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' if "%MAVEN_BATCH_PAUSE%" == "on" pause if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% exit /B %ERROR_CODE%
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/ctrip/WebContextConfiguration.java
package com.ctrip.framework.apollo.portal.spi.ctrip; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import com.ctrip.framework.apollo.portal.spi.UserInfoHolder; import com.ctrip.framework.apollo.portal.spi.ctrip.filters.UserAccessFilter; import com.google.common.base.Strings; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; @Configuration @Profile("ctrip") public class WebContextConfiguration { private final PortalConfig portalConfig; private final UserInfoHolder userInfoHolder; public WebContextConfiguration(final PortalConfig portalConfig, final UserInfoHolder userInfoHolder) { this.portalConfig = portalConfig; this.userInfoHolder = userInfoHolder; } @Bean public ServletContextInitializer servletContextInitializer() { return servletContext -> { String loggingServerIP = portalConfig.cloggingUrl(); String loggingServerPort = portalConfig.cloggingPort(); String credisServiceUrl = portalConfig.credisServiceUrl(); servletContext.setInitParameter("loggingServerIP", Strings.isNullOrEmpty(loggingServerIP) ? "" : loggingServerIP); servletContext.setInitParameter("loggingServerPort", Strings.isNullOrEmpty(loggingServerPort) ? "" : loggingServerPort); servletContext.setInitParameter("credisServiceUrl", Strings.isNullOrEmpty(credisServiceUrl) ? "" : credisServiceUrl); }; } @Bean public FilterRegistrationBean userAccessFilter() { FilterRegistrationBean filter = new FilterRegistrationBean(); filter.setFilter(new UserAccessFilter(userInfoHolder)); filter.addUrlPatterns("/*"); return filter; } }
package com.ctrip.framework.apollo.portal.spi.ctrip; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import com.ctrip.framework.apollo.portal.spi.UserInfoHolder; import com.ctrip.framework.apollo.portal.spi.ctrip.filters.UserAccessFilter; import com.google.common.base.Strings; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; @Configuration @Profile("ctrip") public class WebContextConfiguration { private final PortalConfig portalConfig; private final UserInfoHolder userInfoHolder; public WebContextConfiguration(final PortalConfig portalConfig, final UserInfoHolder userInfoHolder) { this.portalConfig = portalConfig; this.userInfoHolder = userInfoHolder; } @Bean public ServletContextInitializer servletContextInitializer() { return servletContext -> { String loggingServerIP = portalConfig.cloggingUrl(); String loggingServerPort = portalConfig.cloggingPort(); String credisServiceUrl = portalConfig.credisServiceUrl(); servletContext.setInitParameter("loggingServerIP", Strings.isNullOrEmpty(loggingServerIP) ? "" : loggingServerIP); servletContext.setInitParameter("loggingServerPort", Strings.isNullOrEmpty(loggingServerPort) ? "" : loggingServerPort); servletContext.setInitParameter("credisServiceUrl", Strings.isNullOrEmpty(credisServiceUrl) ? "" : credisServiceUrl); }; } @Bean public FilterRegistrationBean userAccessFilter() { FilterRegistrationBean filter = new FilterRegistrationBean(); filter.setFilter(new UserAccessFilter(userInfoHolder)); filter.addUrlPatterns("/*"); return filter; } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-portal/src/main/resources/static/scripts/controller/AppController.js
app_module.controller('CreateAppController', ['$scope', '$window', '$translate', 'toastr', 'AppService', 'AppUtil', 'OrganizationService', 'SystemRoleService', 'UserService', createAppController]); function createAppController($scope, $window, $translate, toastr, AppService, AppUtil, OrganizationService, SystemRoleService, UserService) { $scope.app = {}; $scope.submitBtnDisabled = false; $scope.create = create; init(); function init() { initOrganization(); initSystemRole(); } function initOrganization() { OrganizationService.find_organizations().then(function (result) { var organizations = []; result.forEach(function (item) { var org = {}; org.id = item.orgId; org.text = item.orgName + '(' + item.orgId + ')'; org.name = item.orgName; organizations.push(org); }); $('#organization').select2({ placeholder: $translate.instant('Common.PleaseChooseDepartment'), width: '100%', data: organizations }); }, function (result) { toastr.error(AppUtil.errorMsg(result), "load organizations error"); }); } function initSystemRole() { SystemRoleService.has_open_manage_app_master_role_limit().then( function (value) { $scope.isOpenManageAppMasterRoleLimit = value.isManageAppMasterPermissionEnabled; UserService.load_user().then( function (value1) { $scope.currentUser = value1; }, function (reason) { toastr.error(AppUtil.errorMsg(reason), "load current user info failed"); }) }, function (reason) { toastr.error(AppUtil.errorMsg(reason), "init system role of manageAppMaster failed"); } ); } function create() { $scope.submitBtnDisabled = true; var selectedOrg = $('#organization').select2('data')[0]; if (!selectedOrg.id) { toastr.warning($translate.instant('Common.PleaseChooseDepartment')); $scope.submitBtnDisabled = false; return; } $scope.app.orgId = selectedOrg.id; $scope.app.orgName = selectedOrg.name; // owner var owner = $('.ownerSelector').select2('data')[0]; if ($scope.isOpenManageAppMasterRoleLimit) { owner = { id: $scope.currentUser.userId }; } if (!owner) { toastr.warning($translate.instant('Common.PleaseChooseOwner')); $scope.submitBtnDisabled = false; return; } $scope.app.ownerName = owner.id; //admins $scope.app.admins = []; var admins = $(".adminSelector").select2('data'); if ($scope.isOpenManageAppMasterRoleLimit) { admins = [{ id: $scope.currentUser.userId }]; } if (admins) { admins.forEach(function (admin) { $scope.app.admins.push(admin.id); }) } AppService.create($scope.app).then(function (result) { toastr.success($translate.instant('Common.Created')); setInterval(function () { $scope.submitBtnDisabled = false; $window.location.href = AppUtil.prefixPath() + '/config.html?#appid=' + result.appId; }, 1000); }, function (result) { $scope.submitBtnDisabled = false; toastr.error(AppUtil.errorMsg(result), $translate.instant('Common.CreateFailed')); }); } $(".J_ownerSelectorPanel").on("select2:select", ".ownerSelector", selectEventHandler); var $adminSelectorPanel = $(".J_adminSelectorPanel"); $adminSelectorPanel.on("select2:select", ".adminSelector", selectEventHandler); $adminSelectorPanel.on("select2:unselect", ".adminSelector", selectEventHandler); function selectEventHandler() { $('.J_owner').remove(); var owner = $('.ownerSelector').select2('data')[0]; if (owner) { $(".adminSelector").parent().find(".select2-selection__rendered").prepend( '<li class="select2-selection__choice J_owner">' + _.escape(owner.text) + '</li>') } } }
app_module.controller('CreateAppController', ['$scope', '$window', '$translate', 'toastr', 'AppService', 'AppUtil', 'OrganizationService', 'SystemRoleService', 'UserService', createAppController]); function createAppController($scope, $window, $translate, toastr, AppService, AppUtil, OrganizationService, SystemRoleService, UserService) { $scope.app = {}; $scope.submitBtnDisabled = false; $scope.create = create; init(); function init() { initOrganization(); initSystemRole(); } function initOrganization() { OrganizationService.find_organizations().then(function (result) { var organizations = []; result.forEach(function (item) { var org = {}; org.id = item.orgId; org.text = item.orgName + '(' + item.orgId + ')'; org.name = item.orgName; organizations.push(org); }); $('#organization').select2({ placeholder: $translate.instant('Common.PleaseChooseDepartment'), width: '100%', data: organizations }); }, function (result) { toastr.error(AppUtil.errorMsg(result), "load organizations error"); }); } function initSystemRole() { SystemRoleService.has_open_manage_app_master_role_limit().then( function (value) { $scope.isOpenManageAppMasterRoleLimit = value.isManageAppMasterPermissionEnabled; UserService.load_user().then( function (value1) { $scope.currentUser = value1; }, function (reason) { toastr.error(AppUtil.errorMsg(reason), "load current user info failed"); }) }, function (reason) { toastr.error(AppUtil.errorMsg(reason), "init system role of manageAppMaster failed"); } ); } function create() { $scope.submitBtnDisabled = true; var selectedOrg = $('#organization').select2('data')[0]; if (!selectedOrg.id) { toastr.warning($translate.instant('Common.PleaseChooseDepartment')); $scope.submitBtnDisabled = false; return; } $scope.app.orgId = selectedOrg.id; $scope.app.orgName = selectedOrg.name; // owner var owner = $('.ownerSelector').select2('data')[0]; if ($scope.isOpenManageAppMasterRoleLimit) { owner = { id: $scope.currentUser.userId }; } if (!owner) { toastr.warning($translate.instant('Common.PleaseChooseOwner')); $scope.submitBtnDisabled = false; return; } $scope.app.ownerName = owner.id; //admins $scope.app.admins = []; var admins = $(".adminSelector").select2('data'); if ($scope.isOpenManageAppMasterRoleLimit) { admins = [{ id: $scope.currentUser.userId }]; } if (admins) { admins.forEach(function (admin) { $scope.app.admins.push(admin.id); }) } AppService.create($scope.app).then(function (result) { toastr.success($translate.instant('Common.Created')); setInterval(function () { $scope.submitBtnDisabled = false; $window.location.href = AppUtil.prefixPath() + '/config.html?#appid=' + result.appId; }, 1000); }, function (result) { $scope.submitBtnDisabled = false; toastr.error(AppUtil.errorMsg(result), $translate.instant('Common.CreateFailed')); }); } $(".J_ownerSelectorPanel").on("select2:select", ".ownerSelector", selectEventHandler); var $adminSelectorPanel = $(".J_adminSelectorPanel"); $adminSelectorPanel.on("select2:select", ".adminSelector", selectEventHandler); $adminSelectorPanel.on("select2:unselect", ".adminSelector", selectEventHandler); function selectEventHandler() { $('.J_owner').remove(); var owner = $('.ownerSelector').select2('data')[0]; if (owner) { $(".adminSelector").parent().find(".select2-selection__rendered").prepend( '<li class="select2-selection__choice J_owner">' + _.escape(owner.text) + '</li>') } } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./doc/images/text-mode-config-entry.png
PNG  IHDR+Q IDATx|Oz${.JD(+Y+]+*J*j|Orȯpݝ7眙˗%C0 C0 C0J"**FjI_BBDFF g!`!`9(/**Jrh!`!`!PRBBB$99E%4$DB9\J 3 C0 C0 *, C0 C0 C0ʂ g!`!`"`:!`!`!`e 0 C0 C0  C0 C0 C(3V!`!`!`>`!`!`eF@+s)V!`A/~(YBI-1G{|T o5\5y;w.$66Vj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 @|>-!J @@ @ @`X@a1L( @ c @a0 @(, @Ä @ 0 @PX  @ @ @ @`X@a1L( @ c @a0 @(, @Ä @ 0 @PX  @ @ @ @`X@a1L( @ c @a0 @(, @~lf,IENDB`
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./.git/hooks/post-update.sample
#!/bin/sh # # An example hook script to prepare a packed repository for use over # dumb transports. # # To enable this hook, rename this file to "post-update". exec git update-server-info
#!/bin/sh # # An example hook script to prepare a packed repository for use over # dumb transports. # # To enable this hook, rename this file to "post-update". exec git update-server-info
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./scripts/apollo-on-kubernetes/apollo-portal-server/scripts/startup-kubernetes.sh
#!/bin/bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=/opt/logs/apollo-portal-server ## Adjust server port if necessary SERVER_PORT=8070 # SERVER_URL="http://localhost:$SERVER_PORT" SERVER_URL="http://${APOLLO_PORTAL_SERVICE_NAME}:${SERVER_PORT}" ## Adjust memory settings if necessary #export JAVA_OPTS="-Xms2560m -Xmx2560m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=1536m -XX:MaxNewSize=1536m -XX:SurvivorRatio=8" ## Only uncomment the following when you are using server jvm #export JAVA_OPTS="$JAVA_OPTS -server -XX:-ReduceInitialCardMarks" ########### The following is the same for configservice, adminservice, portal ########### export JAVA_OPTS="$JAVA_OPTS -XX:ParallelGCThreads=4 -XX:MaxTenuringThreshold=9 -XX:+DisableExplicitGC -XX:+ScavengeBeforeFullGC -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+ExplicitGCInvokesConcurrent -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom" export JAVA_OPTS="$JAVA_OPTS -Dserver.port=$SERVER_PORT -Dlogging.file.name=$LOG_DIR/$SERVICE_NAME.log -XX:HeapDumpPath=$LOG_DIR/HeapDumpOnOutOfMemoryError/" # Find Java if [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then javaexe="$JAVA_HOME/bin/java" elif type -p java > /dev/null 2>&1; then javaexe=$(type -p java) elif [[ -x "/usr/bin/java" ]]; then javaexe="/usr/bin/java" else echo "Unable to find Java" exit 1 fi if [[ "$javaexe" ]]; then version=$("$javaexe" -version 2>&1 | awk -F '"' '/version/ {print $2}') version=$(echo "$version" | awk -F. '{printf("%03d%03d",$1,$2);}') # now version is of format 009003 (9.3.x) if [ $version -ge 011000 ]; then JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" elif [ $version -ge 010000 ]; then JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" elif [ $version -ge 009000 ]; then JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" else JAVA_OPTS="$JAVA_OPTS -XX:+UseParNewGC" JAVA_OPTS="$JAVA_OPTS -Xloggc:$LOG_DIR/gc.log -XX:+PrintGCDetails" JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:+CMSClassUnloadingEnabled -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=5M" fi fi printf "$(date) ==== Starting ==== \n" cd `dirname $0`/.. chmod 755 $SERVICE_NAME".jar" ./$SERVICE_NAME".jar" start rc=$?; if [[ $rc != 0 ]]; then echo "$(date) Failed to start $SERVICE_NAME.jar, return code: $rc" exit $rc; fi tail -f /dev/null
#!/bin/bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=/opt/logs/apollo-portal-server ## Adjust server port if necessary SERVER_PORT=8070 # SERVER_URL="http://localhost:$SERVER_PORT" SERVER_URL="http://${APOLLO_PORTAL_SERVICE_NAME}:${SERVER_PORT}" ## Adjust memory settings if necessary #export JAVA_OPTS="-Xms2560m -Xmx2560m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=1536m -XX:MaxNewSize=1536m -XX:SurvivorRatio=8" ## Only uncomment the following when you are using server jvm #export JAVA_OPTS="$JAVA_OPTS -server -XX:-ReduceInitialCardMarks" ########### The following is the same for configservice, adminservice, portal ########### export JAVA_OPTS="$JAVA_OPTS -XX:ParallelGCThreads=4 -XX:MaxTenuringThreshold=9 -XX:+DisableExplicitGC -XX:+ScavengeBeforeFullGC -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+ExplicitGCInvokesConcurrent -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom" export JAVA_OPTS="$JAVA_OPTS -Dserver.port=$SERVER_PORT -Dlogging.file.name=$LOG_DIR/$SERVICE_NAME.log -XX:HeapDumpPath=$LOG_DIR/HeapDumpOnOutOfMemoryError/" # Find Java if [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then javaexe="$JAVA_HOME/bin/java" elif type -p java > /dev/null 2>&1; then javaexe=$(type -p java) elif [[ -x "/usr/bin/java" ]]; then javaexe="/usr/bin/java" else echo "Unable to find Java" exit 1 fi if [[ "$javaexe" ]]; then version=$("$javaexe" -version 2>&1 | awk -F '"' '/version/ {print $2}') version=$(echo "$version" | awk -F. '{printf("%03d%03d",$1,$2);}') # now version is of format 009003 (9.3.x) if [ $version -ge 011000 ]; then JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" elif [ $version -ge 010000 ]; then JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" elif [ $version -ge 009000 ]; then JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" else JAVA_OPTS="$JAVA_OPTS -XX:+UseParNewGC" JAVA_OPTS="$JAVA_OPTS -Xloggc:$LOG_DIR/gc.log -XX:+PrintGCDetails" JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:+CMSClassUnloadingEnabled -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=5M" fi fi printf "$(date) ==== Starting ==== \n" cd `dirname $0`/.. chmod 755 $SERVICE_NAME".jar" ./$SERVICE_NAME".jar" start rc=$?; if [[ $rc != 0 ]]; then echo "$(date) Failed to start $SERVICE_NAME.jar, return code: $rc" exit $rc; fi tail -f /dev/null
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-portal/src/main/resources/static/scripts/directive/merge-and-publish-modal-directive.js
directive_module.directive('mergeandpublishmodal', mergeAndPublishDirective); function mergeAndPublishDirective(AppUtil, EventManager) { return { restrict: 'E', templateUrl: AppUtil.prefixPath() + '/views/component/merge-and-publish-modal.html', transclude: true, replace: true, scope: { appId: '=', env: '=', cluster: '=' }, link: function (scope) { scope.showReleaseModal = showReleaseModal; EventManager.subscribe(EventManager.EventType.MERGE_AND_PUBLISH_NAMESPACE, function (context) { var branch = context.branch; scope.toReleaseNamespace = branch; scope.toDeleteBranch = branch; scope.isEmergencyPublish = context.isEmergencyPublish ? context.isEmergencyPublish : false; var branchStatusMerge = 2; branch.branchStatus = branchStatusMerge; branch.mergeAndPublish = true; AppUtil.showModal('#mergeAndPublishModal'); }); function showReleaseModal() { EventManager.emit(EventManager.EventType.PUBLISH_NAMESPACE, { namespace: scope.toReleaseNamespace, isEmergencyPublish: scope.isEmergencyPublish }); } } } }
directive_module.directive('mergeandpublishmodal', mergeAndPublishDirective); function mergeAndPublishDirective(AppUtil, EventManager) { return { restrict: 'E', templateUrl: AppUtil.prefixPath() + '/views/component/merge-and-publish-modal.html', transclude: true, replace: true, scope: { appId: '=', env: '=', cluster: '=' }, link: function (scope) { scope.showReleaseModal = showReleaseModal; EventManager.subscribe(EventManager.EventType.MERGE_AND_PUBLISH_NAMESPACE, function (context) { var branch = context.branch; scope.toReleaseNamespace = branch; scope.toDeleteBranch = branch; scope.isEmergencyPublish = context.isEmergencyPublish ? context.isEmergencyPublish : false; var branchStatusMerge = 2; branch.branchStatus = branchStatusMerge; branch.mergeAndPublish = true; AppUtil.showModal('#mergeAndPublishModal'); }); function showReleaseModal() { EventManager.emit(EventManager.EventType.PUBLISH_NAMESPACE, { namespace: scope.toReleaseNamespace, isEmergencyPublish: scope.isEmergencyPublish }); } } } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-core/src/main/java/com/ctrip/framework/foundation/internals/io/IOUtils.java
package com.ctrip.framework.foundation.internals.io; public class IOUtils { public static final int EOF = -1; }
package com.ctrip.framework.foundation.internals.io; public class IOUtils { public static final int EOF = -1; }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-configservice/src/main/java/com/ctrip/framework/apollo/metaservice/controller/ServiceController.java
package com.ctrip.framework.apollo.metaservice.controller; import com.ctrip.framework.apollo.core.ServiceNameConsts; import com.ctrip.framework.apollo.core.dto.ServiceDTO; import com.ctrip.framework.apollo.metaservice.service.DiscoveryService; import java.util.Collections; import java.util.List; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/services") public class ServiceController { private final DiscoveryService discoveryService; public ServiceController(final DiscoveryService discoveryService) { this.discoveryService = discoveryService; } /** * This method always return an empty list as meta service is not used at all */ @Deprecated @RequestMapping("/meta") public List<ServiceDTO> getMetaService() { return Collections.emptyList(); } @RequestMapping("/config") public List<ServiceDTO> getConfigService( @RequestParam(value = "appId", defaultValue = "") String appId, @RequestParam(value = "ip", required = false) String clientIp) { return discoveryService.getServiceInstances(ServiceNameConsts.APOLLO_CONFIGSERVICE); } @RequestMapping("/admin") public List<ServiceDTO> getAdminService() { return discoveryService.getServiceInstances(ServiceNameConsts.APOLLO_ADMINSERVICE); } }
package com.ctrip.framework.apollo.metaservice.controller; import com.ctrip.framework.apollo.core.ServiceNameConsts; import com.ctrip.framework.apollo.core.dto.ServiceDTO; import com.ctrip.framework.apollo.metaservice.service.DiscoveryService; import java.util.Collections; import java.util.List; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/services") public class ServiceController { private final DiscoveryService discoveryService; public ServiceController(final DiscoveryService discoveryService) { this.discoveryService = discoveryService; } /** * This method always return an empty list as meta service is not used at all */ @Deprecated @RequestMapping("/meta") public List<ServiceDTO> getMetaService() { return Collections.emptyList(); } @RequestMapping("/config") public List<ServiceDTO> getConfigService( @RequestParam(value = "appId", defaultValue = "") String appId, @RequestParam(value = "ip", required = false) String clientIp) { return discoveryService.getServiceInstances(ServiceNameConsts.APOLLO_CONFIGSERVICE); } @RequestMapping("/admin") public List<ServiceDTO> getAdminService() { return discoveryService.getServiceInstances(ServiceNameConsts.APOLLO_ADMINSERVICE); } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/config/BizConfig.java
package com.ctrip.framework.apollo.biz.config; import com.ctrip.framework.apollo.biz.service.BizDBPropertySource; import com.ctrip.framework.apollo.common.config.RefreshableConfig; import com.ctrip.framework.apollo.common.config.RefreshablePropertySource; import com.google.common.base.Strings; import com.google.common.collect.Maps; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; import org.springframework.stereotype.Component; @Component public class BizConfig extends RefreshableConfig { private static final int DEFAULT_ITEM_KEY_LENGTH = 128; private static final int DEFAULT_ITEM_VALUE_LENGTH = 20000; private static final int DEFAULT_APPNAMESPACE_CACHE_REBUILD_INTERVAL = 60; //60s private static final int DEFAULT_GRAY_RELEASE_RULE_SCAN_INTERVAL = 60; //60s private static final int DEFAULT_APPNAMESPACE_CACHE_SCAN_INTERVAL = 1; //1s private static final int DEFAULT_ACCESSKEY_CACHE_SCAN_INTERVAL = 1; //1s private static final int DEFAULT_ACCESSKEY_CACHE_REBUILD_INTERVAL = 60; //60s private static final int DEFAULT_RELEASE_MESSAGE_CACHE_SCAN_INTERVAL = 1; //1s private static final int DEFAULT_RELEASE_MESSAGE_SCAN_INTERVAL_IN_MS = 1000; //1000ms private static final int DEFAULT_RELEASE_MESSAGE_NOTIFICATION_BATCH = 100; private static final int DEFAULT_RELEASE_MESSAGE_NOTIFICATION_BATCH_INTERVAL_IN_MILLI = 100;//100ms private static final int DEFAULT_LONG_POLLING_TIMEOUT = 60; //60s private static final Gson GSON = new Gson(); private static final Type namespaceValueLengthOverrideTypeReference = new TypeToken<Map<Long, Integer>>() { }.getType(); private final BizDBPropertySource propertySource; public BizConfig(final BizDBPropertySource propertySource) { this.propertySource = propertySource; } @Override protected List<RefreshablePropertySource> getRefreshablePropertySources() { return Collections.singletonList(propertySource); } public List<String> eurekaServiceUrls() { String configuration = getValue("eureka.service.url", ""); if (Strings.isNullOrEmpty(configuration)) { return Collections.emptyList(); } return splitter.splitToList(configuration); } public int grayReleaseRuleScanInterval() { int interval = getIntProperty("apollo.gray-release-rule-scan.interval", DEFAULT_GRAY_RELEASE_RULE_SCAN_INTERVAL); return checkInt(interval, 1, Integer.MAX_VALUE, DEFAULT_GRAY_RELEASE_RULE_SCAN_INTERVAL); } public long longPollingTimeoutInMilli() { int timeout = getIntProperty("long.polling.timeout", DEFAULT_LONG_POLLING_TIMEOUT); // java client's long polling timeout is 90 seconds, so server side long polling timeout must be less than 90 return 1000 * checkInt(timeout, 1, 90, DEFAULT_LONG_POLLING_TIMEOUT); } public int itemKeyLengthLimit() { int limit = getIntProperty("item.key.length.limit", DEFAULT_ITEM_KEY_LENGTH); return checkInt(limit, 5, Integer.MAX_VALUE, DEFAULT_ITEM_KEY_LENGTH); } public int itemValueLengthLimit() { int limit = getIntProperty("item.value.length.limit", DEFAULT_ITEM_VALUE_LENGTH); return checkInt(limit, 5, Integer.MAX_VALUE, DEFAULT_ITEM_VALUE_LENGTH); } public Map<Long, Integer> namespaceValueLengthLimitOverride() { String namespaceValueLengthOverrideString = getValue("namespace.value.length.limit.override"); Map<Long, Integer> namespaceValueLengthOverride = Maps.newHashMap(); if (!Strings.isNullOrEmpty(namespaceValueLengthOverrideString)) { namespaceValueLengthOverride = GSON.fromJson(namespaceValueLengthOverrideString, namespaceValueLengthOverrideTypeReference); } return namespaceValueLengthOverride; } public boolean isNamespaceLockSwitchOff() { return !getBooleanProperty("namespace.lock.switch", false); } /** * ctrip config **/ public String cloggingUrl() { return getValue("clogging.server.url"); } public String cloggingPort() { return getValue("clogging.server.port"); } public int appNamespaceCacheScanInterval() { int interval = getIntProperty("apollo.app-namespace-cache-scan.interval", DEFAULT_APPNAMESPACE_CACHE_SCAN_INTERVAL); return checkInt(interval, 1, Integer.MAX_VALUE, DEFAULT_APPNAMESPACE_CACHE_SCAN_INTERVAL); } public TimeUnit appNamespaceCacheScanIntervalTimeUnit() { return TimeUnit.SECONDS; } public int appNamespaceCacheRebuildInterval() { int interval = getIntProperty("apollo.app-namespace-cache-rebuild.interval", DEFAULT_APPNAMESPACE_CACHE_REBUILD_INTERVAL); return checkInt(interval, 1, Integer.MAX_VALUE, DEFAULT_APPNAMESPACE_CACHE_REBUILD_INTERVAL); } public TimeUnit appNamespaceCacheRebuildIntervalTimeUnit() { return TimeUnit.SECONDS; } public int accessKeyCacheScanInterval() { int interval = getIntProperty("apollo.access-key-cache-scan.interval", DEFAULT_ACCESSKEY_CACHE_SCAN_INTERVAL); return checkInt(interval, 1, Integer.MAX_VALUE, DEFAULT_ACCESSKEY_CACHE_SCAN_INTERVAL); } public TimeUnit accessKeyCacheScanIntervalTimeUnit() { return TimeUnit.SECONDS; } public int accessKeyCacheRebuildInterval() { int interval = getIntProperty("apollo.access-key-cache-rebuild.interval", DEFAULT_ACCESSKEY_CACHE_REBUILD_INTERVAL); return checkInt(interval, 1, Integer.MAX_VALUE, DEFAULT_ACCESSKEY_CACHE_REBUILD_INTERVAL); } public TimeUnit accessKeyCacheRebuildIntervalTimeUnit() { return TimeUnit.SECONDS; } public int releaseMessageCacheScanInterval() { int interval = getIntProperty("apollo.release-message-cache-scan.interval", DEFAULT_RELEASE_MESSAGE_CACHE_SCAN_INTERVAL); return checkInt(interval, 1, Integer.MAX_VALUE, DEFAULT_RELEASE_MESSAGE_CACHE_SCAN_INTERVAL); } public TimeUnit releaseMessageCacheScanIntervalTimeUnit() { return TimeUnit.SECONDS; } public int releaseMessageScanIntervalInMilli() { int interval = getIntProperty("apollo.message-scan.interval", DEFAULT_RELEASE_MESSAGE_SCAN_INTERVAL_IN_MS); return checkInt(interval, 100, Integer.MAX_VALUE, DEFAULT_RELEASE_MESSAGE_SCAN_INTERVAL_IN_MS); } public int releaseMessageNotificationBatch() { int batch = getIntProperty("apollo.release-message.notification.batch", DEFAULT_RELEASE_MESSAGE_NOTIFICATION_BATCH); return checkInt(batch, 1, Integer.MAX_VALUE, DEFAULT_RELEASE_MESSAGE_NOTIFICATION_BATCH); } public int releaseMessageNotificationBatchIntervalInMilli() { int interval = getIntProperty("apollo.release-message.notification.batch.interval", DEFAULT_RELEASE_MESSAGE_NOTIFICATION_BATCH_INTERVAL_IN_MILLI); return checkInt(interval, 10, Integer.MAX_VALUE, DEFAULT_RELEASE_MESSAGE_NOTIFICATION_BATCH_INTERVAL_IN_MILLI); } public boolean isConfigServiceCacheEnabled() { return getBooleanProperty("config-service.cache.enabled", false); } int checkInt(int value, int min, int max, int defaultValue) { if (value >= min && value <= max) { return value; } return defaultValue; } public boolean isAdminServiceAccessControlEnabled() { return getBooleanProperty("admin-service.access.control.enabled", false); } public String getAdminServiceAccessTokens() { return getValue("admin-service.access.tokens"); } }
package com.ctrip.framework.apollo.biz.config; import com.ctrip.framework.apollo.biz.service.BizDBPropertySource; import com.ctrip.framework.apollo.common.config.RefreshableConfig; import com.ctrip.framework.apollo.common.config.RefreshablePropertySource; import com.google.common.base.Strings; import com.google.common.collect.Maps; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; import org.springframework.stereotype.Component; @Component public class BizConfig extends RefreshableConfig { private static final int DEFAULT_ITEM_KEY_LENGTH = 128; private static final int DEFAULT_ITEM_VALUE_LENGTH = 20000; private static final int DEFAULT_APPNAMESPACE_CACHE_REBUILD_INTERVAL = 60; //60s private static final int DEFAULT_GRAY_RELEASE_RULE_SCAN_INTERVAL = 60; //60s private static final int DEFAULT_APPNAMESPACE_CACHE_SCAN_INTERVAL = 1; //1s private static final int DEFAULT_ACCESSKEY_CACHE_SCAN_INTERVAL = 1; //1s private static final int DEFAULT_ACCESSKEY_CACHE_REBUILD_INTERVAL = 60; //60s private static final int DEFAULT_RELEASE_MESSAGE_CACHE_SCAN_INTERVAL = 1; //1s private static final int DEFAULT_RELEASE_MESSAGE_SCAN_INTERVAL_IN_MS = 1000; //1000ms private static final int DEFAULT_RELEASE_MESSAGE_NOTIFICATION_BATCH = 100; private static final int DEFAULT_RELEASE_MESSAGE_NOTIFICATION_BATCH_INTERVAL_IN_MILLI = 100;//100ms private static final int DEFAULT_LONG_POLLING_TIMEOUT = 60; //60s private static final Gson GSON = new Gson(); private static final Type namespaceValueLengthOverrideTypeReference = new TypeToken<Map<Long, Integer>>() { }.getType(); private final BizDBPropertySource propertySource; public BizConfig(final BizDBPropertySource propertySource) { this.propertySource = propertySource; } @Override protected List<RefreshablePropertySource> getRefreshablePropertySources() { return Collections.singletonList(propertySource); } public List<String> eurekaServiceUrls() { String configuration = getValue("eureka.service.url", ""); if (Strings.isNullOrEmpty(configuration)) { return Collections.emptyList(); } return splitter.splitToList(configuration); } public int grayReleaseRuleScanInterval() { int interval = getIntProperty("apollo.gray-release-rule-scan.interval", DEFAULT_GRAY_RELEASE_RULE_SCAN_INTERVAL); return checkInt(interval, 1, Integer.MAX_VALUE, DEFAULT_GRAY_RELEASE_RULE_SCAN_INTERVAL); } public long longPollingTimeoutInMilli() { int timeout = getIntProperty("long.polling.timeout", DEFAULT_LONG_POLLING_TIMEOUT); // java client's long polling timeout is 90 seconds, so server side long polling timeout must be less than 90 return 1000 * checkInt(timeout, 1, 90, DEFAULT_LONG_POLLING_TIMEOUT); } public int itemKeyLengthLimit() { int limit = getIntProperty("item.key.length.limit", DEFAULT_ITEM_KEY_LENGTH); return checkInt(limit, 5, Integer.MAX_VALUE, DEFAULT_ITEM_KEY_LENGTH); } public int itemValueLengthLimit() { int limit = getIntProperty("item.value.length.limit", DEFAULT_ITEM_VALUE_LENGTH); return checkInt(limit, 5, Integer.MAX_VALUE, DEFAULT_ITEM_VALUE_LENGTH); } public Map<Long, Integer> namespaceValueLengthLimitOverride() { String namespaceValueLengthOverrideString = getValue("namespace.value.length.limit.override"); Map<Long, Integer> namespaceValueLengthOverride = Maps.newHashMap(); if (!Strings.isNullOrEmpty(namespaceValueLengthOverrideString)) { namespaceValueLengthOverride = GSON.fromJson(namespaceValueLengthOverrideString, namespaceValueLengthOverrideTypeReference); } return namespaceValueLengthOverride; } public boolean isNamespaceLockSwitchOff() { return !getBooleanProperty("namespace.lock.switch", false); } /** * ctrip config **/ public String cloggingUrl() { return getValue("clogging.server.url"); } public String cloggingPort() { return getValue("clogging.server.port"); } public int appNamespaceCacheScanInterval() { int interval = getIntProperty("apollo.app-namespace-cache-scan.interval", DEFAULT_APPNAMESPACE_CACHE_SCAN_INTERVAL); return checkInt(interval, 1, Integer.MAX_VALUE, DEFAULT_APPNAMESPACE_CACHE_SCAN_INTERVAL); } public TimeUnit appNamespaceCacheScanIntervalTimeUnit() { return TimeUnit.SECONDS; } public int appNamespaceCacheRebuildInterval() { int interval = getIntProperty("apollo.app-namespace-cache-rebuild.interval", DEFAULT_APPNAMESPACE_CACHE_REBUILD_INTERVAL); return checkInt(interval, 1, Integer.MAX_VALUE, DEFAULT_APPNAMESPACE_CACHE_REBUILD_INTERVAL); } public TimeUnit appNamespaceCacheRebuildIntervalTimeUnit() { return TimeUnit.SECONDS; } public int accessKeyCacheScanInterval() { int interval = getIntProperty("apollo.access-key-cache-scan.interval", DEFAULT_ACCESSKEY_CACHE_SCAN_INTERVAL); return checkInt(interval, 1, Integer.MAX_VALUE, DEFAULT_ACCESSKEY_CACHE_SCAN_INTERVAL); } public TimeUnit accessKeyCacheScanIntervalTimeUnit() { return TimeUnit.SECONDS; } public int accessKeyCacheRebuildInterval() { int interval = getIntProperty("apollo.access-key-cache-rebuild.interval", DEFAULT_ACCESSKEY_CACHE_REBUILD_INTERVAL); return checkInt(interval, 1, Integer.MAX_VALUE, DEFAULT_ACCESSKEY_CACHE_REBUILD_INTERVAL); } public TimeUnit accessKeyCacheRebuildIntervalTimeUnit() { return TimeUnit.SECONDS; } public int releaseMessageCacheScanInterval() { int interval = getIntProperty("apollo.release-message-cache-scan.interval", DEFAULT_RELEASE_MESSAGE_CACHE_SCAN_INTERVAL); return checkInt(interval, 1, Integer.MAX_VALUE, DEFAULT_RELEASE_MESSAGE_CACHE_SCAN_INTERVAL); } public TimeUnit releaseMessageCacheScanIntervalTimeUnit() { return TimeUnit.SECONDS; } public int releaseMessageScanIntervalInMilli() { int interval = getIntProperty("apollo.message-scan.interval", DEFAULT_RELEASE_MESSAGE_SCAN_INTERVAL_IN_MS); return checkInt(interval, 100, Integer.MAX_VALUE, DEFAULT_RELEASE_MESSAGE_SCAN_INTERVAL_IN_MS); } public int releaseMessageNotificationBatch() { int batch = getIntProperty("apollo.release-message.notification.batch", DEFAULT_RELEASE_MESSAGE_NOTIFICATION_BATCH); return checkInt(batch, 1, Integer.MAX_VALUE, DEFAULT_RELEASE_MESSAGE_NOTIFICATION_BATCH); } public int releaseMessageNotificationBatchIntervalInMilli() { int interval = getIntProperty("apollo.release-message.notification.batch.interval", DEFAULT_RELEASE_MESSAGE_NOTIFICATION_BATCH_INTERVAL_IN_MILLI); return checkInt(interval, 10, Integer.MAX_VALUE, DEFAULT_RELEASE_MESSAGE_NOTIFICATION_BATCH_INTERVAL_IN_MILLI); } public boolean isConfigServiceCacheEnabled() { return getBooleanProperty("config-service.cache.enabled", false); } int checkInt(int value, int min, int max, int defaultValue) { if (value >= min && value <= max) { return value; } return defaultValue; } public boolean isAdminServiceAccessControlEnabled() { return getBooleanProperty("admin-service.access.control.enabled", false); } public String getAdminServiceAccessTokens() { return getValue("admin-service.access.tokens"); } }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-configservice/src/main/java/com/ctrip/framework/apollo/metaservice/service/DefaultDiscoveryService.java
package com.ctrip.framework.apollo.metaservice.service; import com.ctrip.framework.apollo.common.condition.ConditionalOnMissingProfile; import com.ctrip.framework.apollo.core.dto.ServiceDTO; import com.ctrip.framework.apollo.tracer.Tracer; import com.netflix.appinfo.InstanceInfo; import com.netflix.discovery.EurekaClient; import com.netflix.discovery.shared.Application; import java.util.Collections; import java.util.List; import java.util.function.Function; import java.util.stream.Collectors; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; /** * Default discovery service for Eureka */ @Service @ConditionalOnMissingProfile({"kubernetes", "nacos-discovery"}) public class DefaultDiscoveryService implements DiscoveryService { private final EurekaClient eurekaClient; public DefaultDiscoveryService(final EurekaClient eurekaClient) { this.eurekaClient = eurekaClient; } @Override public List<ServiceDTO> getServiceInstances(String serviceId) { Application application = eurekaClient.getApplication(serviceId); if (application == null || CollectionUtils.isEmpty(application.getInstances())) { Tracer.logEvent("Apollo.Discovery.NotFound", serviceId); return Collections.emptyList(); } return application.getInstances().stream().map(instanceInfoToServiceDTOFunc) .collect(Collectors.toList()); } private static final Function<InstanceInfo, ServiceDTO> instanceInfoToServiceDTOFunc = instance -> { ServiceDTO service = new ServiceDTO(); service.setAppName(instance.getAppName()); service.setInstanceId(instance.getInstanceId()); service.setHomepageUrl(instance.getHomePageUrl()); return service; }; }
package com.ctrip.framework.apollo.metaservice.service; import com.ctrip.framework.apollo.common.condition.ConditionalOnMissingProfile; import com.ctrip.framework.apollo.core.dto.ServiceDTO; import com.ctrip.framework.apollo.tracer.Tracer; import com.netflix.appinfo.InstanceInfo; import com.netflix.discovery.EurekaClient; import com.netflix.discovery.shared.Application; import java.util.Collections; import java.util.List; import java.util.function.Function; import java.util.stream.Collectors; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; /** * Default discovery service for Eureka */ @Service @ConditionalOnMissingProfile({"kubernetes", "nacos-discovery"}) public class DefaultDiscoveryService implements DiscoveryService { private final EurekaClient eurekaClient; public DefaultDiscoveryService(final EurekaClient eurekaClient) { this.eurekaClient = eurekaClient; } @Override public List<ServiceDTO> getServiceInstances(String serviceId) { Application application = eurekaClient.getApplication(serviceId); if (application == null || CollectionUtils.isEmpty(application.getInstances())) { Tracer.logEvent("Apollo.Discovery.NotFound", serviceId); return Collections.emptyList(); } return application.getInstances().stream().map(instanceInfoToServiceDTOFunc) .collect(Collectors.toList()); } private static final Function<InstanceInfo, ServiceDTO> instanceInfoToServiceDTOFunc = instance -> { ServiceDTO service = new ServiceDTO(); service.setAppName(instance.getAppName()); service.setInstanceId(instance.getInstanceId()); service.setHomepageUrl(instance.getHomePageUrl()); return service; }; }
-1
apolloconfig/apollo
3,534
apollo-portal-oidc
## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
vdiskg
"2021-02-03T08:48:15Z"
"2021-02-06T12:48:25Z"
b728d42c3ab71c81a913e0756c50f59346b4abc9
96c8d077ae1535cf799022cf295f670cb36267ef
apollo-portal-oidc. ## What's the purpose of this PR provide OpenID Connect login 1. to configure **application-oidc.yml** ```yaml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可 registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 更推荐使用环境变量来配置 SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 需替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri issuer-uri: https://host:port/auth/realms/apollo ``` 2. to configure **startup.sh** -Dspring.profiles.active=github,oidc
./apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/auth/ConsumerPermissionValidator.java
package com.ctrip.framework.apollo.openapi.auth; import com.ctrip.framework.apollo.openapi.service.ConsumerRolePermissionService; import com.ctrip.framework.apollo.openapi.util.ConsumerAuthUtil; import com.ctrip.framework.apollo.portal.constant.PermissionType; import com.ctrip.framework.apollo.portal.util.RoleUtils; import org.springframework.stereotype.Component; import javax.servlet.http.HttpServletRequest; @Component public class ConsumerPermissionValidator { private final ConsumerRolePermissionService permissionService; private final ConsumerAuthUtil consumerAuthUtil; public ConsumerPermissionValidator(final ConsumerRolePermissionService permissionService, final ConsumerAuthUtil consumerAuthUtil) { this.permissionService = permissionService; this.consumerAuthUtil = consumerAuthUtil; } public boolean hasModifyNamespacePermission(HttpServletRequest request, String appId, String namespaceName, String env) { if (hasCreateNamespacePermission(request, appId)) { return true; } return permissionService.consumerHasPermission(consumerAuthUtil.retrieveConsumerId(request), PermissionType.MODIFY_NAMESPACE, RoleUtils.buildNamespaceTargetId(appId, namespaceName)) || permissionService.consumerHasPermission(consumerAuthUtil.retrieveConsumerId(request), PermissionType.MODIFY_NAMESPACE, RoleUtils.buildNamespaceTargetId(appId, namespaceName, env)); } public boolean hasReleaseNamespacePermission(HttpServletRequest request, String appId, String namespaceName, String env) { if (hasCreateNamespacePermission(request, appId)) { return true; } return permissionService.consumerHasPermission(consumerAuthUtil.retrieveConsumerId(request), PermissionType.RELEASE_NAMESPACE, RoleUtils.buildNamespaceTargetId(appId, namespaceName)) || permissionService.consumerHasPermission(consumerAuthUtil.retrieveConsumerId(request), PermissionType.RELEASE_NAMESPACE, RoleUtils.buildNamespaceTargetId(appId, namespaceName, env)); } public boolean hasCreateNamespacePermission(HttpServletRequest request, String appId) { return permissionService.consumerHasPermission(consumerAuthUtil.retrieveConsumerId(request), PermissionType.CREATE_NAMESPACE, appId); } public boolean hasCreateClusterPermission(HttpServletRequest request, String appId) { return permissionService.consumerHasPermission(consumerAuthUtil.retrieveConsumerId(request), PermissionType.CREATE_CLUSTER, appId); } }
package com.ctrip.framework.apollo.openapi.auth; import com.ctrip.framework.apollo.openapi.service.ConsumerRolePermissionService; import com.ctrip.framework.apollo.openapi.util.ConsumerAuthUtil; import com.ctrip.framework.apollo.portal.constant.PermissionType; import com.ctrip.framework.apollo.portal.util.RoleUtils; import org.springframework.stereotype.Component; import javax.servlet.http.HttpServletRequest; @Component public class ConsumerPermissionValidator { private final ConsumerRolePermissionService permissionService; private final ConsumerAuthUtil consumerAuthUtil; public ConsumerPermissionValidator(final ConsumerRolePermissionService permissionService, final ConsumerAuthUtil consumerAuthUtil) { this.permissionService = permissionService; this.consumerAuthUtil = consumerAuthUtil; } public boolean hasModifyNamespacePermission(HttpServletRequest request, String appId, String namespaceName, String env) { if (hasCreateNamespacePermission(request, appId)) { return true; } return permissionService.consumerHasPermission(consumerAuthUtil.retrieveConsumerId(request), PermissionType.MODIFY_NAMESPACE, RoleUtils.buildNamespaceTargetId(appId, namespaceName)) || permissionService.consumerHasPermission(consumerAuthUtil.retrieveConsumerId(request), PermissionType.MODIFY_NAMESPACE, RoleUtils.buildNamespaceTargetId(appId, namespaceName, env)); } public boolean hasReleaseNamespacePermission(HttpServletRequest request, String appId, String namespaceName, String env) { if (hasCreateNamespacePermission(request, appId)) { return true; } return permissionService.consumerHasPermission(consumerAuthUtil.retrieveConsumerId(request), PermissionType.RELEASE_NAMESPACE, RoleUtils.buildNamespaceTargetId(appId, namespaceName)) || permissionService.consumerHasPermission(consumerAuthUtil.retrieveConsumerId(request), PermissionType.RELEASE_NAMESPACE, RoleUtils.buildNamespaceTargetId(appId, namespaceName, env)); } public boolean hasCreateNamespacePermission(HttpServletRequest request, String appId) { return permissionService.consumerHasPermission(consumerAuthUtil.retrieveConsumerId(request), PermissionType.CREATE_NAMESPACE, appId); } public boolean hasCreateClusterPermission(HttpServletRequest request, String appId) { return permissionService.consumerHasPermission(consumerAuthUtil.retrieveConsumerId(request), PermissionType.CREATE_CLUSTER, appId); } }
-1
apolloconfig/apollo
3,489
doc update
## What's the purpose of this PR add known users and adjust sidebar Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-01-10T09:40:04Z"
"2021-01-10T09:40:32Z"
dbe243dec3b56d398c0627add53b5ec2c0ac92cb
b4188031befb158dc9f3b37bcec08af3663e8522
doc update. ## What's the purpose of this PR add known users and adjust sidebar Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./README.md
<img src="https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/logo/logo-simple.png" alt="apollo-logo" width="40%"> # Apollo - A reliable configuration management system [![Build Status](https://github.com/ctripcorp/apollo/workflows/build/badge.svg)](https://github.com/ctripcorp/apollo/actions) [![GitHub Release](https://img.shields.io/github/release/ctripcorp/apollo.svg)](https://github.com/ctripcorp/apollo/releases) [![Maven Central Repo](https://img.shields.io/maven-central/v/com.ctrip.framework.apollo/apollo.svg)](https://mvnrepository.com/artifact/com.ctrip.framework.apollo/apollo-client) [![codecov.io](https://codecov.io/github/ctripcorp/apollo/coverage.svg?branch=master)](https://codecov.io/github/ctripcorp/apollo?branch=master) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) Apollo(阿波罗)是携程框架部门研发的分布式配置中心,能够集中化管理应用不同环境、不同集群的配置,配置修改后能够实时推送到应用端,并且具备规范的权限、流程治理等特性,适用于微服务配置管理场景。 服务端基于Spring Boot和Spring Cloud开发,打包后可以直接运行,不需要额外安装Tomcat等应用容器。 Java客户端不依赖任何框架,能够运行于所有Java运行时环境,同时对Spring/Spring Boot环境也有较好的支持。 .Net客户端不依赖任何框架,能够运行于所有.Net运行时环境。 更多产品介绍参见[Apollo配置中心介绍](https://ctripcorp.github.io/apollo/#/zh/design/apollo-introduction) 本地快速部署请参见[Quick Start](https://ctripcorp.github.io/apollo/#/zh/deployment/quick-start) 演示环境(Demo): - [106.54.227.205](http://106.54.227.205/) - 账号/密码:apollo/admin > 如访问github速度缓慢,可以访问[gitee镜像](https://gitee.com/nobodyiam/apollo),不定期同步 # Screenshots ![配置界面](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-home-screenshot.jpg) # Features * **统一管理不同环境、不同集群的配置** * Apollo提供了一个统一界面集中式管理不同环境(environment)、不同集群(cluster)、不同命名空间(namespace)的配置。 * 同一份代码部署在不同的集群,可以有不同的配置,比如zk的地址等 * 通过命名空间(namespace)可以很方便的支持多个不同应用共享同一份配置,同时还允许应用对共享的配置进行覆盖 * 配置界面支持多语言(中文,English) * **配置修改实时生效(热发布)** * 用户在Apollo修改完配置并发布后,客户端能实时(1秒)接收到最新的配置,并通知到应用程序。 * **版本发布管理** * 所有的配置发布都有版本概念,从而可以方便的支持配置的回滚。 * **灰度发布** * 支持配置的灰度发布,比如点了发布后,只对部分应用实例生效,等观察一段时间没问题后再推给所有应用实例。 * **权限管理、发布审核、操作审计** * 应用和配置的管理都有完善的权限管理机制,对配置的管理还分为了编辑和发布两个环节,从而减少人为的错误。 * 所有的操作都有审计日志,可以方便的追踪问题。 * **客户端配置信息监控** * 可以方便的看到配置在被哪些实例使用 * **提供Java和.Net原生客户端** * 提供了Java和.Net的原生客户端,方便应用集成 * 支持Spring Placeholder,Annotation和Spring Boot的ConfigurationProperties,方便应用使用(需要Spring 3.1.1+) * 同时提供了Http接口,非Java和.Net应用也可以方便的使用 * **提供开放平台API** * Apollo自身提供了比较完善的统一配置管理界面,支持多环境、多数据中心配置管理、权限、流程治理等特性。 * 不过Apollo出于通用性考虑,对配置的修改不会做过多限制,只要符合基本的格式就能够保存。 * 在我们的调研中发现,对于有些使用方,它们的配置可能会有比较复杂的格式,如xml, json,需要对格式做校验。 * 还有一些使用方如DAL,不仅有特定的格式,而且对输入的值也需要进行校验后方可保存,如检查数据库、用户名和密码是否匹配。 * 对于这类应用,Apollo支持应用方通过开放接口在Apollo进行配置的修改和发布,并且具备完善的授权和权限控制 * **部署简单** * 配置中心作为基础服务,可用性要求非常高,这就要求Apollo对外部依赖尽可能地少 * 目前唯一的外部依赖是MySQL,所以部署非常简单,只要安装好Java和MySQL就可以让Apollo跑起来 * Apollo还提供了打包脚本,一键就可以生成所有需要的安装包,并且支持自定义运行时参数 # Usage 1. [应用接入指南](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-user-guide) 2. [Java客户端使用指南](https://ctripcorp.github.io/apollo/#/zh/usage/java-sdk-user-guide) 3. [.Net客户端使用指南](https://ctripcorp.github.io/apollo/#/zh/usage/dotnet-sdk-user-guide) 4. [其它语言客户端接入指南](https://ctripcorp.github.io/apollo/#/zh/usage/other-language-client-user-guide) 5. [Apollo开放平台接入指南](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-open-api-platform) 6. [Apollo使用场景和示例代码](https://github.com/ctripcorp/apollo-use-cases) 7. [Apollo实践案例](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-user-practices) 8. [Apollo安全相关最佳实践](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-user-guide?id=_71-%e5%ae%89%e5%85%a8%e7%9b%b8%e5%85%b3) # Design * [Apollo配置中心设计](https://ctripcorp.github.io/apollo/#/zh/design/apollo-design) * [Apollo核心概念之“Namespace”](https://ctripcorp.github.io/apollo/#/zh/design/apollo-core-concept-namespace) * [Apollo配置中心架构剖析](https://mp.weixin.qq.com/s/-hUaQPzfsl9Lm3IqQW3VDQ) * [Apollo源码解析](http://www.iocoder.cn/categories/Apollo/)(据说Apollo非常适合作为初学者第一个通读源码学习的分布式中间件产品) # Development * [Apollo开发指南](https://ctripcorp.github.io/apollo/#/zh/development/apollo-development-guide) * Code Styles * [Eclipse Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/eclipse-java-google-style.xml) * [Intellij Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/intellij-java-google-style.xml) # Deployment * [Quick Start](https://ctripcorp.github.io/apollo/#/zh/deployment/quick-start) * [分布式部署指南](https://ctripcorp.github.io/apollo/#/zh/deployment/distributed-deployment-guide) # Release Notes * [版本发布历史](https://github.com/ctripcorp/apollo/releases) # FAQ * [常见问题回答](https://ctripcorp.github.io/apollo/#/zh/faq/faq) * [部署&开发遇到的常见问题](https://ctripcorp.github.io/apollo/#/zh/faq/common-issues-in-deployment-and-development-phase) # Presentation * [携程开源配置中心Apollo的设计与实现](http://www.itdks.com/dakalive/detail/3420) * [Slides](https://myslide.cn/slides/10168) * [配置中心,让微服务更『智能』](https://2018.qconshanghai.com/presentation/799) * [Slides](https://myslide.cn/slides/10035) # Publication * [开源配置中心Apollo的设计与实现](https://www.infoq.cn/article/open-source-configuration-center-apollo) * [配置中心,让微服务更『智能』](https://mp.weixin.qq.com/s/iDmYJre_ULEIxuliu1EbIQ) # Support <table> <thead> <th>Apollo技术支持⑤群<br />群号:914839843(未满)</th> <th>Apollo技术支持②群<br />群号:904287263(未满)</th> <th>Apollo技术支持④群<br />群号:516773934(已满)</th> <th>Apollo技术支持③群<br />群号:742035428(已满)</th> <th>Apollo技术支持①群<br />群号:375526581(已满)</th> </thead> <tbody> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-5.png" alt="tech-support-qq-5"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-2.png" alt="tech-support-qq-2"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-4.png" alt="tech-support-qq-4"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-3.png" alt="tech-support-qq-3"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-1.png" alt="tech-support-qq-1"></td> </tr> </tbody> </table> # Contribution Please make sure to read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making a pull request. Thanks for all the people who contributed to Apollo! <a href="https://github.com/ctripcorp/apollo/graphs/contributors"><img src="https://opencollective.com/apollo/contributors.svg?width=880&button=false" /></a> # License The project is licensed under the [Apache 2 license](https://github.com/ctripcorp/apollo/blob/master/LICENSE). # Known Users > 按照登记顺序排序,更多接入公司,欢迎在[https://github.com/ctripcorp/apollo/issues/451](https://github.com/ctripcorp/apollo/issues/451)登记(仅供开源用户参考) <table> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ctrip.png" alt="携程"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bluestone.png" alt="青石证券"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sagreen.png" alt="沙绿"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/umetrip.jpg" alt="航旅纵横"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhuanzhuan.png" alt="58转转"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/phone580.png" alt="蜂助手"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hainan-airlines.png" alt="海南航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cvte.png" alt="CVTE"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mainbo.jpg" alt="明博教育"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/madailicai.png" alt="麻袋理财"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mxnavi.jpg" alt="美行科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fshows.jpg" alt="首展科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/feezu.png" alt="易微行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rencaijia.png" alt="人才加"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/keking.png" alt="凯京集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/leoao.png" alt="乐刻运动"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dji.png" alt="大疆"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kkmh.png" alt="快看漫画"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wolaidai.png" alt="我来贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xsrj.png" alt="虚实软件"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yanxuan.png" alt="网易严选"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sjzg.png" alt="视觉中国"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zc360.png" alt="资产360"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ecarx.png" alt="亿咖通"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/5173.png" alt="5173"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hujiang.png" alt="沪江"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/163yun.png" alt="网易云基础服务"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cash-bus.png" alt="现金巴士"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/smartisan.png" alt="锤子科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/toodc.png" alt="头等仓"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/juneyaoair.png" alt="吉祥航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/263mobile.png" alt="263移动通信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/toutoujinrong.png" alt="投投金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mytijian.png" alt="每天健康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maiyabank.png" alt="麦芽金服"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fengunion.png" alt="蜂向科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/geex-logo.png" alt="即科金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beike.png" alt="贝壳网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/youzan.png" alt="有赞"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunjihuitong.png" alt="云集汇通"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rhinotech.png" alt="犀牛瀚海科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/nxin.png" alt="农信互联"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mgzf.png" alt="蘑菇租房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/huli-logo.png" alt="狐狸金服"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mandao.png" alt="漫道集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enmonster.png" alt="怪兽充电"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/nanguazufang.png" alt="南瓜租房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shitoujinrong.png" alt="石投金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tubatu.png" alt="土巴兔"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/payh_logo.png" alt="平安银行"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xinxindai.png" alt="新新贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chrtc.png" alt="中国华戎科技集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tuya_logo.png" alt="涂鸦智能"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/szlcsc.jpg" alt="立创商城"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hairongyi.png" alt="乐赚金服"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kxqc.png" alt="开心汽车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ppcredit.png" alt="乐赚金服"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/primeton.png" alt="普元信息"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hoskeeper.png" alt="医帮管家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fula.png" alt="付啦信用卡管家"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uzai.png" alt="悠哉网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/91wutong.png" alt="梧桐诚选"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ppdai.png" alt="拍拍贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xinyongfei.png" alt="信用飞"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dxy.png" alt="丁香园"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ghtech.png" alt="国槐科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/qbb.png" alt="亲宝宝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/huawei_logo.png" alt="华为视频直播"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/weiboyi.png" alt="微播易"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ofpay.png" alt="欧飞"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mishuo.png" alt="迷说"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yixia.png" alt="一下科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daocloud.png" alt="DaoCloud"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cnvex.png" alt="汽摩交易所"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/100tal.png" alt="好未来教育集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ainirobot.png" alt="猎户星空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhuojian.png" alt="卓健科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enjoyor.png" alt="银江股份"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tuhu.png" alt="途虎养车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/homedo.png" alt="河姆渡"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xwbank.png" alt="新网银行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ctspcl.png" alt="中旅安信云贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meiyou.png" alt="美柚"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zkh-logo.png" alt="震坤行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wgss.png" alt="万谷盛世"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/plateno.png" alt="铂涛旅行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lifesense.png" alt="乐心"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/reachmedia.png" alt="亿投传媒"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/guxiansheng.png" alt="股先生"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caixuetang.png" alt="财学堂"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/4399.png" alt="4399"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/autohome.png" alt="汽车之家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mbcaijing.png" alt="面包财经"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hoopchina.png" alt="虎扑"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sohu-auto.png" alt="搜狐汽车"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/liangfuzhengxin.png" alt="量富征信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maihaoche.png" alt="卖好车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zyiot.jpg" alt="中移物联网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/biauto.png" alt="易车网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maiyaole.png" alt="一药网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaoying.png" alt="小影"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caibeike.png" alt="彩贝壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yeelight.png" alt="YEELIGHT"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/itsgmu.png" alt="积目"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/acmedcare.png" alt="极致医疗"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinhui365.png" alt="金汇金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/900etrip.png" alt="久柏易游"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/24xiaomai.png" alt="小麦铺"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/vvic.png" alt="搜款网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mizlicai.png" alt="米庄理财"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bjt.png" alt="贝吉塔网络科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/weimob.png" alt="微盟"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kada.png" alt="网易卡搭"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kapbook.png" alt="股书"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jumore.png" alt="聚贸"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bimface.png" alt="广联达bimface"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/globalgrow.png" alt="环球易购"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jollychic.png" alt="浙江执御"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/2dfire.jpg" alt="二维火"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shopin.png" alt="上品"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/inspur.png" alt="浪潮集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ngarihealth.png" alt="纳里健康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/oraro.png" alt="橙红科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dragonpass.png" alt="龙腾出行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lizhi.fm.png" alt="荔枝"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/htd.png" alt="汇通达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunrong.png" alt="云融金科"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tszg360.png" alt="天生掌柜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rongplus.png" alt="容联光辉"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/intellif.png" alt="云天励飞"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jiayundata.png" alt="嘉云数据"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zts.png" alt="中泰证券网络金融部"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/163dun.png" alt="网易易盾"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiangwushuo.png" alt="享物说"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sto.png" alt="申通"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinhe.png" alt="金和网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/2345.png" alt="二三四五"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chtwm.jpg" alt="恒天财富"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uweixin.png" alt="沐雪微信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wzeye.png" alt="温州医科大学附属眼视光医院"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/10010pay.png" alt="联通支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shanshu.png" alt="杉数科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fenlibao.png" alt="分利宝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hetao101.png" alt="核桃编程"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaohongshu.png" alt="小红书"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/blissmall.png" alt="幸福西饼"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ky-express.png" alt="跨越速运"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/oyohotels.png" alt="OYO"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/100-me.png" alt="叮咚买菜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhidaohulian.jpg" alt="智道网联"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xueqiu.jpg" alt="雪球"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/autocloudpro.png" alt="车通云"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dadaabc.png" alt="哒哒英语"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xedaojia.jpg" alt="小E微店"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daling.png" alt="达令家"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/renliwo.png" alt="人力窝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mocire.jpg" alt="嘉美在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uepay.png" alt="极易付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wdom.png" alt="智慧开源"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cheshiku.png" alt="车仕库"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/taimeitech.png" alt="太美医疗科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yilianbaihui.png" alt="亿联百汇"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhoupu123.png" alt="舟谱数据"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/frxs.png" alt="芙蓉兴盛"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beastshop.png" alt="野兽派"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kaishustory.png" alt="凯叔讲故事"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/haodf.png" alt="好大夫在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/insyunmi.png" alt="云幂信息技术"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/duiba.png" alt="兑吧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/9ji.png" alt="九机网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sui.png" alt="随手科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/aixiangdao.png" alt="万谷盛世"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunzhangfang.png" alt="云账房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yuantutech.png" alt="浙江远图互联"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/qk365.png" alt="青客公寓"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/eastmoney.png" alt="东方财富"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jikexiu.png" alt="极客修"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meix.png" alt="美市科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zto.png" alt="中通快递"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/e6yun.png" alt="易流科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaoyuanzhao.png" alt="实习僧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dalingjia.png" alt="达令家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/secoo.png" alt="寺库"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lianlianpay.png" alt="连连支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhongan.png" alt="众安保险"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/360jinrong.png" alt="360金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caschina.png" alt="中航服商旅"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ke.png" alt="贝壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yeahmobi.png" alt="Yeahmobi易点天下"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/idengyun.png" alt="北京登云美业网络科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinher.png" alt="金和网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/komect.png" alt="中移(杭州)信息技术有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beisen.png" alt="北森"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/log56.png" alt="合肥维天运通"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meboth.png" alt="北京蜜步科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/postop.png" alt="术康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rfchina.png" alt="富力集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tfxing.png" alt="天府行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/8travelpay.png" alt="八商山"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/centaline.png" alt="中原地产"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zkyda.png" alt="智科云达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/house730.png" alt="中原730"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/pagoda.png" alt="百果园"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bolome.png" alt="波罗蜜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xignite.png" alt="Xignite"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/aduer.png" alt="杭州有云科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jojoreading.png" alt="成都书声科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sweetome.png" alt="斯维登集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/vipthink.png" alt="广东快乐种子科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tongxuecool.png" alt="上海盈翼文化传播有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sccfc.png" alt="上海尚诚消费金融股份有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ziroom.png" alt="自如网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jd.png" alt="京东"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rabbitpre.png" alt="兔展智能"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhubei.png" alt="竹贝"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/imile.png" alt="iMile(中东)"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/helloglobal.png" alt="哈罗出行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhaopin.png" alt="智联招聘"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/acadsoc.png" alt="阿卡索"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mojory.png" alt="妙知旅"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chengduoduo.png" alt="程多多"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/baojunev.png" alt="上汽通用五菱"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/leyan.png" alt="乐言科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dushu.png" alt="樊登读书"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zyiz.png" alt="找一找教程网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bppc.png" alt="中油碧辟石油有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shanglv51.png" alt="四川商旅无忧科技服务有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/waijiao365.png" alt="懿鸢网络科技(上海)有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gaoding.jpg" alt="稿定科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ricacorp.png" alt="搵樓 - 利嘉閣"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/t3go.png" alt="南京领行科技股份有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mokahr.jpg" alt="北京希瑞亚斯科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/printrainbow.png" alt="印彩虹印刷公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/milliontech.png" alt="Million Tech"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/guoguokeji.jpg" alt="果果科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/airkunming.png" alt="昆明航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/5i5j.png" alt="我爱我家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gjzq.png" alt="国金证券"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enjoymusic.jpg" alt="不亦乐乎"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cnhnb.png" alt="惠农网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daoklab.jpg" alt="成都道壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ausnutria.jpg" alt="澳优乳业"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/deiyoudian.png" alt="河南有态度信息科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ezhiyang.png" alt="智阳第一人力"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shie.png" alt="上海保险交易所"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wsecar.png" alt="万顺叫车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shouqinba.jpg" alt="收钱吧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/baozun.png" alt="宝尊电商"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xbnwl.png" alt="喜百年供应链"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gwwisdom.png" alt="南京观为智慧软件科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ztrip.png" alt="在途商旅"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hualala.png" alt="哗啦啦"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xin.png" alt="优信二手车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maycur.png" alt="每刻科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bullyun.png" alt="杭州蛮牛"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bestpay.png" alt="翼支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mockuai.png" alt="魔筷科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ct108.png" alt="畅唐网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jusdaglobal.jpg" alt="准时达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/izaodao.png" alt="早道网校"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ovopark.jpg" alt="万店掌"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/funstory.jpg" alt="推文科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lemonbox.png" alt="Lemonbox"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/polyt.png" alt="保利票务"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chipwing.png" alt="芯翼科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/czbank.png" alt="浙商银行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/czbyqy.png" alt="易企银科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yundun.jpg" alt="上海云盾"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gaiaworks.jpg" alt="苏州盖雅信息技术有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mengxiang.png" alt="爱库存"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jidouauto.png" alt="极豆车联网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ipalfish.png" alt="伴鱼少儿英语"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/iqboard.png" alt="锐达科技"></td> </tr> </table> # Awards <img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/awards/oschina-2018-award.jpg" width="240px" alt="2018 年度最受欢迎中国开源软件"> # Stargazers over time [![Stargazers over time](https://starcharts.herokuapp.com/ctripcorp/apollo.svg)](https://starcharts.herokuapp.com/ctripcorp/apollo)
<img src="https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/logo/logo-simple.png" alt="apollo-logo" width="40%"> # Apollo - A reliable configuration management system [![Build Status](https://github.com/ctripcorp/apollo/workflows/build/badge.svg)](https://github.com/ctripcorp/apollo/actions) [![GitHub Release](https://img.shields.io/github/release/ctripcorp/apollo.svg)](https://github.com/ctripcorp/apollo/releases) [![Maven Central Repo](https://img.shields.io/maven-central/v/com.ctrip.framework.apollo/apollo.svg)](https://mvnrepository.com/artifact/com.ctrip.framework.apollo/apollo-client) [![codecov.io](https://codecov.io/github/ctripcorp/apollo/coverage.svg?branch=master)](https://codecov.io/github/ctripcorp/apollo?branch=master) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) Apollo(阿波罗)是携程框架部门研发的分布式配置中心,能够集中化管理应用不同环境、不同集群的配置,配置修改后能够实时推送到应用端,并且具备规范的权限、流程治理等特性,适用于微服务配置管理场景。 服务端基于Spring Boot和Spring Cloud开发,打包后可以直接运行,不需要额外安装Tomcat等应用容器。 Java客户端不依赖任何框架,能够运行于所有Java运行时环境,同时对Spring/Spring Boot环境也有较好的支持。 .Net客户端不依赖任何框架,能够运行于所有.Net运行时环境。 更多产品介绍参见[Apollo配置中心介绍](https://ctripcorp.github.io/apollo/#/zh/design/apollo-introduction) 本地快速部署请参见[Quick Start](https://ctripcorp.github.io/apollo/#/zh/deployment/quick-start) 演示环境(Demo): - [106.54.227.205](http://106.54.227.205/) - 账号/密码:apollo/admin > 如访问github速度缓慢,可以访问[gitee镜像](https://gitee.com/nobodyiam/apollo),不定期同步 # Screenshots ![配置界面](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-home-screenshot.jpg) # Features * **统一管理不同环境、不同集群的配置** * Apollo提供了一个统一界面集中式管理不同环境(environment)、不同集群(cluster)、不同命名空间(namespace)的配置。 * 同一份代码部署在不同的集群,可以有不同的配置,比如zk的地址等 * 通过命名空间(namespace)可以很方便的支持多个不同应用共享同一份配置,同时还允许应用对共享的配置进行覆盖 * 配置界面支持多语言(中文,English) * **配置修改实时生效(热发布)** * 用户在Apollo修改完配置并发布后,客户端能实时(1秒)接收到最新的配置,并通知到应用程序。 * **版本发布管理** * 所有的配置发布都有版本概念,从而可以方便的支持配置的回滚。 * **灰度发布** * 支持配置的灰度发布,比如点了发布后,只对部分应用实例生效,等观察一段时间没问题后再推给所有应用实例。 * **权限管理、发布审核、操作审计** * 应用和配置的管理都有完善的权限管理机制,对配置的管理还分为了编辑和发布两个环节,从而减少人为的错误。 * 所有的操作都有审计日志,可以方便的追踪问题。 * **客户端配置信息监控** * 可以方便的看到配置在被哪些实例使用 * **提供Java和.Net原生客户端** * 提供了Java和.Net的原生客户端,方便应用集成 * 支持Spring Placeholder,Annotation和Spring Boot的ConfigurationProperties,方便应用使用(需要Spring 3.1.1+) * 同时提供了Http接口,非Java和.Net应用也可以方便的使用 * **提供开放平台API** * Apollo自身提供了比较完善的统一配置管理界面,支持多环境、多数据中心配置管理、权限、流程治理等特性。 * 不过Apollo出于通用性考虑,对配置的修改不会做过多限制,只要符合基本的格式就能够保存。 * 在我们的调研中发现,对于有些使用方,它们的配置可能会有比较复杂的格式,如xml, json,需要对格式做校验。 * 还有一些使用方如DAL,不仅有特定的格式,而且对输入的值也需要进行校验后方可保存,如检查数据库、用户名和密码是否匹配。 * 对于这类应用,Apollo支持应用方通过开放接口在Apollo进行配置的修改和发布,并且具备完善的授权和权限控制 * **部署简单** * 配置中心作为基础服务,可用性要求非常高,这就要求Apollo对外部依赖尽可能地少 * 目前唯一的外部依赖是MySQL,所以部署非常简单,只要安装好Java和MySQL就可以让Apollo跑起来 * Apollo还提供了打包脚本,一键就可以生成所有需要的安装包,并且支持自定义运行时参数 # Usage 1. [应用接入指南](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-user-guide) 2. [Java客户端使用指南](https://ctripcorp.github.io/apollo/#/zh/usage/java-sdk-user-guide) 3. [.Net客户端使用指南](https://ctripcorp.github.io/apollo/#/zh/usage/dotnet-sdk-user-guide) 4. [其它语言客户端接入指南](https://ctripcorp.github.io/apollo/#/zh/usage/other-language-client-user-guide) 5. [Apollo开放平台接入指南](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-open-api-platform) 6. [Apollo使用场景和示例代码](https://github.com/ctripcorp/apollo-use-cases) 7. [Apollo实践案例](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-user-practices) 8. [Apollo安全相关最佳实践](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-user-guide?id=_71-%e5%ae%89%e5%85%a8%e7%9b%b8%e5%85%b3) # Design * [Apollo配置中心设计](https://ctripcorp.github.io/apollo/#/zh/design/apollo-design) * [Apollo核心概念之“Namespace”](https://ctripcorp.github.io/apollo/#/zh/design/apollo-core-concept-namespace) * [Apollo配置中心架构剖析](https://mp.weixin.qq.com/s/-hUaQPzfsl9Lm3IqQW3VDQ) * [Apollo源码解析](http://www.iocoder.cn/categories/Apollo/)(据说Apollo非常适合作为初学者第一个通读源码学习的分布式中间件产品) # Development * [Apollo开发指南](https://ctripcorp.github.io/apollo/#/zh/development/apollo-development-guide) * Code Styles * [Eclipse Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/eclipse-java-google-style.xml) * [Intellij Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/intellij-java-google-style.xml) # Deployment * [Quick Start](https://ctripcorp.github.io/apollo/#/zh/deployment/quick-start) * [分布式部署指南](https://ctripcorp.github.io/apollo/#/zh/deployment/distributed-deployment-guide) # Release Notes * [版本发布历史](https://github.com/ctripcorp/apollo/releases) # FAQ * [常见问题回答](https://ctripcorp.github.io/apollo/#/zh/faq/faq) * [部署&开发遇到的常见问题](https://ctripcorp.github.io/apollo/#/zh/faq/common-issues-in-deployment-and-development-phase) # Presentation * [携程开源配置中心Apollo的设计与实现](http://www.itdks.com/dakalive/detail/3420) * [Slides](https://myslide.cn/slides/10168) * [配置中心,让微服务更『智能』](https://2018.qconshanghai.com/presentation/799) * [Slides](https://myslide.cn/slides/10035) # Publication * [开源配置中心Apollo的设计与实现](https://www.infoq.cn/article/open-source-configuration-center-apollo) * [配置中心,让微服务更『智能』](https://mp.weixin.qq.com/s/iDmYJre_ULEIxuliu1EbIQ) # Support <table> <thead> <th>Apollo技术支持②群<br />群号:904287263(未满)</th> <th>Apollo技术支持⑤群<br />群号:914839843(已满)</th> <th>Apollo技术支持④群<br />群号:516773934(已满)</th> <th>Apollo技术支持③群<br />群号:742035428(已满)</th> <th>Apollo技术支持①群<br />群号:375526581(已满)</th> </thead> <tbody> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-2.png" alt="tech-support-qq-2"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-5.png" alt="tech-support-qq-5"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-4.png" alt="tech-support-qq-4"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-3.png" alt="tech-support-qq-3"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-1.png" alt="tech-support-qq-1"></td> </tr> </tbody> </table> # Contribution Please make sure to read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making a pull request. Thanks for all the people who contributed to Apollo! <a href="https://github.com/ctripcorp/apollo/graphs/contributors"><img src="https://opencollective.com/apollo/contributors.svg?width=880&button=false" /></a> # License The project is licensed under the [Apache 2 license](https://github.com/ctripcorp/apollo/blob/master/LICENSE). # Known Users > 按照登记顺序排序,更多接入公司,欢迎在[https://github.com/ctripcorp/apollo/issues/451](https://github.com/ctripcorp/apollo/issues/451)登记(仅供开源用户参考) <table> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ctrip.png" alt="携程"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bluestone.png" alt="青石证券"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sagreen.png" alt="沙绿"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/umetrip.jpg" alt="航旅纵横"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhuanzhuan.png" alt="58转转"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/phone580.png" alt="蜂助手"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hainan-airlines.png" alt="海南航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cvte.png" alt="CVTE"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mainbo.jpg" alt="明博教育"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/madailicai.png" alt="麻袋理财"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mxnavi.jpg" alt="美行科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fshows.jpg" alt="首展科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/feezu.png" alt="易微行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rencaijia.png" alt="人才加"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/keking.png" alt="凯京集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/leoao.png" alt="乐刻运动"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dji.png" alt="大疆"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kkmh.png" alt="快看漫画"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wolaidai.png" alt="我来贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xsrj.png" alt="虚实软件"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yanxuan.png" alt="网易严选"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sjzg.png" alt="视觉中国"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zc360.png" alt="资产360"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ecarx.png" alt="亿咖通"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/5173.png" alt="5173"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hujiang.png" alt="沪江"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/163yun.png" alt="网易云基础服务"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cash-bus.png" alt="现金巴士"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/smartisan.png" alt="锤子科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/toodc.png" alt="头等仓"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/juneyaoair.png" alt="吉祥航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/263mobile.png" alt="263移动通信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/toutoujinrong.png" alt="投投金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mytijian.png" alt="每天健康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maiyabank.png" alt="麦芽金服"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fengunion.png" alt="蜂向科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/geex-logo.png" alt="即科金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beike.png" alt="贝壳网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/youzan.png" alt="有赞"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunjihuitong.png" alt="云集汇通"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rhinotech.png" alt="犀牛瀚海科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/nxin.png" alt="农信互联"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mgzf.png" alt="蘑菇租房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/huli-logo.png" alt="狐狸金服"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mandao.png" alt="漫道集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enmonster.png" alt="怪兽充电"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/nanguazufang.png" alt="南瓜租房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shitoujinrong.png" alt="石投金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tubatu.png" alt="土巴兔"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/payh_logo.png" alt="平安银行"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xinxindai.png" alt="新新贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chrtc.png" alt="中国华戎科技集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tuya_logo.png" alt="涂鸦智能"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/szlcsc.jpg" alt="立创商城"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hairongyi.png" alt="乐赚金服"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kxqc.png" alt="开心汽车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ppcredit.png" alt="乐赚金服"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/primeton.png" alt="普元信息"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hoskeeper.png" alt="医帮管家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fula.png" alt="付啦信用卡管家"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uzai.png" alt="悠哉网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/91wutong.png" alt="梧桐诚选"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ppdai.png" alt="拍拍贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xinyongfei.png" alt="信用飞"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dxy.png" alt="丁香园"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ghtech.png" alt="国槐科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/qbb.png" alt="亲宝宝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/huawei_logo.png" alt="华为视频直播"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/weiboyi.png" alt="微播易"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ofpay.png" alt="欧飞"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mishuo.png" alt="迷说"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yixia.png" alt="一下科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daocloud.png" alt="DaoCloud"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cnvex.png" alt="汽摩交易所"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/100tal.png" alt="好未来教育集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ainirobot.png" alt="猎户星空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhuojian.png" alt="卓健科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enjoyor.png" alt="银江股份"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tuhu.png" alt="途虎养车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/homedo.png" alt="河姆渡"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xwbank.png" alt="新网银行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ctspcl.png" alt="中旅安信云贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meiyou.png" alt="美柚"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zkh-logo.png" alt="震坤行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wgss.png" alt="万谷盛世"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/plateno.png" alt="铂涛旅行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lifesense.png" alt="乐心"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/reachmedia.png" alt="亿投传媒"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/guxiansheng.png" alt="股先生"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caixuetang.png" alt="财学堂"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/4399.png" alt="4399"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/autohome.png" alt="汽车之家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mbcaijing.png" alt="面包财经"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hoopchina.png" alt="虎扑"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sohu-auto.png" alt="搜狐汽车"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/liangfuzhengxin.png" alt="量富征信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maihaoche.png" alt="卖好车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zyiot.jpg" alt="中移物联网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/biauto.png" alt="易车网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maiyaole.png" alt="一药网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaoying.png" alt="小影"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caibeike.png" alt="彩贝壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yeelight.png" alt="YEELIGHT"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/itsgmu.png" alt="积目"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/acmedcare.png" alt="极致医疗"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinhui365.png" alt="金汇金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/900etrip.png" alt="久柏易游"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/24xiaomai.png" alt="小麦铺"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/vvic.png" alt="搜款网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mizlicai.png" alt="米庄理财"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bjt.png" alt="贝吉塔网络科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/weimob.png" alt="微盟"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kada.png" alt="网易卡搭"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kapbook.png" alt="股书"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jumore.png" alt="聚贸"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bimface.png" alt="广联达bimface"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/globalgrow.png" alt="环球易购"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jollychic.png" alt="浙江执御"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/2dfire.jpg" alt="二维火"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shopin.png" alt="上品"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/inspur.png" alt="浪潮集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ngarihealth.png" alt="纳里健康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/oraro.png" alt="橙红科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dragonpass.png" alt="龙腾出行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lizhi.fm.png" alt="荔枝"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/htd.png" alt="汇通达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunrong.png" alt="云融金科"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tszg360.png" alt="天生掌柜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rongplus.png" alt="容联光辉"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/intellif.png" alt="云天励飞"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jiayundata.png" alt="嘉云数据"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zts.png" alt="中泰证券网络金融部"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/163dun.png" alt="网易易盾"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiangwushuo.png" alt="享物说"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sto.png" alt="申通"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinhe.png" alt="金和网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/2345.png" alt="二三四五"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chtwm.jpg" alt="恒天财富"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uweixin.png" alt="沐雪微信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wzeye.png" alt="温州医科大学附属眼视光医院"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/10010pay.png" alt="联通支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shanshu.png" alt="杉数科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fenlibao.png" alt="分利宝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hetao101.png" alt="核桃编程"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaohongshu.png" alt="小红书"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/blissmall.png" alt="幸福西饼"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ky-express.png" alt="跨越速运"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/oyohotels.png" alt="OYO"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/100-me.png" alt="叮咚买菜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhidaohulian.jpg" alt="智道网联"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xueqiu.jpg" alt="雪球"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/autocloudpro.png" alt="车通云"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dadaabc.png" alt="哒哒英语"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xedaojia.jpg" alt="小E微店"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daling.png" alt="达令家"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/renliwo.png" alt="人力窝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mocire.jpg" alt="嘉美在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uepay.png" alt="极易付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wdom.png" alt="智慧开源"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cheshiku.png" alt="车仕库"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/taimeitech.png" alt="太美医疗科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yilianbaihui.png" alt="亿联百汇"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhoupu123.png" alt="舟谱数据"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/frxs.png" alt="芙蓉兴盛"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beastshop.png" alt="野兽派"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kaishustory.png" alt="凯叔讲故事"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/haodf.png" alt="好大夫在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/insyunmi.png" alt="云幂信息技术"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/duiba.png" alt="兑吧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/9ji.png" alt="九机网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sui.png" alt="随手科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/aixiangdao.png" alt="万谷盛世"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunzhangfang.png" alt="云账房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yuantutech.png" alt="浙江远图互联"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/qk365.png" alt="青客公寓"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/eastmoney.png" alt="东方财富"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jikexiu.png" alt="极客修"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meix.png" alt="美市科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zto.png" alt="中通快递"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/e6yun.png" alt="易流科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaoyuanzhao.png" alt="实习僧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dalingjia.png" alt="达令家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/secoo.png" alt="寺库"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lianlianpay.png" alt="连连支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhongan.png" alt="众安保险"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/360jinrong.png" alt="360金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caschina.png" alt="中航服商旅"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ke.png" alt="贝壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yeahmobi.png" alt="Yeahmobi易点天下"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/idengyun.png" alt="北京登云美业网络科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinher.png" alt="金和网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/komect.png" alt="中移(杭州)信息技术有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beisen.png" alt="北森"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/log56.png" alt="合肥维天运通"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meboth.png" alt="北京蜜步科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/postop.png" alt="术康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rfchina.png" alt="富力集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tfxing.png" alt="天府行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/8travelpay.png" alt="八商山"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/centaline.png" alt="中原地产"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zkyda.png" alt="智科云达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/house730.png" alt="中原730"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/pagoda.png" alt="百果园"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bolome.png" alt="波罗蜜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xignite.png" alt="Xignite"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/aduer.png" alt="杭州有云科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jojoreading.png" alt="成都书声科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sweetome.png" alt="斯维登集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/vipthink.png" alt="广东快乐种子科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tongxuecool.png" alt="上海盈翼文化传播有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sccfc.png" alt="上海尚诚消费金融股份有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ziroom.png" alt="自如网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jd.png" alt="京东"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rabbitpre.png" alt="兔展智能"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhubei.png" alt="竹贝"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/imile.png" alt="iMile(中东)"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/helloglobal.png" alt="哈罗出行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhaopin.png" alt="智联招聘"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/acadsoc.png" alt="阿卡索"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mojory.png" alt="妙知旅"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chengduoduo.png" alt="程多多"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/baojunev.png" alt="上汽通用五菱"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/leyan.png" alt="乐言科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dushu.png" alt="樊登读书"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zyiz.png" alt="找一找教程网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bppc.png" alt="中油碧辟石油有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shanglv51.png" alt="四川商旅无忧科技服务有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/waijiao365.png" alt="懿鸢网络科技(上海)有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gaoding.jpg" alt="稿定科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ricacorp.png" alt="搵樓 - 利嘉閣"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/t3go.png" alt="南京领行科技股份有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mokahr.jpg" alt="北京希瑞亚斯科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/printrainbow.png" alt="印彩虹印刷公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/milliontech.png" alt="Million Tech"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/guoguokeji.jpg" alt="果果科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/airkunming.png" alt="昆明航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/5i5j.png" alt="我爱我家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gjzq.png" alt="国金证券"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enjoymusic.jpg" alt="不亦乐乎"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cnhnb.png" alt="惠农网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daoklab.jpg" alt="成都道壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ausnutria.jpg" alt="澳优乳业"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/deiyoudian.png" alt="河南有态度信息科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ezhiyang.png" alt="智阳第一人力"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shie.png" alt="上海保险交易所"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wsecar.png" alt="万顺叫车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shouqinba.jpg" alt="收钱吧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/baozun.png" alt="宝尊电商"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xbnwl.png" alt="喜百年供应链"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gwwisdom.png" alt="南京观为智慧软件科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ztrip.png" alt="在途商旅"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hualala.png" alt="哗啦啦"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xin.png" alt="优信二手车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maycur.png" alt="每刻科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bullyun.png" alt="杭州蛮牛"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bestpay.png" alt="翼支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mockuai.png" alt="魔筷科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ct108.png" alt="畅唐网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jusdaglobal.jpg" alt="准时达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/izaodao.png" alt="早道网校"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ovopark.jpg" alt="万店掌"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/funstory.jpg" alt="推文科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lemonbox.png" alt="Lemonbox"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/polyt.png" alt="保利票务"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chipwing.png" alt="芯翼科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/czbank.png" alt="浙商银行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/czbyqy.png" alt="易企银科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yundun.jpg" alt="上海云盾"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gaiaworks.jpg" alt="苏州盖雅信息技术有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mengxiang.png" alt="爱库存"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jidouauto.png" alt="极豆车联网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ipalfish.png" alt="伴鱼少儿英语"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/iqboard.png" alt="锐达科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/koolearn.png" alt="新东方在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kingcome.png" alt="金康高科"></td> </tr> </table> # Awards <img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/awards/oschina-2018-award.jpg" width="240px" alt="2018 年度最受欢迎中国开源软件"> # Stargazers over time [![Stargazers over time](https://starcharts.herokuapp.com/ctripcorp/apollo.svg)](https://starcharts.herokuapp.com/ctripcorp/apollo)
1
apolloconfig/apollo
3,489
doc update
## What's the purpose of this PR add known users and adjust sidebar Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-01-10T09:40:04Z"
"2021-01-10T09:40:32Z"
dbe243dec3b56d398c0627add53b5ec2c0ac92cb
b4188031befb158dc9f3b37bcec08af3663e8522
doc update. ## What's the purpose of this PR add known users and adjust sidebar Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./docs/zh/README.md
<img src="https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/logo/logo-simple.png" alt="apollo-logo" width="40%"> # Introduction Apollo(阿波罗)是携程框架部门研发的分布式配置中心,能够集中化管理应用不同环境、不同集群的配置,配置修改后能够实时推送到应用端,并且具备规范的权限、流程治理等特性,适用于微服务配置管理场景。 服务端基于Spring Boot和Spring Cloud开发,打包后可以直接运行,不需要额外安装Tomcat等应用容器。 Java客户端不依赖任何框架,能够运行于所有Java运行时环境,同时对Spring/Spring Boot环境也有较好的支持。 .Net客户端不依赖任何框架,能够运行于所有.Net运行时环境。 更多产品介绍参见[Apollo配置中心介绍](zh/design/apollo-introduction) 本地快速部署请参见[Quick Start](zh/deployment/quick-start) 演示环境(Demo): - [106.54.227.205](http://106.54.227.205/) - 账号/密码:apollo/admin > 如访问github速度缓慢,可以访问[gitee镜像](https://gitee.com/nobodyiam/apollo),不定期同步 # Screenshots ![配置界面](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-home-screenshot.jpg) # Features * **统一管理不同环境、不同集群的配置** * Apollo提供了一个统一界面集中式管理不同环境(environment)、不同集群(cluster)、不同命名空间(namespace)的配置。 * 同一份代码部署在不同的集群,可以有不同的配置,比如zk的地址等 * 通过命名空间(namespace)可以很方便的支持多个不同应用共享同一份配置,同时还允许应用对共享的配置进行覆盖 * 配置界面支持多语言(中文,English) * **配置修改实时生效(热发布)** * 用户在Apollo修改完配置并发布后,客户端能实时(1秒)接收到最新的配置,并通知到应用程序。 * **版本发布管理** * 所有的配置发布都有版本概念,从而可以方便的支持配置的回滚。 * **灰度发布** * 支持配置的灰度发布,比如点了发布后,只对部分应用实例生效,等观察一段时间没问题后再推给所有应用实例。 * **权限管理、发布审核、操作审计** * 应用和配置的管理都有完善的权限管理机制,对配置的管理还分为了编辑和发布两个环节,从而减少人为的错误。 * 所有的操作都有审计日志,可以方便的追踪问题。 * **客户端配置信息监控** * 可以方便的看到配置在被哪些实例使用 * **提供Java和.Net原生客户端** * 提供了Java和.Net的原生客户端,方便应用集成 * 支持Spring Placeholder,Annotation和Spring Boot的ConfigurationProperties,方便应用使用(需要Spring 3.1.1+) * 同时提供了Http接口,非Java和.Net应用也可以方便的使用 * **提供开放平台API** * Apollo自身提供了比较完善的统一配置管理界面,支持多环境、多数据中心配置管理、权限、流程治理等特性。 * 不过Apollo出于通用性考虑,对配置的修改不会做过多限制,只要符合基本的格式就能够保存。 * 在我们的调研中发现,对于有些使用方,它们的配置可能会有比较复杂的格式,如xml, json,需要对格式做校验。 * 还有一些使用方如DAL,不仅有特定的格式,而且对输入的值也需要进行校验后方可保存,如检查数据库、用户名和密码是否匹配。 * 对于这类应用,Apollo支持应用方通过开放接口在Apollo进行配置的修改和发布,并且具备完善的授权和权限控制 * **部署简单** * 配置中心作为基础服务,可用性要求非常高,这就要求Apollo对外部依赖尽可能地少 * 目前唯一的外部依赖是MySQL,所以部署非常简单,只要安装好Java和MySQL就可以让Apollo跑起来 * Apollo还提供了打包脚本,一键就可以生成所有需要的安装包,并且支持自定义运行时参数 # Usage 1. [应用接入指南](zh/usage/apollo-user-guide) 2. [Java客户端使用指南](zh/usage/java-sdk-user-guide) 3. [.Net客户端使用指南](zh/usage/dotnet-sdk-user-guide) 4. [其它语言客户端接入指南](zh/usage/other-language-client-user-guide) 5. [Apollo开放平台接入指南](zh/usage/apollo-open-api-platform) 6. [Apollo使用场景和示例代码](https://github.com/ctripcorp/apollo-use-cases) 7. [Apollo实践案例](zh/usage/apollo-user-practices) 8. [Apollo安全相关最佳实践](zh/usage/apollo-user-guide?id=_71-%e5%ae%89%e5%85%a8%e7%9b%b8%e5%85%b3) # Design - [Apollo配置中心设计](zh/design/apollo-design.md) - [Apollo配置中心介绍](zh/design/apollo-introduction.md) - [Apollo核心概念之“Namespace”](zh/design/apollo-core-concept-namespace.md) * [Apollo源码解析](http://www.iocoder.cn/categories/Apollo/)(据说Apollo非常适合作为初学者第一个通读源码学习的分布式中间件产品) # Development - [Apollo开发指南](zh/development/apollo-development-guide.md) - Code Styles - [Eclipse Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/eclipse-java-google-style.xml) - [Intellij Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/intellij-java-google-style.xml) - [Portal实现用户登录功能](zh/development/portal-how-to-implement-user-login-function.md) - [邮件模板样例](zh/development/email-template-samples.md) # Deployment - [Quick Start](zh/deployment/quick-start.md) - [Docker方式部署Quick Start](zh/deployment/quick-start-docker.md) - [分布式部署指南](zh/deployment/distributed-deployment-guide.md) # Release Notes * [版本发布历史](https://github.com/ctripcorp/apollo/releases) # FAQ * [常见问题回答](zh/faq/faq.md) * [部署&开发遇到的常见问题](zh/faq/common-issues-in-deployment-and-development-phase.md) # Presentation * [携程开源配置中心Apollo的设计与实现](http://www.itdks.com/dakalive/detail/3420) * [Slides](https://myslide.cn/slides/10168) * [配置中心,让微服务更『智能』](https://2018.qconshanghai.com/presentation/799) * [Slides](https://myslide.cn/slides/10035) # Publication * [开源配置中心Apollo的设计与实现](https://www.infoq.cn/article/open-source-configuration-center-apollo) * [配置中心,让微服务更『智能』](https://mp.weixin.qq.com/s/iDmYJre_ULEIxuliu1EbIQ) # Support <table> <thead> <th>Apollo技术支持⑤群<br />群号:914839843(未满)</th> <th>Apollo技术支持②群<br />群号:904287263(未满)</th> <th>Apollo技术支持④群<br />群号:516773934(已满)</th> <th>Apollo技术支持③群<br />群号:742035428(已满)</th> <th>Apollo技术支持①群<br />群号:375526581(已满)</th> </thead> <tbody> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-5.png" alt="tech-support-qq-5"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-2.png" alt="tech-support-qq-2"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-4.png" alt="tech-support-qq-4"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-3.png" alt="tech-support-qq-3"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-1.png" alt="tech-support-qq-1"></td> </tr> </tbody> </table> # Contribution Please make sure to read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making a pull request. Thanks for all the people who contributed to Apollo! <a href="https://github.com/ctripcorp/apollo/graphs/contributors"><img src="https://opencollective.com/apollo/contributors.svg?width=880&button=false" /></a> # License The project is licensed under the [Apache 2 license](https://github.com/ctripcorp/apollo/blob/master/LICENSE). # Known Users > 按照登记顺序排序,更多接入公司,欢迎在[https://github.com/ctripcorp/apollo/issues/451](https://github.com/ctripcorp/apollo/issues/451)登记(仅供开源用户参考) <table> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ctrip.png" alt="携程"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bluestone.png" alt="青石证券"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sagreen.png" alt="沙绿"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/umetrip.jpg" alt="航旅纵横"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhuanzhuan.png" alt="58转转"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/phone580.png" alt="蜂助手"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hainan-airlines.png" alt="海南航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cvte.png" alt="CVTE"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mainbo.jpg" alt="明博教育"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/madailicai.png" alt="麻袋理财"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mxnavi.jpg" alt="美行科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fshows.jpg" alt="首展科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/feezu.png" alt="易微行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rencaijia.png" alt="人才加"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/keking.png" alt="凯京集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/leoao.png" alt="乐刻运动"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dji.png" alt="大疆"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kkmh.png" alt="快看漫画"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wolaidai.png" alt="我来贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xsrj.png" alt="虚实软件"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yanxuan.png" alt="网易严选"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sjzg.png" alt="视觉中国"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zc360.png" alt="资产360"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ecarx.png" alt="亿咖通"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/5173.png" alt="5173"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hujiang.png" alt="沪江"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/163yun.png" alt="网易云基础服务"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cash-bus.png" alt="现金巴士"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/smartisan.png" alt="锤子科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/toodc.png" alt="头等仓"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/juneyaoair.png" alt="吉祥航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/263mobile.png" alt="263移动通信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/toutoujinrong.png" alt="投投金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mytijian.png" alt="每天健康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maiyabank.png" alt="麦芽金服"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fengunion.png" alt="蜂向科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/geex-logo.png" alt="即科金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beike.png" alt="贝壳网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/youzan.png" alt="有赞"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunjihuitong.png" alt="云集汇通"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rhinotech.png" alt="犀牛瀚海科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/nxin.png" alt="农信互联"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mgzf.png" alt="蘑菇租房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/huli-logo.png" alt="狐狸金服"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mandao.png" alt="漫道集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enmonster.png" alt="怪兽充电"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/nanguazufang.png" alt="南瓜租房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shitoujinrong.png" alt="石投金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tubatu.png" alt="土巴兔"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/payh_logo.png" alt="平安银行"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xinxindai.png" alt="新新贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chrtc.png" alt="中国华戎科技集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tuya_logo.png" alt="涂鸦智能"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/szlcsc.jpg" alt="立创商城"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hairongyi.png" alt="乐赚金服"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kxqc.png" alt="开心汽车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ppcredit.png" alt="乐赚金服"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/primeton.png" alt="普元信息"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hoskeeper.png" alt="医帮管家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fula.png" alt="付啦信用卡管家"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uzai.png" alt="悠哉网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/91wutong.png" alt="梧桐诚选"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ppdai.png" alt="拍拍贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xinyongfei.png" alt="信用飞"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dxy.png" alt="丁香园"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ghtech.png" alt="国槐科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/qbb.png" alt="亲宝宝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/huawei_logo.png" alt="华为视频直播"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/weiboyi.png" alt="微播易"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ofpay.png" alt="欧飞"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mishuo.png" alt="迷说"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yixia.png" alt="一下科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daocloud.png" alt="DaoCloud"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cnvex.png" alt="汽摩交易所"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/100tal.png" alt="好未来教育集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ainirobot.png" alt="猎户星空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhuojian.png" alt="卓健科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enjoyor.png" alt="银江股份"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tuhu.png" alt="途虎养车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/homedo.png" alt="河姆渡"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xwbank.png" alt="新网银行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ctspcl.png" alt="中旅安信云贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meiyou.png" alt="美柚"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zkh-logo.png" alt="震坤行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wgss.png" alt="万谷盛世"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/plateno.png" alt="铂涛旅行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lifesense.png" alt="乐心"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/reachmedia.png" alt="亿投传媒"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/guxiansheng.png" alt="股先生"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caixuetang.png" alt="财学堂"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/4399.png" alt="4399"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/autohome.png" alt="汽车之家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mbcaijing.png" alt="面包财经"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hoopchina.png" alt="虎扑"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sohu-auto.png" alt="搜狐汽车"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/liangfuzhengxin.png" alt="量富征信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maihaoche.png" alt="卖好车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zyiot.jpg" alt="中移物联网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/biauto.png" alt="易车网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maiyaole.png" alt="一药网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaoying.png" alt="小影"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caibeike.png" alt="彩贝壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yeelight.png" alt="YEELIGHT"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/itsgmu.png" alt="积目"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/acmedcare.png" alt="极致医疗"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinhui365.png" alt="金汇金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/900etrip.png" alt="久柏易游"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/24xiaomai.png" alt="小麦铺"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/vvic.png" alt="搜款网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mizlicai.png" alt="米庄理财"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bjt.png" alt="贝吉塔网络科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/weimob.png" alt="微盟"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kada.png" alt="网易卡搭"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kapbook.png" alt="股书"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jumore.png" alt="聚贸"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bimface.png" alt="广联达bimface"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/globalgrow.png" alt="环球易购"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jollychic.png" alt="浙江执御"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/2dfire.jpg" alt="二维火"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shopin.png" alt="上品"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/inspur.png" alt="浪潮集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ngarihealth.png" alt="纳里健康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/oraro.png" alt="橙红科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dragonpass.png" alt="龙腾出行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lizhi.fm.png" alt="荔枝"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/htd.png" alt="汇通达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunrong.png" alt="云融金科"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tszg360.png" alt="天生掌柜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rongplus.png" alt="容联光辉"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/intellif.png" alt="云天励飞"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jiayundata.png" alt="嘉云数据"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zts.png" alt="中泰证券网络金融部"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/163dun.png" alt="网易易盾"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiangwushuo.png" alt="享物说"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sto.png" alt="申通"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinhe.png" alt="金和网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/2345.png" alt="二三四五"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chtwm.jpg" alt="恒天财富"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uweixin.png" alt="沐雪微信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wzeye.png" alt="温州医科大学附属眼视光医院"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/10010pay.png" alt="联通支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shanshu.png" alt="杉数科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fenlibao.png" alt="分利宝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hetao101.png" alt="核桃编程"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaohongshu.png" alt="小红书"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/blissmall.png" alt="幸福西饼"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ky-express.png" alt="跨越速运"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/oyohotels.png" alt="OYO"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/100-me.png" alt="叮咚买菜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhidaohulian.jpg" alt="智道网联"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xueqiu.jpg" alt="雪球"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/autocloudpro.png" alt="车通云"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dadaabc.png" alt="哒哒英语"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xedaojia.jpg" alt="小E微店"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daling.png" alt="达令家"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/renliwo.png" alt="人力窝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mocire.jpg" alt="嘉美在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uepay.png" alt="极易付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wdom.png" alt="智慧开源"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cheshiku.png" alt="车仕库"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/taimeitech.png" alt="太美医疗科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yilianbaihui.png" alt="亿联百汇"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhoupu123.png" alt="舟谱数据"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/frxs.png" alt="芙蓉兴盛"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beastshop.png" alt="野兽派"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kaishustory.png" alt="凯叔讲故事"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/haodf.png" alt="好大夫在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/insyunmi.png" alt="云幂信息技术"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/duiba.png" alt="兑吧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/9ji.png" alt="九机网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sui.png" alt="随手科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/aixiangdao.png" alt="万谷盛世"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunzhangfang.png" alt="云账房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yuantutech.png" alt="浙江远图互联"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/qk365.png" alt="青客公寓"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/eastmoney.png" alt="东方财富"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jikexiu.png" alt="极客修"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meix.png" alt="美市科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zto.png" alt="中通快递"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/e6yun.png" alt="易流科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaoyuanzhao.png" alt="实习僧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dalingjia.png" alt="达令家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/secoo.png" alt="寺库"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lianlianpay.png" alt="连连支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhongan.png" alt="众安保险"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/360jinrong.png" alt="360金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caschina.png" alt="中航服商旅"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ke.png" alt="贝壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yeahmobi.png" alt="Yeahmobi易点天下"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/idengyun.png" alt="北京登云美业网络科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinher.png" alt="金和网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/komect.png" alt="中移(杭州)信息技术有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beisen.png" alt="北森"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/log56.png" alt="合肥维天运通"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meboth.png" alt="北京蜜步科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/postop.png" alt="术康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rfchina.png" alt="富力集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tfxing.png" alt="天府行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/8travelpay.png" alt="八商山"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/centaline.png" alt="中原地产"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zkyda.png" alt="智科云达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/house730.png" alt="中原730"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/pagoda.png" alt="百果园"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bolome.png" alt="波罗蜜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xignite.png" alt="Xignite"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/aduer.png" alt="杭州有云科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jojoreading.png" alt="成都书声科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sweetome.png" alt="斯维登集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/vipthink.png" alt="广东快乐种子科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tongxuecool.png" alt="上海盈翼文化传播有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sccfc.png" alt="上海尚诚消费金融股份有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ziroom.png" alt="自如网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jd.png" alt="京东"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rabbitpre.png" alt="兔展智能"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhubei.png" alt="竹贝"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/imile.png" alt="iMile(中东)"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/helloglobal.png" alt="哈罗出行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhaopin.png" alt="智联招聘"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/acadsoc.png" alt="阿卡索"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mojory.png" alt="妙知旅"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chengduoduo.png" alt="程多多"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/baojunev.png" alt="上汽通用五菱"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/leyan.png" alt="乐言科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dushu.png" alt="樊登读书"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zyiz.png" alt="找一找教程网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bppc.png" alt="中油碧辟石油有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shanglv51.png" alt="四川商旅无忧科技服务有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/waijiao365.png" alt="懿鸢网络科技(上海)有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gaoding.jpg" alt="稿定科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ricacorp.png" alt="搵樓 - 利嘉閣"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/t3go.png" alt="南京领行科技股份有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mokahr.jpg" alt="北京希瑞亚斯科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/printrainbow.png" alt="印彩虹印刷公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/milliontech.png" alt="Million Tech"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/guoguokeji.jpg" alt="果果科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/airkunming.png" alt="昆明航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/5i5j.png" alt="我爱我家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gjzq.png" alt="国金证券"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enjoymusic.jpg" alt="不亦乐乎"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cnhnb.png" alt="惠农网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daoklab.jpg" alt="成都道壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ausnutria.jpg" alt="澳优乳业"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/deiyoudian.png" alt="河南有态度信息科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ezhiyang.png" alt="智阳第一人力"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shie.png" alt="上海保险交易所"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wsecar.png" alt="万顺叫车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shouqinba.jpg" alt="收钱吧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/baozun.png" alt="宝尊电商"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xbnwl.png" alt="喜百年供应链"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gwwisdom.png" alt="南京观为智慧软件科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ztrip.png" alt="在途商旅"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hualala.png" alt="哗啦啦"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xin.png" alt="优信二手车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maycur.png" alt="每刻科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bullyun.png" alt="杭州蛮牛"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bestpay.png" alt="翼支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mockuai.png" alt="魔筷科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ct108.png" alt="畅唐网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jusdaglobal.jpg" alt="准时达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/izaodao.png" alt="早道网校"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ovopark.jpg" alt="万店掌"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/funstory.jpg" alt="推文科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lemonbox.png" alt="Lemonbox"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/polyt.png" alt="保利票务"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chipwing.png" alt="芯翼科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/czbank.png" alt="浙商银行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/czbyqy.png" alt="易企银科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yundun.jpg" alt="上海云盾"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gaiaworks.jpg" alt="苏州盖雅信息技术有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mengxiang.png" alt="爱库存"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jidouauto.png" alt="极豆车联网"></td> </tr> </table> # Awards <img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/awards/oschina-2018-award.jpg" width="240px" alt="2018 年度最受欢迎中国开源软件">
<img src="https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/logo/logo-simple.png" alt="apollo-logo" width="40%"> # Introduction Apollo(阿波罗)是携程框架部门研发的分布式配置中心,能够集中化管理应用不同环境、不同集群的配置,配置修改后能够实时推送到应用端,并且具备规范的权限、流程治理等特性,适用于微服务配置管理场景。 服务端基于Spring Boot和Spring Cloud开发,打包后可以直接运行,不需要额外安装Tomcat等应用容器。 Java客户端不依赖任何框架,能够运行于所有Java运行时环境,同时对Spring/Spring Boot环境也有较好的支持。 .Net客户端不依赖任何框架,能够运行于所有.Net运行时环境。 更多产品介绍参见[Apollo配置中心介绍](zh/design/apollo-introduction) 本地快速部署请参见[Quick Start](zh/deployment/quick-start) 演示环境(Demo): - [106.54.227.205](http://106.54.227.205/) - 账号/密码:apollo/admin > 如访问github速度缓慢,可以访问[gitee镜像](https://gitee.com/nobodyiam/apollo),不定期同步 # Screenshots ![配置界面](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-home-screenshot.jpg) # Features * **统一管理不同环境、不同集群的配置** * Apollo提供了一个统一界面集中式管理不同环境(environment)、不同集群(cluster)、不同命名空间(namespace)的配置。 * 同一份代码部署在不同的集群,可以有不同的配置,比如zk的地址等 * 通过命名空间(namespace)可以很方便的支持多个不同应用共享同一份配置,同时还允许应用对共享的配置进行覆盖 * 配置界面支持多语言(中文,English) * **配置修改实时生效(热发布)** * 用户在Apollo修改完配置并发布后,客户端能实时(1秒)接收到最新的配置,并通知到应用程序。 * **版本发布管理** * 所有的配置发布都有版本概念,从而可以方便的支持配置的回滚。 * **灰度发布** * 支持配置的灰度发布,比如点了发布后,只对部分应用实例生效,等观察一段时间没问题后再推给所有应用实例。 * **权限管理、发布审核、操作审计** * 应用和配置的管理都有完善的权限管理机制,对配置的管理还分为了编辑和发布两个环节,从而减少人为的错误。 * 所有的操作都有审计日志,可以方便的追踪问题。 * **客户端配置信息监控** * 可以方便的看到配置在被哪些实例使用 * **提供Java和.Net原生客户端** * 提供了Java和.Net的原生客户端,方便应用集成 * 支持Spring Placeholder,Annotation和Spring Boot的ConfigurationProperties,方便应用使用(需要Spring 3.1.1+) * 同时提供了Http接口,非Java和.Net应用也可以方便的使用 * **提供开放平台API** * Apollo自身提供了比较完善的统一配置管理界面,支持多环境、多数据中心配置管理、权限、流程治理等特性。 * 不过Apollo出于通用性考虑,对配置的修改不会做过多限制,只要符合基本的格式就能够保存。 * 在我们的调研中发现,对于有些使用方,它们的配置可能会有比较复杂的格式,如xml, json,需要对格式做校验。 * 还有一些使用方如DAL,不仅有特定的格式,而且对输入的值也需要进行校验后方可保存,如检查数据库、用户名和密码是否匹配。 * 对于这类应用,Apollo支持应用方通过开放接口在Apollo进行配置的修改和发布,并且具备完善的授权和权限控制 * **部署简单** * 配置中心作为基础服务,可用性要求非常高,这就要求Apollo对外部依赖尽可能地少 * 目前唯一的外部依赖是MySQL,所以部署非常简单,只要安装好Java和MySQL就可以让Apollo跑起来 * Apollo还提供了打包脚本,一键就可以生成所有需要的安装包,并且支持自定义运行时参数 # Usage 1. [应用接入指南](zh/usage/apollo-user-guide) 2. [Java客户端使用指南](zh/usage/java-sdk-user-guide) 3. [.Net客户端使用指南](zh/usage/dotnet-sdk-user-guide) 4. [其它语言客户端接入指南](zh/usage/other-language-client-user-guide) 5. [Apollo开放平台接入指南](zh/usage/apollo-open-api-platform) 6. [Apollo使用场景和示例代码](https://github.com/ctripcorp/apollo-use-cases) 7. [Apollo实践案例](zh/usage/apollo-user-practices) 8. [Apollo安全相关最佳实践](zh/usage/apollo-user-guide?id=_71-%e5%ae%89%e5%85%a8%e7%9b%b8%e5%85%b3) # Design - [Apollo配置中心设计](zh/design/apollo-design.md) - [Apollo配置中心介绍](zh/design/apollo-introduction.md) - [Apollo核心概念之“Namespace”](zh/design/apollo-core-concept-namespace.md) * [Apollo源码解析](http://www.iocoder.cn/categories/Apollo/)(据说Apollo非常适合作为初学者第一个通读源码学习的分布式中间件产品) # Development - [Apollo开发指南](zh/development/apollo-development-guide.md) - Code Styles - [Eclipse Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/eclipse-java-google-style.xml) - [Intellij Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/intellij-java-google-style.xml) - [Portal实现用户登录功能](zh/development/portal-how-to-implement-user-login-function.md) - [邮件模板样例](zh/development/email-template-samples.md) # Deployment - [Quick Start](zh/deployment/quick-start.md) - [Docker方式部署Quick Start](zh/deployment/quick-start-docker.md) - [分布式部署指南](zh/deployment/distributed-deployment-guide.md) # Release Notes * [版本发布历史](https://github.com/ctripcorp/apollo/releases) # FAQ * [常见问题回答](zh/faq/faq.md) * [部署&开发遇到的常见问题](zh/faq/common-issues-in-deployment-and-development-phase.md) # Presentation * [携程开源配置中心Apollo的设计与实现](http://www.itdks.com/dakalive/detail/3420) * [Slides](https://myslide.cn/slides/10168) * [配置中心,让微服务更『智能』](https://2018.qconshanghai.com/presentation/799) * [Slides](https://myslide.cn/slides/10035) # Publication * [开源配置中心Apollo的设计与实现](https://www.infoq.cn/article/open-source-configuration-center-apollo) * [配置中心,让微服务更『智能』](https://mp.weixin.qq.com/s/iDmYJre_ULEIxuliu1EbIQ) # Support <table> <thead> <th>Apollo技术支持②群<br />群号:904287263(未满)</th> <th>Apollo技术支持⑤群<br />群号:914839843(已满)</th> <th>Apollo技术支持④群<br />群号:516773934(已满)</th> <th>Apollo技术支持③群<br />群号:742035428(已满)</th> <th>Apollo技术支持①群<br />群号:375526581(已满)</th> </thead> <tbody> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-2.png" alt="tech-support-qq-2"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-5.png" alt="tech-support-qq-5"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-4.png" alt="tech-support-qq-4"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-3.png" alt="tech-support-qq-3"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-1.png" alt="tech-support-qq-1"></td> </tr> </tbody> </table> # Contribution Please make sure to read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making a pull request. Thanks for all the people who contributed to Apollo! <a href="https://github.com/ctripcorp/apollo/graphs/contributors"><img src="https://opencollective.com/apollo/contributors.svg?width=880&button=false" /></a> # License The project is licensed under the [Apache 2 license](https://github.com/ctripcorp/apollo/blob/master/LICENSE). # Known Users > 按照登记顺序排序,更多接入公司,欢迎在[https://github.com/ctripcorp/apollo/issues/451](https://github.com/ctripcorp/apollo/issues/451)登记(仅供开源用户参考) <table> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ctrip.png" alt="携程"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bluestone.png" alt="青石证券"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sagreen.png" alt="沙绿"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/umetrip.jpg" alt="航旅纵横"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhuanzhuan.png" alt="58转转"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/phone580.png" alt="蜂助手"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hainan-airlines.png" alt="海南航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cvte.png" alt="CVTE"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mainbo.jpg" alt="明博教育"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/madailicai.png" alt="麻袋理财"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mxnavi.jpg" alt="美行科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fshows.jpg" alt="首展科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/feezu.png" alt="易微行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rencaijia.png" alt="人才加"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/keking.png" alt="凯京集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/leoao.png" alt="乐刻运动"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dji.png" alt="大疆"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kkmh.png" alt="快看漫画"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wolaidai.png" alt="我来贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xsrj.png" alt="虚实软件"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yanxuan.png" alt="网易严选"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sjzg.png" alt="视觉中国"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zc360.png" alt="资产360"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ecarx.png" alt="亿咖通"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/5173.png" alt="5173"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hujiang.png" alt="沪江"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/163yun.png" alt="网易云基础服务"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cash-bus.png" alt="现金巴士"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/smartisan.png" alt="锤子科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/toodc.png" alt="头等仓"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/juneyaoair.png" alt="吉祥航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/263mobile.png" alt="263移动通信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/toutoujinrong.png" alt="投投金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mytijian.png" alt="每天健康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maiyabank.png" alt="麦芽金服"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fengunion.png" alt="蜂向科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/geex-logo.png" alt="即科金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beike.png" alt="贝壳网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/youzan.png" alt="有赞"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunjihuitong.png" alt="云集汇通"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rhinotech.png" alt="犀牛瀚海科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/nxin.png" alt="农信互联"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mgzf.png" alt="蘑菇租房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/huli-logo.png" alt="狐狸金服"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mandao.png" alt="漫道集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enmonster.png" alt="怪兽充电"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/nanguazufang.png" alt="南瓜租房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shitoujinrong.png" alt="石投金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tubatu.png" alt="土巴兔"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/payh_logo.png" alt="平安银行"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xinxindai.png" alt="新新贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chrtc.png" alt="中国华戎科技集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tuya_logo.png" alt="涂鸦智能"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/szlcsc.jpg" alt="立创商城"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hairongyi.png" alt="乐赚金服"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kxqc.png" alt="开心汽车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ppcredit.png" alt="乐赚金服"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/primeton.png" alt="普元信息"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hoskeeper.png" alt="医帮管家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fula.png" alt="付啦信用卡管家"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uzai.png" alt="悠哉网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/91wutong.png" alt="梧桐诚选"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ppdai.png" alt="拍拍贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xinyongfei.png" alt="信用飞"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dxy.png" alt="丁香园"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ghtech.png" alt="国槐科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/qbb.png" alt="亲宝宝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/huawei_logo.png" alt="华为视频直播"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/weiboyi.png" alt="微播易"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ofpay.png" alt="欧飞"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mishuo.png" alt="迷说"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yixia.png" alt="一下科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daocloud.png" alt="DaoCloud"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cnvex.png" alt="汽摩交易所"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/100tal.png" alt="好未来教育集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ainirobot.png" alt="猎户星空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhuojian.png" alt="卓健科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enjoyor.png" alt="银江股份"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tuhu.png" alt="途虎养车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/homedo.png" alt="河姆渡"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xwbank.png" alt="新网银行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ctspcl.png" alt="中旅安信云贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meiyou.png" alt="美柚"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zkh-logo.png" alt="震坤行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wgss.png" alt="万谷盛世"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/plateno.png" alt="铂涛旅行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lifesense.png" alt="乐心"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/reachmedia.png" alt="亿投传媒"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/guxiansheng.png" alt="股先生"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caixuetang.png" alt="财学堂"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/4399.png" alt="4399"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/autohome.png" alt="汽车之家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mbcaijing.png" alt="面包财经"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hoopchina.png" alt="虎扑"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sohu-auto.png" alt="搜狐汽车"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/liangfuzhengxin.png" alt="量富征信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maihaoche.png" alt="卖好车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zyiot.jpg" alt="中移物联网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/biauto.png" alt="易车网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maiyaole.png" alt="一药网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaoying.png" alt="小影"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caibeike.png" alt="彩贝壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yeelight.png" alt="YEELIGHT"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/itsgmu.png" alt="积目"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/acmedcare.png" alt="极致医疗"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinhui365.png" alt="金汇金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/900etrip.png" alt="久柏易游"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/24xiaomai.png" alt="小麦铺"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/vvic.png" alt="搜款网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mizlicai.png" alt="米庄理财"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bjt.png" alt="贝吉塔网络科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/weimob.png" alt="微盟"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kada.png" alt="网易卡搭"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kapbook.png" alt="股书"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jumore.png" alt="聚贸"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bimface.png" alt="广联达bimface"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/globalgrow.png" alt="环球易购"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jollychic.png" alt="浙江执御"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/2dfire.jpg" alt="二维火"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shopin.png" alt="上品"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/inspur.png" alt="浪潮集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ngarihealth.png" alt="纳里健康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/oraro.png" alt="橙红科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dragonpass.png" alt="龙腾出行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lizhi.fm.png" alt="荔枝"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/htd.png" alt="汇通达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunrong.png" alt="云融金科"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tszg360.png" alt="天生掌柜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rongplus.png" alt="容联光辉"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/intellif.png" alt="云天励飞"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jiayundata.png" alt="嘉云数据"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zts.png" alt="中泰证券网络金融部"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/163dun.png" alt="网易易盾"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiangwushuo.png" alt="享物说"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sto.png" alt="申通"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinhe.png" alt="金和网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/2345.png" alt="二三四五"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chtwm.jpg" alt="恒天财富"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uweixin.png" alt="沐雪微信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wzeye.png" alt="温州医科大学附属眼视光医院"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/10010pay.png" alt="联通支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shanshu.png" alt="杉数科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fenlibao.png" alt="分利宝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hetao101.png" alt="核桃编程"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaohongshu.png" alt="小红书"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/blissmall.png" alt="幸福西饼"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ky-express.png" alt="跨越速运"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/oyohotels.png" alt="OYO"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/100-me.png" alt="叮咚买菜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhidaohulian.jpg" alt="智道网联"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xueqiu.jpg" alt="雪球"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/autocloudpro.png" alt="车通云"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dadaabc.png" alt="哒哒英语"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xedaojia.jpg" alt="小E微店"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daling.png" alt="达令家"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/renliwo.png" alt="人力窝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mocire.jpg" alt="嘉美在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uepay.png" alt="极易付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wdom.png" alt="智慧开源"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cheshiku.png" alt="车仕库"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/taimeitech.png" alt="太美医疗科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yilianbaihui.png" alt="亿联百汇"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhoupu123.png" alt="舟谱数据"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/frxs.png" alt="芙蓉兴盛"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beastshop.png" alt="野兽派"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kaishustory.png" alt="凯叔讲故事"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/haodf.png" alt="好大夫在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/insyunmi.png" alt="云幂信息技术"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/duiba.png" alt="兑吧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/9ji.png" alt="九机网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sui.png" alt="随手科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/aixiangdao.png" alt="万谷盛世"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunzhangfang.png" alt="云账房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yuantutech.png" alt="浙江远图互联"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/qk365.png" alt="青客公寓"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/eastmoney.png" alt="东方财富"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jikexiu.png" alt="极客修"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meix.png" alt="美市科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zto.png" alt="中通快递"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/e6yun.png" alt="易流科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaoyuanzhao.png" alt="实习僧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dalingjia.png" alt="达令家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/secoo.png" alt="寺库"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lianlianpay.png" alt="连连支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhongan.png" alt="众安保险"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/360jinrong.png" alt="360金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caschina.png" alt="中航服商旅"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ke.png" alt="贝壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yeahmobi.png" alt="Yeahmobi易点天下"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/idengyun.png" alt="北京登云美业网络科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinher.png" alt="金和网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/komect.png" alt="中移(杭州)信息技术有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beisen.png" alt="北森"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/log56.png" alt="合肥维天运通"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meboth.png" alt="北京蜜步科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/postop.png" alt="术康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rfchina.png" alt="富力集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tfxing.png" alt="天府行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/8travelpay.png" alt="八商山"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/centaline.png" alt="中原地产"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zkyda.png" alt="智科云达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/house730.png" alt="中原730"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/pagoda.png" alt="百果园"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bolome.png" alt="波罗蜜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xignite.png" alt="Xignite"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/aduer.png" alt="杭州有云科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jojoreading.png" alt="成都书声科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sweetome.png" alt="斯维登集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/vipthink.png" alt="广东快乐种子科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tongxuecool.png" alt="上海盈翼文化传播有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sccfc.png" alt="上海尚诚消费金融股份有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ziroom.png" alt="自如网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jd.png" alt="京东"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rabbitpre.png" alt="兔展智能"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhubei.png" alt="竹贝"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/imile.png" alt="iMile(中东)"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/helloglobal.png" alt="哈罗出行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhaopin.png" alt="智联招聘"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/acadsoc.png" alt="阿卡索"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mojory.png" alt="妙知旅"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chengduoduo.png" alt="程多多"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/baojunev.png" alt="上汽通用五菱"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/leyan.png" alt="乐言科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dushu.png" alt="樊登读书"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zyiz.png" alt="找一找教程网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bppc.png" alt="中油碧辟石油有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shanglv51.png" alt="四川商旅无忧科技服务有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/waijiao365.png" alt="懿鸢网络科技(上海)有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gaoding.jpg" alt="稿定科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ricacorp.png" alt="搵樓 - 利嘉閣"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/t3go.png" alt="南京领行科技股份有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mokahr.jpg" alt="北京希瑞亚斯科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/printrainbow.png" alt="印彩虹印刷公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/milliontech.png" alt="Million Tech"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/guoguokeji.jpg" alt="果果科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/airkunming.png" alt="昆明航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/5i5j.png" alt="我爱我家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gjzq.png" alt="国金证券"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enjoymusic.jpg" alt="不亦乐乎"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cnhnb.png" alt="惠农网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daoklab.jpg" alt="成都道壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ausnutria.jpg" alt="澳优乳业"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/deiyoudian.png" alt="河南有态度信息科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ezhiyang.png" alt="智阳第一人力"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shie.png" alt="上海保险交易所"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wsecar.png" alt="万顺叫车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shouqinba.jpg" alt="收钱吧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/baozun.png" alt="宝尊电商"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xbnwl.png" alt="喜百年供应链"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gwwisdom.png" alt="南京观为智慧软件科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ztrip.png" alt="在途商旅"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hualala.png" alt="哗啦啦"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xin.png" alt="优信二手车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maycur.png" alt="每刻科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bullyun.png" alt="杭州蛮牛"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bestpay.png" alt="翼支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mockuai.png" alt="魔筷科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ct108.png" alt="畅唐网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jusdaglobal.jpg" alt="准时达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/izaodao.png" alt="早道网校"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ovopark.jpg" alt="万店掌"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/funstory.jpg" alt="推文科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lemonbox.png" alt="Lemonbox"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/polyt.png" alt="保利票务"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chipwing.png" alt="芯翼科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/czbank.png" alt="浙商银行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/czbyqy.png" alt="易企银科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yundun.jpg" alt="上海云盾"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gaiaworks.jpg" alt="苏州盖雅信息技术有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mengxiang.png" alt="爱库存"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jidouauto.png" alt="极豆车联网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ipalfish.png" alt="伴鱼少儿英语"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/iqboard.png" alt="锐达科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/koolearn.png" alt="新东方在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kingcome.png" alt="金康高科"></td> </tr> </table> # Awards <img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/awards/oschina-2018-award.jpg" width="240px" alt="2018 年度最受欢迎中国开源软件">
1
apolloconfig/apollo
3,489
doc update
## What's the purpose of this PR add known users and adjust sidebar Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-01-10T09:40:04Z"
"2021-01-10T09:40:32Z"
dbe243dec3b56d398c0627add53b5ec2c0ac92cb
b4188031befb158dc9f3b37bcec08af3663e8522
doc update. ## What's the purpose of this PR add known users and adjust sidebar Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./docs/zh/_sidebar.md
- [**首页**](zh/README.md) - 设计文档 - [Apollo配置中心设计](zh/design/apollo-design.md) - [Apollo配置中心介绍](zh/design/apollo-introduction.md) - [Apollo核心概念之“Namespace”](zh/design/apollo-core-concept-namespace.md) - [Apollo源码解析(全)](http://www.iocoder.cn/categories/Apollo/) - 部署文档 - [Quick Start](zh/deployment/quick-start.md) - [Docker方式部署Quick Start](zh/deployment/quick-start-docker.md) - [分布式部署指南](zh/deployment/distributed-deployment-guide.md) - 开发文档 - [Apollo开发指南](zh/development/apollo-development-guide.md) - Code Styles - [Eclipse Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/eclipse-java-google-style.xml) - [Intellij Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/intellij-java-google-style.xml) - [Portal实现用户登录功能](zh/development/portal-how-to-implement-user-login-function.md) - [邮件模板样例](zh/development/email-template-samples.md) - 使用文档 - [Apollo使用指南](zh/usage/apollo-user-guide.md) - [Java客户端使用指南](zh/usage/java-sdk-user-guide.md) - [.Net客户端使用指南](zh/usage/dotnet-sdk-user-guide.md) - [Go、Python、NodeJS、PHP等客户端使用指南](zh/usage/third-party-sdks-user-guide.md) - [其它语言客户端接入指南](zh/usage/other-language-client-user-guide.md) - [Apollo开放平台接入指南](zh/usage/apollo-open-api-platform.md) - [Apollo使用场景和示例代码](https://github.com/ctripcorp/apollo-use-cases) - [Apollo实践案例](zh/usage/apollo-user-practices.md) - [Apollo安全相关最佳实践](zh/usage/apollo-user-guide?id=_71-%e5%ae%89%e5%85%a8%e7%9b%b8%e5%85%b3) - FAQ - [常见问题回答](zh/faq/faq.md) - [部署&开发遇到的常见问题](zh/faq/common-issues-in-deployment-and-development-phase.md) - 其它 - [版本历史](https://github.com/ctripcorp/apollo/releases) - [Apollo性能测试报告](zh/misc/apollo-benchmark.md)
- [**首页**](zh/README.md) - 设计文档 - [Apollo配置中心设计](zh/design/apollo-design.md) - [Apollo配置中心介绍](zh/design/apollo-introduction.md) - [Apollo核心概念之“Namespace”](zh/design/apollo-core-concept-namespace.md) - [Apollo源码解析(全)](http://www.iocoder.cn/categories/Apollo/) - 部署文档 - [Quick Start](zh/deployment/quick-start.md) - [Docker方式部署Quick Start](zh/deployment/quick-start-docker.md) - [分布式部署指南](zh/deployment/distributed-deployment-guide.md) - 开发文档 - [Apollo开发指南](zh/development/apollo-development-guide.md) - Code Styles - [Eclipse Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/eclipse-java-google-style.xml) - [Intellij Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/intellij-java-google-style.xml) - [Portal实现用户登录功能](zh/development/portal-how-to-implement-user-login-function.md) - [邮件模板样例](zh/development/email-template-samples.md) - 使用文档 - [Apollo使用指南](zh/usage/apollo-user-guide.md) - [Java客户端使用指南](zh/usage/java-sdk-user-guide.md) - [.Net客户端使用指南](zh/usage/dotnet-sdk-user-guide.md) - [Go、Python、NodeJS、PHP等客户端使用指南](zh/usage/third-party-sdks-user-guide.md) - [其它语言客户端接入指南](zh/usage/other-language-client-user-guide.md) - [Apollo开放平台接入指南](zh/usage/apollo-open-api-platform.md) - [Apollo使用场景和示例代码](https://github.com/ctripcorp/apollo-use-cases) - [Apollo实践案例](zh/usage/apollo-user-practices.md) - [Apollo安全相关最佳实践](zh/usage/apollo-user-guide?id=_71-%e5%ae%89%e5%85%a8%e7%9b%b8%e5%85%b3) - FAQ - [常见问题回答](zh/faq/faq.md) - [部署&开发遇到的常见问题](zh/faq/common-issues-in-deployment-and-development-phase.md) - 其它 - [版本历史](https://github.com/ctripcorp/apollo/releases) - [Apollo性能测试报告](zh/misc/apollo-benchmark.md)
1
apolloconfig/apollo
3,489
doc update
## What's the purpose of this PR add known users and adjust sidebar Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-01-10T09:40:04Z"
"2021-01-10T09:40:32Z"
dbe243dec3b56d398c0627add53b5ec2c0ac92cb
b4188031befb158dc9f3b37bcec08af3663e8522
doc update. ## What's the purpose of this PR add known users and adjust sidebar Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./scripts/apollo-on-kubernetes/README.md
# 使用方法 ## 一、构建镜像 ### 1.1 获取 apollo 压缩包 从 https://github.com/ctripcorp/apollo/releases 下载预先打好的 java 包 <br/> 例如你下载的是: <br/> apollo-portal-1.0.0-github.zip <br/> apollo-adminservice-1.0.0-github.zip <br/> apollo-configservice-1.0.0-github.zip <br/> ### 1.2 解压压缩包, 获取程序 jar 包 - 解压 apollo-portal-1.0.0-github.zip <br/> 获取 apollo-portal-1.0.0.jar, 重命名为 apollo-portal.jar, 放到 scripts/apollo-on-kubernetes/apollo-portal-server - 解压 apollo-adminservice-1.0.0-github.zip <br/> 获取 apollo-adminservice-1.0.0.jar, 重命名为 apollo-adminservice.jar, 放到 scripts/apollo-on-kubernetes/apollo-admin-server - 解压 apollo-configservice-1.0.0-github.zip <br/> 获取 apollo-configservice-1.0.0.jar, 重命名为 apollo-configservice.jar, 放到 scripts/apollo-on-kubernetes/apollo-config-server ### 1.3 build image 需要分别为alpine-bash-3.8-image,apollo-config-server,apollo-admin-server和apollo-portal-server构建镜像。 以 build apollo-config-server image 为例, 其他类似 ```bash scripts/apollo-on-kubernetes/apollo-config-server$ tree -L 2 . ├── apollo-configservice.conf ├── apollo-configservice.jar ├── config │   ├── application-github.properties │   └── app.properties ├── Dockerfile ├── entrypoint.sh └── scripts └── startup-kubernetes.sh ``` build image ```bash # 在 scripts/apollo-on-kubernetes/apollo-config-server 路径下 docker build -t apollo-config-server:v1.0.0 . ``` push image <br/> 将 image push 到你的 docker registry, 例如 vmware harbor ## 二、Deploy apollo on kubernetes ### 2.1 部署 MySQL 服务 你可以选用 MySQL-Galera-WSrep 来提高你的 MySQL 服务的可用性 <br/> MySQL 部署步骤略 ### 2.1 导入 MySQL DB 文件 由于上面部署了分布式的 MySQL, 所有 config-server、admin-server、portal-server 使用同一个 MySQL 服务的不同数据库 示例假设你的 apollo 开启了 4 个环境, 即 dev、test-alpha、test-beta、prod, 在你的 MySQL 中导入 scripts/apollo-on-kubernetes/db 下的文件即可 如果有需要, 你可以更改 eureka.service.url 的地址, 格式为 http://config-server-pod-name-index.meta-server-service-name:8080/eureka/ , 例如 http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/ ### 2.2 Deploy apollo on kubernetes 示例假设你有 4 台 kubernetes node 来部署 apollo, apollo 开启了 4 个环境, 即 dev、test-alpha、test-beta、prod 按照 scripts/apollo-on-kubernetes/kubernetes/kubectl-apply.sh 文件的内容部署 apollo 即可,注意需要按照实际情况修改对应配置文件中的数据库连接信息、eureka.service.url、replicas、nodeSelector、镜像信息等。 ```bash scripts/apollo-on-kubernetes/kubernetes$ cat kubectl-apply.sh # create namespace kubectl create namespace sre # dev-env kubectl apply -f apollo-env-dev/service-mysql-for-apollo-dev-env.yaml --record && \ kubectl apply -f apollo-env-dev/service-apollo-config-server-dev.yaml --record && \ kubectl apply -f apollo-env-dev/service-apollo-admin-server-dev.yaml --record # fat-env(test-alpha-env) kubectl apply -f apollo-env-test-alpha/service-mysql-for-apollo-test-alpha-env.yaml --record && \ kubectl apply -f apollo-env-test-alpha/service-apollo-config-server-test-alpha.yaml --record && \ kubectl apply -f apollo-env-test-alpha/service-apollo-admin-server-test-alpha.yaml --record # uat-env(test-beta-env) kubectl apply -f apollo-env-test-beta/service-mysql-for-apollo-test-beta-env.yaml --record && \ kubectl apply -f apollo-env-test-beta/service-apollo-config-server-test-beta.yaml --record && \ kubectl apply -f apollo-env-test-beta/service-apollo-admin-server-test-beta.yaml --record # prod-env kubectl apply -f apollo-env-prod/service-mysql-for-apollo-prod-env.yaml --record && \ kubectl apply -f apollo-env-prod/service-apollo-config-server-prod.yaml --record && \ kubectl apply -f apollo-env-prod/service-apollo-admin-server-prod.yaml --record # portal kubectl apply -f service-apollo-portal-server.yaml --record ``` ~~你需要注意的是, 应当尽量让同一个 server 的不同 pod 在不同 node 上, 这个通过 kubernetes nodeSelector 实现~~ 去掉nodeSelector 改为POD反亲和性[podAntiAffinity](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/) ### 2.3 验证所有 pod 处于 Running 并且 READY 状态 ```bash kubectl get pod -n sre -o wide # 示例结果 NAME READY STATUS RESTARTS AGE IP NODE deployment-apollo-admin-server-dev-b7bbd657-4d5jx 1/1 Running 0 2d 10.247.4.79 k8s-apollo-node-2 deployment-apollo-admin-server-dev-b7bbd657-lwz5x 1/1 Running 0 2d 10.247.8.7 k8s-apollo-node-3 deployment-apollo-admin-server-dev-b7bbd657-xs4wt 1/1 Running 0 2d 10.247.1.23 k8s-apollo-node-1 deployment-apollo-admin-server-prod-699bbd894f-j977p 1/1 Running 0 2d 10.247.4.83 k8s-apollo-node-2 deployment-apollo-admin-server-prod-699bbd894f-n9m54 1/1 Running 0 2d 10.247.8.11 k8s-apollo-node-3 deployment-apollo-admin-server-prod-699bbd894f-vs56w 1/1 Running 0 2d 10.247.1.27 k8s-apollo-node-1 deployment-apollo-admin-server-test-beta-7c855cd4f5-9br65 1/1 Running 0 2d 10.247.1.25 k8s-apollo-node-1 deployment-apollo-admin-server-test-beta-7c855cd4f5-cck5g 1/1 Running 0 2d 10.247.8.9 k8s-apollo-node-3 deployment-apollo-admin-server-test-beta-7c855cd4f5-x6gt4 1/1 Running 0 2d 10.247.4.81 k8s-apollo-node-2 deployment-apollo-portal-server-6d4bbc879c-bv7cn 1/1 Running 0 2d 10.247.8.12 k8s-apollo-node-3 deployment-apollo-portal-server-6d4bbc879c-c4zrb 1/1 Running 0 2d 10.247.1.28 k8s-apollo-node-1 deployment-apollo-portal-server-6d4bbc879c-qm4mn 1/1 Running 0 2d 10.247.4.84 k8s-apollo-node-2 statefulset-apollo-config-server-dev-0 1/1 Running 0 2d 10.247.8.6 k8s-apollo-node-3 statefulset-apollo-config-server-dev-1 1/1 Running 0 2d 10.247.4.78 k8s-apollo-node-2 statefulset-apollo-config-server-dev-2 1/1 Running 0 2d 10.247.1.22 k8s-apollo-node-1 statefulset-apollo-config-server-prod-0 1/1 Running 0 2d 10.247.8.10 k8s-apollo-node-3 statefulset-apollo-config-server-prod-1 1/1 Running 0 2d 10.247.4.82 k8s-apollo-node-2 statefulset-apollo-config-server-prod-2 1/1 Running 0 2d 10.247.1.26 k8s-apollo-node-1 statefulset-apollo-config-server-test-beta-0 1/1 Running 0 2d 10.247.8.8 k8s-apollo-node-3 statefulset-apollo-config-server-test-beta-1 1/1 Running 0 2d 10.247.4.80 k8s-apollo-node-2 statefulset-apollo-config-server-test-beta-2 1/1 Running 0 2d 10.247.1.24 k8s-apollo-node-1 ``` ### 2.4 访问 apollo service - server 端(即 portal) <br/> &nbsp;&nbsp;&nbsp;&nbsp;kubernetes-master-ip:30001 - client 端, 在 client 端无需再实现负载均衡 <br/> Dev<br/> &nbsp;&nbsp;&nbsp;&nbsp;kubernetes-master-ip:30002 <br/> Test-Alpha <br/> &nbsp;&nbsp;&nbsp;&nbsp;kubernetes-master-ip:30003 <br/> Test-Beta <br/> &nbsp;&nbsp;&nbsp;&nbsp;kubernetes-master-ip:30004 <br/> Prod <br/> &nbsp;&nbsp;&nbsp;&nbsp;kubernetes-master-ip:30005 <br/> # FAQ ## 关于修改的 Dockerfile 添加 ENV 和 entrypoint.sh, 启动 server 需要的配置, 在 kubernetes yaml 文件中可以通过 configmap 传入、也可以通过 ENV 传入 关于 Dockerfile、entrypoint.sh 具体内容, 你可以查看文件里的内容 ## 关于 kubernetes yaml 文件 具体内容请查看 `scripts/apollo-on-kubernetes/kubernetes/service-apollo-portal-server.yaml` 注释 <br/> 其他类似。 ## 关于 eureka.service.url 使用 meta-server(即 config-server) 的 pod name, config-server 务必使用 statefulset。 格式为:`http://<config server pod名>.<meta server 服务名>:<meta server端口号>/eureka/`。 以 apollo-env-dev 为例: ```bash ('eureka.service.url', 'default', 'http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-1.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-2.service-apollo-meta-server-dev:8080/eureka/', 'Eureka服务Url,多个service以英文逗号分隔') ``` 你可以精简 config-server pod 的 name, 示例的长名字是为了更好的阅读与理解。 ### 方式一:通过Spring Boot文件 application-github.properties配置(推荐) 推荐此方式配置 `eureka.service.url`,因为可以通过ConfigMap的方式传入容器,无需再修改数据库的字段。 Admin Server的配置: ```yaml --- # configmap for apollo-admin-server-dev kind: ConfigMap apiVersion: v1 metadata: namespace: sre name: configmap-apollo-admin-server-dev data: application-github.properties: | spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-dev-env-mariadb.sre:3306/DevApolloConfigDB?characterEncoding=utf8 spring.datasource.username = root spring.datasource.password = test eureka.service.url = http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-1.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-2.service-apollo-meta-server-dev:8080/eureka/ ``` Config Server的配置: ```yaml --- # configmap for apollo-config-server-dev kind: ConfigMap apiVersion: v1 metadata: namespace: sre name: configmap-apollo-config-server-dev data: application-github.properties: | spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-dev-env-mariadb.sre:3306/DevApolloConfigDB?characterEncoding=utf8 spring.datasource.username = root spring.datasource.password = m6bCdQXa00 eureka.service.url = http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-1.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-2.service-apollo-meta-server-dev:8080/eureka/ ``` ### 方式二:修改数据表 ApolloConfigDB.ServerConfig 修改数据库表 ApolloConfigDB.ServerConfig的 eureka.service.url。
# 使用方法 ## 一、构建镜像 ### 1.1 获取 apollo 压缩包 从 https://github.com/ctripcorp/apollo/releases 下载预先打好的 java 包 <br/> 例如你下载的是: <br/> apollo-portal-1.0.0-github.zip <br/> apollo-adminservice-1.0.0-github.zip <br/> apollo-configservice-1.0.0-github.zip <br/> ### 1.2 解压压缩包, 获取程序 jar 包 - 解压 apollo-portal-1.0.0-github.zip <br/> 获取 apollo-portal-1.0.0.jar, 重命名为 apollo-portal.jar, 放到 scripts/apollo-on-kubernetes/apollo-portal-server - 解压 apollo-adminservice-1.0.0-github.zip <br/> 获取 apollo-adminservice-1.0.0.jar, 重命名为 apollo-adminservice.jar, 放到 scripts/apollo-on-kubernetes/apollo-admin-server - 解压 apollo-configservice-1.0.0-github.zip <br/> 获取 apollo-configservice-1.0.0.jar, 重命名为 apollo-configservice.jar, 放到 scripts/apollo-on-kubernetes/apollo-config-server ### 1.3 build image 需要分别为alpine-bash-3.8-image,apollo-config-server,apollo-admin-server和apollo-portal-server构建镜像。 以 build apollo-config-server image 为例, 其他类似 ```bash scripts/apollo-on-kubernetes/apollo-config-server$ tree -L 2 . ├── apollo-configservice.conf ├── apollo-configservice.jar ├── config │   ├── application-github.properties │   └── app.properties ├── Dockerfile ├── entrypoint.sh └── scripts └── startup-kubernetes.sh ``` build image ```bash # 在 scripts/apollo-on-kubernetes/apollo-config-server 路径下 docker build -t apollo-config-server:v1.0.0 . ``` push image <br/> 将 image push 到你的 docker registry, 例如 vmware harbor ## 二、Deploy apollo on kubernetes ### 2.1 部署 MySQL 服务 你可以选用 MySQL-Galera-WSrep 来提高你的 MySQL 服务的可用性 <br/> MySQL 部署步骤略 ### 2.1 导入 MySQL DB 文件 由于上面部署了分布式的 MySQL, 所有 config-server、admin-server、portal-server 使用同一个 MySQL 服务的不同数据库 示例假设你的 apollo 开启了 4 个环境, 即 dev、test-alpha、test-beta、prod, 在你的 MySQL 中导入 scripts/apollo-on-kubernetes/db 下的文件即可 如果有需要, 你可以更改 eureka.service.url 的地址, 格式为 http://config-server-pod-name-index.meta-server-service-name:8080/eureka/ , 例如 http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/ ### 2.2 Deploy apollo on kubernetes 示例假设你有 4 台 kubernetes node 来部署 apollo, apollo 开启了 4 个环境, 即 dev、test-alpha、test-beta、prod 按照 scripts/apollo-on-kubernetes/kubernetes/kubectl-apply.sh 文件的内容部署 apollo 即可,注意需要按照实际情况修改对应配置文件中的数据库连接信息、eureka.service.url、replicas、nodeSelector、镜像信息等。 ```bash scripts/apollo-on-kubernetes/kubernetes$ cat kubectl-apply.sh # create namespace kubectl create namespace sre # dev-env kubectl apply -f apollo-env-dev/service-mysql-for-apollo-dev-env.yaml --record && \ kubectl apply -f apollo-env-dev/service-apollo-config-server-dev.yaml --record && \ kubectl apply -f apollo-env-dev/service-apollo-admin-server-dev.yaml --record # fat-env(test-alpha-env) kubectl apply -f apollo-env-test-alpha/service-mysql-for-apollo-test-alpha-env.yaml --record && \ kubectl apply -f apollo-env-test-alpha/service-apollo-config-server-test-alpha.yaml --record && \ kubectl apply -f apollo-env-test-alpha/service-apollo-admin-server-test-alpha.yaml --record # uat-env(test-beta-env) kubectl apply -f apollo-env-test-beta/service-mysql-for-apollo-test-beta-env.yaml --record && \ kubectl apply -f apollo-env-test-beta/service-apollo-config-server-test-beta.yaml --record && \ kubectl apply -f apollo-env-test-beta/service-apollo-admin-server-test-beta.yaml --record # prod-env kubectl apply -f apollo-env-prod/service-mysql-for-apollo-prod-env.yaml --record && \ kubectl apply -f apollo-env-prod/service-apollo-config-server-prod.yaml --record && \ kubectl apply -f apollo-env-prod/service-apollo-admin-server-prod.yaml --record # portal kubectl apply -f service-apollo-portal-server.yaml --record ``` ~~你需要注意的是, 应当尽量让同一个 server 的不同 pod 在不同 node 上, 这个通过 kubernetes nodeSelector 实现~~ 去掉nodeSelector 改为POD反亲和性[podAntiAffinity](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/) ### 2.3 验证所有 pod 处于 Running 并且 READY 状态 ```bash kubectl get pod -n sre -o wide # 示例结果 NAME READY STATUS RESTARTS AGE IP NODE deployment-apollo-admin-server-dev-b7bbd657-4d5jx 1/1 Running 0 2d 10.247.4.79 k8s-apollo-node-2 deployment-apollo-admin-server-dev-b7bbd657-lwz5x 1/1 Running 0 2d 10.247.8.7 k8s-apollo-node-3 deployment-apollo-admin-server-dev-b7bbd657-xs4wt 1/1 Running 0 2d 10.247.1.23 k8s-apollo-node-1 deployment-apollo-admin-server-prod-699bbd894f-j977p 1/1 Running 0 2d 10.247.4.83 k8s-apollo-node-2 deployment-apollo-admin-server-prod-699bbd894f-n9m54 1/1 Running 0 2d 10.247.8.11 k8s-apollo-node-3 deployment-apollo-admin-server-prod-699bbd894f-vs56w 1/1 Running 0 2d 10.247.1.27 k8s-apollo-node-1 deployment-apollo-admin-server-test-beta-7c855cd4f5-9br65 1/1 Running 0 2d 10.247.1.25 k8s-apollo-node-1 deployment-apollo-admin-server-test-beta-7c855cd4f5-cck5g 1/1 Running 0 2d 10.247.8.9 k8s-apollo-node-3 deployment-apollo-admin-server-test-beta-7c855cd4f5-x6gt4 1/1 Running 0 2d 10.247.4.81 k8s-apollo-node-2 deployment-apollo-portal-server-6d4bbc879c-bv7cn 1/1 Running 0 2d 10.247.8.12 k8s-apollo-node-3 deployment-apollo-portal-server-6d4bbc879c-c4zrb 1/1 Running 0 2d 10.247.1.28 k8s-apollo-node-1 deployment-apollo-portal-server-6d4bbc879c-qm4mn 1/1 Running 0 2d 10.247.4.84 k8s-apollo-node-2 statefulset-apollo-config-server-dev-0 1/1 Running 0 2d 10.247.8.6 k8s-apollo-node-3 statefulset-apollo-config-server-dev-1 1/1 Running 0 2d 10.247.4.78 k8s-apollo-node-2 statefulset-apollo-config-server-dev-2 1/1 Running 0 2d 10.247.1.22 k8s-apollo-node-1 statefulset-apollo-config-server-prod-0 1/1 Running 0 2d 10.247.8.10 k8s-apollo-node-3 statefulset-apollo-config-server-prod-1 1/1 Running 0 2d 10.247.4.82 k8s-apollo-node-2 statefulset-apollo-config-server-prod-2 1/1 Running 0 2d 10.247.1.26 k8s-apollo-node-1 statefulset-apollo-config-server-test-beta-0 1/1 Running 0 2d 10.247.8.8 k8s-apollo-node-3 statefulset-apollo-config-server-test-beta-1 1/1 Running 0 2d 10.247.4.80 k8s-apollo-node-2 statefulset-apollo-config-server-test-beta-2 1/1 Running 0 2d 10.247.1.24 k8s-apollo-node-1 ``` ### 2.4 访问 apollo service - server 端(即 portal) <br/> &nbsp;&nbsp;&nbsp;&nbsp;kubernetes-master-ip:30001 - client 端, 在 client 端无需再实现负载均衡 <br/> Dev<br/> &nbsp;&nbsp;&nbsp;&nbsp;kubernetes-master-ip:30002 <br/> Test-Alpha <br/> &nbsp;&nbsp;&nbsp;&nbsp;kubernetes-master-ip:30003 <br/> Test-Beta <br/> &nbsp;&nbsp;&nbsp;&nbsp;kubernetes-master-ip:30004 <br/> Prod <br/> &nbsp;&nbsp;&nbsp;&nbsp;kubernetes-master-ip:30005 <br/> # FAQ ## 关于修改的 Dockerfile 添加 ENV 和 entrypoint.sh, 启动 server 需要的配置, 在 kubernetes yaml 文件中可以通过 configmap 传入、也可以通过 ENV 传入 关于 Dockerfile、entrypoint.sh 具体内容, 你可以查看文件里的内容 ## 关于 kubernetes yaml 文件 具体内容请查看 `scripts/apollo-on-kubernetes/kubernetes/service-apollo-portal-server.yaml` 注释 <br/> 其他类似。 ## 关于 eureka.service.url 使用 meta-server(即 config-server) 的 pod name, config-server 务必使用 statefulset。 格式为:`http://<config server pod名>.<meta server 服务名>:<meta server端口号>/eureka/`。 以 apollo-env-dev 为例: ```bash ('eureka.service.url', 'default', 'http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-1.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-2.service-apollo-meta-server-dev:8080/eureka/', 'Eureka服务Url,多个service以英文逗号分隔') ``` 你可以精简 config-server pod 的 name, 示例的长名字是为了更好的阅读与理解。 ### 方式一:通过Spring Boot文件 application-github.properties配置(推荐) 推荐此方式配置 `eureka.service.url`,因为可以通过ConfigMap的方式传入容器,无需再修改数据库的字段。 Admin Server的配置: ```yaml --- # configmap for apollo-admin-server-dev kind: ConfigMap apiVersion: v1 metadata: namespace: sre name: configmap-apollo-admin-server-dev data: application-github.properties: | spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-dev-env-mariadb.sre:3306/DevApolloConfigDB?characterEncoding=utf8 spring.datasource.username = root spring.datasource.password = test eureka.service.url = http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-1.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-2.service-apollo-meta-server-dev:8080/eureka/ ``` Config Server的配置: ```yaml --- # configmap for apollo-config-server-dev kind: ConfigMap apiVersion: v1 metadata: namespace: sre name: configmap-apollo-config-server-dev data: application-github.properties: | spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-dev-env-mariadb.sre:3306/DevApolloConfigDB?characterEncoding=utf8 spring.datasource.username = root spring.datasource.password = m6bCdQXa00 eureka.service.url = http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-1.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-2.service-apollo-meta-server-dev:8080/eureka/ ``` ### 方式二:修改数据表 ApolloConfigDB.ServerConfig 修改数据库表 ApolloConfigDB.ServerConfig的 eureka.service.url。
-1
apolloconfig/apollo
3,489
doc update
## What's the purpose of this PR add known users and adjust sidebar Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
nobodyiam
"2021-01-10T09:40:04Z"
"2021-01-10T09:40:32Z"
dbe243dec3b56d398c0627add53b5ec2c0ac92cb
b4188031befb158dc9f3b37bcec08af3663e8522
doc update. ## What's the purpose of this PR add known users and adjust sidebar Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./docs/zh/design/apollo-introduction.md
# &nbsp; # 1、What is Apollo ## 1.1 背景 随着程序功能的日益复杂,程序的配置日益增多:各种功能的开关、参数的配置、服务器的地址…… 对程序配置的期望值也越来越高:配置修改后实时生效,灰度发布,分环境、分集群管理配置,完善的权限、审核机制…… 在这样的大环境下,传统的通过配置文件、数据库等方式已经越来越无法满足开发人员对配置管理的需求。 Apollo配置中心应运而生! ## 1.2 Apollo简介 Apollo(阿波罗)是携程框架部门研发的开源配置管理中心,能够集中化管理应用不同环境、不同集群的配置,配置修改后能够实时推送到应用端,并且具备规范的权限、流程治理等特性。 Apollo支持4个维度管理Key-Value格式的配置: 1. application (应用) 2. environment (环境) 3. cluster (集群) 4. namespace (命名空间) 同时,Apollo基于开源模式开发,开源地址:<a href="https://github.com/ctripcorp/apollo" target="_blank">https://github.com/ctripcorp/apollo</a> ## 1.2 配置基本概念 既然Apollo定位于配置中心,那么在这里有必要先简单介绍一下什么是配置。 按照我们的理解,配置有以下几个属性: * **配置是独立于程序的只读变量** * 配置首先是独立于程序的,同一份程序在不同的配置下会有不同的行为。 * 其次,配置对于程序是只读的,程序通过读取配置来改变自己的行为,但是程序不应该去改变配置。 * 常见的配置有:DB Connection Str、Thread Pool Size、Buffer Size、Request Timeout、Feature Switch、Server Urls等。 * **配置伴随应用的整个生命周期** * 配置贯穿于应用的整个生命周期,应用在启动时通过读取配置来初始化,在运行时根据配置调整行为。 * **配置可以有多种加载方式** * 配置也有很多种加载方式,常见的有程序内部hard code,配置文件,环境变量,启动参数,基于数据库等 * **配置需要治理** * 权限控制 * 由于配置能改变程序的行为,不正确的配置甚至能引起灾难,所以对配置的修改必须有比较完善的权限控制 * 不同环境、集群配置管理 * 同一份程序在不同的环境(开发,测试,生产)、不同的集群(如不同的数据中心)经常需要有不同的配置,所以需要有完善的环境、集群配置管理 * 框架类组件配置管理 * 还有一类比较特殊的配置 - 框架类组件配置,比如CAT客户端的配置。 * 虽然这类框架类组件是由其他团队开发、维护,但是运行时是在业务实际应用内的,所以本质上可以认为框架类组件也是应用的一部分。 * 这类组件对应的配置也需要有比较完善的管理方式。 # 2、Why Apollo 正是基于配置的特殊性,所以Apollo从设计之初就立志于成为一个有治理能力的配置发布平台,目前提供了以下的特性: * **统一管理不同环境、不同集群的配置** * Apollo提供了一个统一界面集中式管理不同环境(environment)、不同集群(cluster)、不同命名空间(namespace)的配置。 * 同一份代码部署在不同的集群,可以有不同的配置,比如zookeeper的地址等 * 通过命名空间(namespace)可以很方便地支持多个不同应用共享同一份配置,同时还允许应用对共享的配置进行覆盖 * **配置修改实时生效(热发布)** * 用户在Apollo修改完配置并发布后,客户端能实时(1秒)接收到最新的配置,并通知到应用程序 * **版本发布管理** * 所有的配置发布都有版本概念,从而可以方便地支持配置的回滚 * **灰度发布** * 支持配置的灰度发布,比如点了发布后,只对部分应用实例生效,等观察一段时间没问题后再推给所有应用实例 * **权限管理、发布审核、操作审计** * 应用和配置的管理都有完善的权限管理机制,对配置的管理还分为了编辑和发布两个环节,从而减少人为的错误。 * 所有的操作都有审计日志,可以方便地追踪问题 * **客户端配置信息监控** * 可以在界面上方便地看到配置在被哪些实例使用 * **提供Java和.Net原生客户端** * 提供了Java和.Net的原生客户端,方便应用集成 * 支持Spring Placeholder, Annotation和Spring Boot的ConfigurationProperties,方便应用使用(需要Spring 3.1.1+) * 同时提供了Http接口,非Java和.Net应用也可以方便地使用 * **提供开放平台API** * Apollo自身提供了比较完善的统一配置管理界面,支持多环境、多数据中心配置管理、权限、流程治理等特性。不过Apollo出于通用性考虑,不会对配置的修改做过多限制,只要符合基本的格式就能保存,不会针对不同的配置值进行针对性的校验,如数据库用户名、密码,Redis服务地址等 * 对于这类应用配置,Apollo支持应用方通过开放平台API在Apollo进行配置的修改和发布,并且具备完善的授权和权限控制 * **部署简单** * 配置中心作为基础服务,可用性要求非常高,这就要求Apollo对外部依赖尽可能地少 * 目前唯一的外部依赖是MySQL,所以部署非常简单,只要安装好Java和MySQL就可以让Apollo跑起来 * Apollo还提供了打包脚本,一键就可以生成所有需要的安装包,并且支持自定义运行时参数 # 3、Apollo at a glance ## 3.1 基础模型 如下即是Apollo的基础模型: 1. 用户在配置中心对配置进行修改并发布 2. 配置中心通知Apollo客户端有配置更新 3. Apollo客户端从配置中心拉取最新的配置、更新本地配置并通知到应用 ![basic-architecture](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/basic-architecture.png) ## 3.2 界面概览 ![apollo-home-screenshot](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-home-screenshot.png) 上图是Apollo配置中心中一个项目的配置首页 * 在页面左上方的环境列表模块展示了所有的环境和集群,用户可以随时切换。 * 页面中央展示了两个namespace(application和FX.apollo)的配置信息,默认按照表格模式展示、编辑。用户也可以切换到文本模式,以文件形式查看、编辑。 * 页面上可以方便地进行发布、回滚、灰度、授权、查看更改历史和发布历史等操作 ## 3.3 添加/修改配置项 用户可以通过配置中心界面方便的添加/修改配置项,更多使用说明请参见[应用接入指南](zh/usage/apollo-user-guide) ![edit-item-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/edit-item-entry.png) 输入配置信息: ![edit-item](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/edit-item.png) ## 3.4 发布配置 通过配置中心发布配置: ![publish-items](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/publish-items-entry.png) 填写发布信息: ![publish-items](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/publish-items.png) ## 3.5 客户端获取配置(Java API样例) 配置发布后,就能在客户端获取到了,以Java为例,获取配置的示例代码如下。Apollo客户端还支持和Spring整合,更多客户端使用说明请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)和[.Net客户端使用指南](zh/usage/dotnet-sdk-user-guide)。 ```java Config config = ConfigService.getAppConfig(); Integer defaultRequestTimeout = 200; Integer requestTimeout = config.getIntProperty("requestTimeout", defaultRequestTimeout); ``` ## 3.6 客户端监听配置变化 通过上述获取配置代码,应用就能实时获取到最新的配置了。 不过在某些场景下,应用还需要在配置变化时获得通知,比如数据库连接的切换等,所以Apollo还提供了监听配置变化的功能,Java示例如下: ```java Config config = ConfigService.getAppConfig(); config.addChangeListener(new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { for (String key : changeEvent.changedKeys()) { ConfigChange change = changeEvent.getChange(key); System.out.println(String.format( "Found change - key: %s, oldValue: %s, newValue: %s, changeType: %s", change.getPropertyName(), change.getOldValue(), change.getNewValue(), change.getChangeType())); } } }); ``` ## 3.7 Spring集成样例 Apollo和Spring也可以很方便地集成,只需要标注`@EnableApolloConfig`后就可以通过`@Value`获取配置信息: ```java @Configuration @EnableApolloConfig public class AppConfig {} ``` ```java @Component public class SomeBean { //timeout的值会自动更新 @Value("${request.timeout:200}") private int timeout; } ``` # 4、Apollo in depth 通过上面的介绍,相信大家已经对Apollo有了一个初步的了解,并且相信已经覆盖到了大部分的使用场景。 接下来会主要介绍Apollo的cluster管理(集群)、namespace管理(命名空间)和对应的配置获取规则。 ## 4.1 Core Concepts 在介绍高级特性前,我们有必要先来了解一下Apollo中的几个核心概念: 1. **application (应用)** * 这个很好理解,就是实际使用配置的应用,Apollo客户端在运行时需要知道当前应用是谁,从而可以去获取对应的配置 * 每个应用都需要有唯一的身份标识 -- appId,我们认为应用身份是跟着代码走的,所以需要在代码中配置,具体信息请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)。 2. **environment (环境)** * 配置对应的环境,Apollo客户端在运行时需要知道当前应用处于哪个环境,从而可以去获取应用的配置 * 我们认为环境和代码无关,同一份代码部署在不同的环境就应该能够获取到不同环境的配置 * 所以环境默认是通过读取机器上的配置(server.properties中的env属性)指定的,不过为了开发方便,我们也支持运行时通过System Property等指定,具体信息请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)。 3. **cluster (集群)** * 一个应用下不同实例的分组,比如典型的可以按照数据中心分,把上海机房的应用实例分为一个集群,把北京机房的应用实例分为另一个集群。 * 对不同的cluster,同一个配置可以有不一样的值,如zookeeper地址。 * 集群默认是通过读取机器上的配置(server.properties中的idc属性)指定的,不过也支持运行时通过System Property指定,具体信息请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)。 4. **namespace (命名空间)** * 一个应用下不同配置的分组,可以简单地把namespace类比为文件,不同类型的配置存放在不同的文件中,如数据库配置文件,RPC配置文件,应用自身的配置文件等 * 应用可以直接读取到公共组件的配置namespace,如DAL,RPC等 * 应用也可以通过继承公共组件的配置namespace来对公共组件的配置做调整,如DAL的初始数据库连接数 ## 4.2 自定义Cluster > 【本节内容仅对应用需要对不同集群应用不同配置才需要,如没有相关需求,可以跳过本节】 比如我们有应用在A数据中心和B数据中心都有部署,那么如果希望两个数据中心的配置不一样的话,我们可以通过新建cluster来解决。 ### 4.2.1 新建Cluster 新建Cluster只有项目的管理员才有权限,管理员可以在页面左侧看到“添加集群”按钮。 ![create-cluster](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-cluster.png) 点击后就进入到集群添加页面,一般情况下可以按照数据中心来划分集群,如SHAJQ、SHAOY等。 不过也支持自定义集群,比如可以为A机房的某一台机器和B机房的某一台机创建一个集群,使用一套配置。 ![create-cluster-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-cluster-detail.png) ### 4.2.2 在Cluster中添加配置并发布 集群添加成功后,就可以为该集群添加配置了,首先需要按照下图所示切换到SHAJQ集群,之后配置添加流程和[3.3 添加/修改配置项](#_33-添加修改配置项)一样,这里就不再赘述了。 ![cluster-created](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/cluster-created.png) ### 4.2.3 指定应用实例所属的Cluster Apollo会默认使用应用实例所在的数据中心作为cluster,所以如果两者一致的话,不需要额外配置。 如果cluster和数据中心不一致的话,那么就需要通过System Property方式来指定运行时cluster: * -Dapollo.cluster=SomeCluster * 这里注意`apollo.cluster`为全小写 ## 4.3 自定义Namespace > 【本节仅对公共组件配置或需要多个应用共享配置才需要,如没有相关需求,可以跳过本节】 如果应用有公共组件(如hermes-producer,cat-client等)供其它应用使用,就需要通过自定义namespace来实现公共组件的配置。 ### 4.3.1 新建Namespace 以hermes-producer为例,需要先新建一个namespace,新建namespace只有项目的管理员才有权限,管理员可以在页面左侧看到“添加Namespace”按钮。 ![create-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-namespace.png) 点击后就进入namespace添加页面,Apollo会把应用所属的部门作为namespace的前缀,如FX。 ![create-namespace-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-namespace-detail.png) ### 4.3.2 关联到环境和集群 Namespace创建完,需要选择在哪些环境和集群下使用 ![link-namespace-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/link-namespace-detail.png) ### 4.3.3 在Namespace中添加配置项 接下来在这个新建的namespace下添加配置项 ![add-item-in-new-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/add-item-in-new-namespace.png) 添加完成后就能在FX.Hermes.Producer的namespace中看到配置。 ![item-created-in-new-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/item-created-in-new-namespace.png) ### 4.3.4 发布namespace的配置 ![publish-items-in-new-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/publish-items-in-new-namespace.png) ### 4.3.5 客户端获取Namespace配置 对自定义namespace的配置获取,稍有不同,需要程序传入namespace的名字。Apollo客户端还支持和Spring整合,更多客户端使用说明请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)和[.Net客户端使用指南](zh/usage/dotnet-sdk-user-guide)。 ```java Config config = ConfigService.getConfig("FX.Hermes.Producer"); Integer defaultSenderBatchSize = 200; Integer senderBatchSize = config.getIntProperty("sender.batchsize", defaultSenderBatchSize); ``` ### 4.3.6 客户端监听Namespace配置变化 ```java Config config = ConfigService.getConfig("FX.Hermes.Producer"); config.addChangeListener(new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { System.out.println("Changes for namespace " + changeEvent.getNamespace()); for (String key : changeEvent.changedKeys()) { ConfigChange change = changeEvent.getChange(key); System.out.println(String.format( "Found change - key: %s, oldValue: %s, newValue: %s, changeType: %s", change.getPropertyName(), change.getOldValue(), change.getNewValue(), change.getChangeType())); } } }); ``` ### 4.3.7 Spring集成样例 ```java @Configuration @EnableApolloConfig("FX.Hermes.Producer") public class AppConfig {} ``` ```java @Component public class SomeBean { //timeout的值会自动更新 @Value("${request.timeout:200}") private int timeout; } ``` ## 4.4 配置获取规则 > 【本节仅当应用自定义了集群或namespace才需要,如无相关需求,可以跳过本节】 在有了cluster概念后,配置的规则就显得重要了。 比如应用部署在A机房,但是并没有在Apollo新建cluster,这个时候Apollo的行为是怎样的? 或者在运行时指定了cluster=SomeCluster,但是并没有在Apollo新建cluster,这个时候Apollo的行为是怎样的? 接下来就来介绍一下配置获取的规则。 ### 4.4.1 应用自身配置的获取规则 当应用使用下面的语句获取配置时,我们称之为获取应用自身的配置,也就是应用自身的application namespace的配置。 ```java Config config = ConfigService.getAppConfig(); ``` 对这种情况的配置获取规则,简而言之如下: 1. 首先查找运行时cluster的配置(通过apollo.cluster指定) 2. 如果没有找到,则查找数据中心cluster的配置 3. 如果还是没有找到,则返回默认cluster的配置 图示如下: ![application-config-precedence](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/application-config-precedence.png) 所以如果应用部署在A数据中心,但是用户没有在Apollo创建cluster,那么获取的配置就是默认cluster(default)的。 如果应用部署在A数据中心,同时在运行时指定了SomeCluster,但是没有在Apollo创建cluster,那么获取的配置就是A数据中心cluster的配置,如果A数据中心cluster没有配置的话,那么获取的配置就是默认cluster(default)的。 ### 4.4.2 公共组件配置的获取规则 以`FX.Hermes.Producer`为例,hermes producer是hermes发布的公共组件。当使用下面的语句获取配置时,我们称之为获取公共组件的配置。 ```java Config config = ConfigService.getConfig("FX.Hermes.Producer"); ``` 对这种情况的配置获取规则,简而言之如下: 1. 首先获取当前应用下的`FX.Hermes.Producer` namespace的配置 2. 然后获取hermes应用下`FX.Hermes.Producer` namespace的配置 3. 上面两部分配置的并集就是最终使用的配置,如有key一样的部分,以当前应用优先 图示如下: ![public-namespace-config-precedence](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/public-namespace-config-precedence.png) 通过这种方式,就实现了对框架类组件的配置管理,框架组件提供方提供配置的默认值,应用如果有特殊需求,可以自行覆盖。 ## 4.5 总体设计 ![overall-architecture](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/overall-architecture.png) 上图简要描述了Apollo的总体设计,我们可以从下往上看: * Config Service提供配置的读取、推送等功能,服务对象是Apollo客户端 * Admin Service提供配置的修改、发布等功能,服务对象是Apollo Portal(管理界面) * Config Service和Admin Service都是多实例、无状态部署,所以需要将自己注册到Eureka中并保持心跳 * 在Eureka之上我们架了一层Meta Server用于封装Eureka的服务发现接口 * Client通过域名访问Meta Server获取Config Service服务列表(IP+Port),而后直接通过IP+Port访问服务,同时在Client侧会做load balance、错误重试 * Portal通过域名访问Meta Server获取Admin Service服务列表(IP+Port),而后直接通过IP+Port访问服务,同时在Portal侧会做load balance、错误重试 * 为了简化部署,我们实际上会把Config Service、Eureka和Meta Server三个逻辑角色部署在同一个JVM进程中 ### 4.5.1 Why Eureka 为什么我们采用Eureka作为服务注册中心,而不是使用传统的zk、etcd呢?我大致总结了一下,有以下几方面的原因: * 它提供了完整的Service Registry和Service Discovery实现 * 首先是提供了完整的实现,并且也经受住了Netflix自己的生产环境考验,相对使用起来会比较省心。 * 和Spring Cloud无缝集成 * 我们的项目本身就使用了Spring Cloud和Spring Boot,同时Spring Cloud还有一套非常完善的开源代码来整合Eureka,所以使用起来非常方便。 * 另外,Eureka还支持在我们应用自身的容器中启动,也就是说我们的应用启动完之后,既充当了Eureka的角色,同时也是服务的提供者。这样就极大的提高了服务的可用性。 * **这一点是我们选择Eureka而不是zk、etcd等的主要原因,为了提高配置中心的可用性和降低部署复杂度,我们需要尽可能地减少外部依赖。** * Open Source * 最后一点是开源,由于代码是开源的,所以非常便于我们了解它的实现原理和排查问题。 ## 4.6 客户端设计 ![client-architecture](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/client-architecture.png) 上图简要描述了Apollo客户端的实现原理: 1. 客户端和服务端保持了一个长连接,从而能第一时间获得配置更新的推送。 2. 客户端还会定时从Apollo配置中心服务端拉取应用的最新配置。 * 这是一个fallback机制,为了防止推送机制失效导致配置不更新 * 客户端定时拉取会上报本地版本,所以一般情况下,对于定时拉取的操作,服务端都会返回304 - Not Modified * 定时频率默认为每5分钟拉取一次,客户端也可以通过在运行时指定System Property: `apollo.refreshInterval`来覆盖,单位为分钟。 3. 客户端从Apollo配置中心服务端获取到应用的最新配置后,会保存在内存中 4. 客户端会把从服务端获取到的配置在本地文件系统缓存一份 * 在遇到服务不可用,或网络不通的时候,依然能从本地恢复配置 5. 应用程序从Apollo客户端获取最新的配置、订阅配置更新通知 ### 4.6.1 配置更新推送实现 前面提到了Apollo客户端和服务端保持了一个长连接,从而能第一时间获得配置更新的推送。 长连接实际上我们是通过Http Long Polling实现的,具体而言: * 客户端发起一个Http请求到服务端 * 服务端会保持住这个连接60秒 * 如果在60秒内有客户端关心的配置变化,被保持住的客户端请求会立即返回,并告知客户端有配置变化的namespace信息,客户端会据此拉取对应namespace的最新配置 * 如果在60秒内没有客户端关心的配置变化,那么会返回Http状态码304给客户端 * 客户端在收到服务端请求后会立即重新发起连接,回到第一步 考虑到会有数万客户端向服务端发起长连,在服务端我们使用了async servlet(Spring DeferredResult)来服务Http Long Polling请求。 ## 4.7 可用性考虑 配置中心作为基础服务,可用性要求非常高,下面的表格描述了不同场景下Apollo的可用性: | 场景 | 影响 | 降级 | 原因 | |------------------------|--------------------------------------|---------------------------------------|-----------------------------------------------------------------------------------------| | 某台config service下线 | 无影响 | | Config service无状态,客户端重连其它config service | | 所有config service下线 | 客户端无法读取最新配置,Portal无影响 | 客户端重启时,可以读取本地缓存配置文件 | | | 某台admin service下线 | 无影响 | | Admin service无状态,Portal重连其它admin service | | 所有admin service下线 | 客户端无影响,portal无法更新配置 | | | | 某台portal下线 | 无影响 | | Portal域名通过slb绑定多台服务器,重试后指向可用的服务器 | | 全部portal下线 | 客户端无影响,portal无法更新配置 | | | | 某个数据中心下线 | 无影响 | | 多数据中心部署,数据完全同步,Meta Server/Portal域名通过slb自动切换到其它存活的数据中心 | # 5、Contribute to Apollo Apollo从开发之初就是以开源模式开发的,所以也非常欢迎有兴趣、有余力的朋友一起加入进来。 服务端开发使用的是Java,基于Spring Cloud和Spring Boot框架。客户端目前提供了Java和.Net两种实现。 Github地址:<a href="https://github.com/ctripcorp/apollo" target="_blank">https://github.com/ctripcorp/apollo</a> 欢迎大家发起Pull Request!
# &nbsp; # 1、What is Apollo ## 1.1 背景 随着程序功能的日益复杂,程序的配置日益增多:各种功能的开关、参数的配置、服务器的地址…… 对程序配置的期望值也越来越高:配置修改后实时生效,灰度发布,分环境、分集群管理配置,完善的权限、审核机制…… 在这样的大环境下,传统的通过配置文件、数据库等方式已经越来越无法满足开发人员对配置管理的需求。 Apollo配置中心应运而生! ## 1.2 Apollo简介 Apollo(阿波罗)是携程框架部门研发的开源配置管理中心,能够集中化管理应用不同环境、不同集群的配置,配置修改后能够实时推送到应用端,并且具备规范的权限、流程治理等特性。 Apollo支持4个维度管理Key-Value格式的配置: 1. application (应用) 2. environment (环境) 3. cluster (集群) 4. namespace (命名空间) 同时,Apollo基于开源模式开发,开源地址:<a href="https://github.com/ctripcorp/apollo" target="_blank">https://github.com/ctripcorp/apollo</a> ## 1.2 配置基本概念 既然Apollo定位于配置中心,那么在这里有必要先简单介绍一下什么是配置。 按照我们的理解,配置有以下几个属性: * **配置是独立于程序的只读变量** * 配置首先是独立于程序的,同一份程序在不同的配置下会有不同的行为。 * 其次,配置对于程序是只读的,程序通过读取配置来改变自己的行为,但是程序不应该去改变配置。 * 常见的配置有:DB Connection Str、Thread Pool Size、Buffer Size、Request Timeout、Feature Switch、Server Urls等。 * **配置伴随应用的整个生命周期** * 配置贯穿于应用的整个生命周期,应用在启动时通过读取配置来初始化,在运行时根据配置调整行为。 * **配置可以有多种加载方式** * 配置也有很多种加载方式,常见的有程序内部hard code,配置文件,环境变量,启动参数,基于数据库等 * **配置需要治理** * 权限控制 * 由于配置能改变程序的行为,不正确的配置甚至能引起灾难,所以对配置的修改必须有比较完善的权限控制 * 不同环境、集群配置管理 * 同一份程序在不同的环境(开发,测试,生产)、不同的集群(如不同的数据中心)经常需要有不同的配置,所以需要有完善的环境、集群配置管理 * 框架类组件配置管理 * 还有一类比较特殊的配置 - 框架类组件配置,比如CAT客户端的配置。 * 虽然这类框架类组件是由其他团队开发、维护,但是运行时是在业务实际应用内的,所以本质上可以认为框架类组件也是应用的一部分。 * 这类组件对应的配置也需要有比较完善的管理方式。 # 2、Why Apollo 正是基于配置的特殊性,所以Apollo从设计之初就立志于成为一个有治理能力的配置发布平台,目前提供了以下的特性: * **统一管理不同环境、不同集群的配置** * Apollo提供了一个统一界面集中式管理不同环境(environment)、不同集群(cluster)、不同命名空间(namespace)的配置。 * 同一份代码部署在不同的集群,可以有不同的配置,比如zookeeper的地址等 * 通过命名空间(namespace)可以很方便地支持多个不同应用共享同一份配置,同时还允许应用对共享的配置进行覆盖 * **配置修改实时生效(热发布)** * 用户在Apollo修改完配置并发布后,客户端能实时(1秒)接收到最新的配置,并通知到应用程序 * **版本发布管理** * 所有的配置发布都有版本概念,从而可以方便地支持配置的回滚 * **灰度发布** * 支持配置的灰度发布,比如点了发布后,只对部分应用实例生效,等观察一段时间没问题后再推给所有应用实例 * **权限管理、发布审核、操作审计** * 应用和配置的管理都有完善的权限管理机制,对配置的管理还分为了编辑和发布两个环节,从而减少人为的错误。 * 所有的操作都有审计日志,可以方便地追踪问题 * **客户端配置信息监控** * 可以在界面上方便地看到配置在被哪些实例使用 * **提供Java和.Net原生客户端** * 提供了Java和.Net的原生客户端,方便应用集成 * 支持Spring Placeholder, Annotation和Spring Boot的ConfigurationProperties,方便应用使用(需要Spring 3.1.1+) * 同时提供了Http接口,非Java和.Net应用也可以方便地使用 * **提供开放平台API** * Apollo自身提供了比较完善的统一配置管理界面,支持多环境、多数据中心配置管理、权限、流程治理等特性。不过Apollo出于通用性考虑,不会对配置的修改做过多限制,只要符合基本的格式就能保存,不会针对不同的配置值进行针对性的校验,如数据库用户名、密码,Redis服务地址等 * 对于这类应用配置,Apollo支持应用方通过开放平台API在Apollo进行配置的修改和发布,并且具备完善的授权和权限控制 * **部署简单** * 配置中心作为基础服务,可用性要求非常高,这就要求Apollo对外部依赖尽可能地少 * 目前唯一的外部依赖是MySQL,所以部署非常简单,只要安装好Java和MySQL就可以让Apollo跑起来 * Apollo还提供了打包脚本,一键就可以生成所有需要的安装包,并且支持自定义运行时参数 # 3、Apollo at a glance ## 3.1 基础模型 如下即是Apollo的基础模型: 1. 用户在配置中心对配置进行修改并发布 2. 配置中心通知Apollo客户端有配置更新 3. Apollo客户端从配置中心拉取最新的配置、更新本地配置并通知到应用 ![basic-architecture](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/basic-architecture.png) ## 3.2 界面概览 ![apollo-home-screenshot](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-home-screenshot.png) 上图是Apollo配置中心中一个项目的配置首页 * 在页面左上方的环境列表模块展示了所有的环境和集群,用户可以随时切换。 * 页面中央展示了两个namespace(application和FX.apollo)的配置信息,默认按照表格模式展示、编辑。用户也可以切换到文本模式,以文件形式查看、编辑。 * 页面上可以方便地进行发布、回滚、灰度、授权、查看更改历史和发布历史等操作 ## 3.3 添加/修改配置项 用户可以通过配置中心界面方便的添加/修改配置项,更多使用说明请参见[应用接入指南](zh/usage/apollo-user-guide) ![edit-item-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/edit-item-entry.png) 输入配置信息: ![edit-item](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/edit-item.png) ## 3.4 发布配置 通过配置中心发布配置: ![publish-items](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/publish-items-entry.png) 填写发布信息: ![publish-items](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/publish-items.png) ## 3.5 客户端获取配置(Java API样例) 配置发布后,就能在客户端获取到了,以Java为例,获取配置的示例代码如下。Apollo客户端还支持和Spring整合,更多客户端使用说明请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)和[.Net客户端使用指南](zh/usage/dotnet-sdk-user-guide)。 ```java Config config = ConfigService.getAppConfig(); Integer defaultRequestTimeout = 200; Integer requestTimeout = config.getIntProperty("requestTimeout", defaultRequestTimeout); ``` ## 3.6 客户端监听配置变化 通过上述获取配置代码,应用就能实时获取到最新的配置了。 不过在某些场景下,应用还需要在配置变化时获得通知,比如数据库连接的切换等,所以Apollo还提供了监听配置变化的功能,Java示例如下: ```java Config config = ConfigService.getAppConfig(); config.addChangeListener(new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { for (String key : changeEvent.changedKeys()) { ConfigChange change = changeEvent.getChange(key); System.out.println(String.format( "Found change - key: %s, oldValue: %s, newValue: %s, changeType: %s", change.getPropertyName(), change.getOldValue(), change.getNewValue(), change.getChangeType())); } } }); ``` ## 3.7 Spring集成样例 Apollo和Spring也可以很方便地集成,只需要标注`@EnableApolloConfig`后就可以通过`@Value`获取配置信息: ```java @Configuration @EnableApolloConfig public class AppConfig {} ``` ```java @Component public class SomeBean { //timeout的值会自动更新 @Value("${request.timeout:200}") private int timeout; } ``` # 4、Apollo in depth 通过上面的介绍,相信大家已经对Apollo有了一个初步的了解,并且相信已经覆盖到了大部分的使用场景。 接下来会主要介绍Apollo的cluster管理(集群)、namespace管理(命名空间)和对应的配置获取规则。 ## 4.1 Core Concepts 在介绍高级特性前,我们有必要先来了解一下Apollo中的几个核心概念: 1. **application (应用)** * 这个很好理解,就是实际使用配置的应用,Apollo客户端在运行时需要知道当前应用是谁,从而可以去获取对应的配置 * 每个应用都需要有唯一的身份标识 -- appId,我们认为应用身份是跟着代码走的,所以需要在代码中配置,具体信息请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)。 2. **environment (环境)** * 配置对应的环境,Apollo客户端在运行时需要知道当前应用处于哪个环境,从而可以去获取应用的配置 * 我们认为环境和代码无关,同一份代码部署在不同的环境就应该能够获取到不同环境的配置 * 所以环境默认是通过读取机器上的配置(server.properties中的env属性)指定的,不过为了开发方便,我们也支持运行时通过System Property等指定,具体信息请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)。 3. **cluster (集群)** * 一个应用下不同实例的分组,比如典型的可以按照数据中心分,把上海机房的应用实例分为一个集群,把北京机房的应用实例分为另一个集群。 * 对不同的cluster,同一个配置可以有不一样的值,如zookeeper地址。 * 集群默认是通过读取机器上的配置(server.properties中的idc属性)指定的,不过也支持运行时通过System Property指定,具体信息请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)。 4. **namespace (命名空间)** * 一个应用下不同配置的分组,可以简单地把namespace类比为文件,不同类型的配置存放在不同的文件中,如数据库配置文件,RPC配置文件,应用自身的配置文件等 * 应用可以直接读取到公共组件的配置namespace,如DAL,RPC等 * 应用也可以通过继承公共组件的配置namespace来对公共组件的配置做调整,如DAL的初始数据库连接数 ## 4.2 自定义Cluster > 【本节内容仅对应用需要对不同集群应用不同配置才需要,如没有相关需求,可以跳过本节】 比如我们有应用在A数据中心和B数据中心都有部署,那么如果希望两个数据中心的配置不一样的话,我们可以通过新建cluster来解决。 ### 4.2.1 新建Cluster 新建Cluster只有项目的管理员才有权限,管理员可以在页面左侧看到“添加集群”按钮。 ![create-cluster](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-cluster.png) 点击后就进入到集群添加页面,一般情况下可以按照数据中心来划分集群,如SHAJQ、SHAOY等。 不过也支持自定义集群,比如可以为A机房的某一台机器和B机房的某一台机创建一个集群,使用一套配置。 ![create-cluster-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-cluster-detail.png) ### 4.2.2 在Cluster中添加配置并发布 集群添加成功后,就可以为该集群添加配置了,首先需要按照下图所示切换到SHAJQ集群,之后配置添加流程和[3.3 添加/修改配置项](#_33-添加修改配置项)一样,这里就不再赘述了。 ![cluster-created](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/cluster-created.png) ### 4.2.3 指定应用实例所属的Cluster Apollo会默认使用应用实例所在的数据中心作为cluster,所以如果两者一致的话,不需要额外配置。 如果cluster和数据中心不一致的话,那么就需要通过System Property方式来指定运行时cluster: * -Dapollo.cluster=SomeCluster * 这里注意`apollo.cluster`为全小写 ## 4.3 自定义Namespace > 【本节仅对公共组件配置或需要多个应用共享配置才需要,如没有相关需求,可以跳过本节】 如果应用有公共组件(如hermes-producer,cat-client等)供其它应用使用,就需要通过自定义namespace来实现公共组件的配置。 ### 4.3.1 新建Namespace 以hermes-producer为例,需要先新建一个namespace,新建namespace只有项目的管理员才有权限,管理员可以在页面左侧看到“添加Namespace”按钮。 ![create-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-namespace.png) 点击后就进入namespace添加页面,Apollo会把应用所属的部门作为namespace的前缀,如FX。 ![create-namespace-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-namespace-detail.png) ### 4.3.2 关联到环境和集群 Namespace创建完,需要选择在哪些环境和集群下使用 ![link-namespace-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/link-namespace-detail.png) ### 4.3.3 在Namespace中添加配置项 接下来在这个新建的namespace下添加配置项 ![add-item-in-new-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/add-item-in-new-namespace.png) 添加完成后就能在FX.Hermes.Producer的namespace中看到配置。 ![item-created-in-new-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/item-created-in-new-namespace.png) ### 4.3.4 发布namespace的配置 ![publish-items-in-new-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/publish-items-in-new-namespace.png) ### 4.3.5 客户端获取Namespace配置 对自定义namespace的配置获取,稍有不同,需要程序传入namespace的名字。Apollo客户端还支持和Spring整合,更多客户端使用说明请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)和[.Net客户端使用指南](zh/usage/dotnet-sdk-user-guide)。 ```java Config config = ConfigService.getConfig("FX.Hermes.Producer"); Integer defaultSenderBatchSize = 200; Integer senderBatchSize = config.getIntProperty("sender.batchsize", defaultSenderBatchSize); ``` ### 4.3.6 客户端监听Namespace配置变化 ```java Config config = ConfigService.getConfig("FX.Hermes.Producer"); config.addChangeListener(new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { System.out.println("Changes for namespace " + changeEvent.getNamespace()); for (String key : changeEvent.changedKeys()) { ConfigChange change = changeEvent.getChange(key); System.out.println(String.format( "Found change - key: %s, oldValue: %s, newValue: %s, changeType: %s", change.getPropertyName(), change.getOldValue(), change.getNewValue(), change.getChangeType())); } } }); ``` ### 4.3.7 Spring集成样例 ```java @Configuration @EnableApolloConfig("FX.Hermes.Producer") public class AppConfig {} ``` ```java @Component public class SomeBean { //timeout的值会自动更新 @Value("${request.timeout:200}") private int timeout; } ``` ## 4.4 配置获取规则 > 【本节仅当应用自定义了集群或namespace才需要,如无相关需求,可以跳过本节】 在有了cluster概念后,配置的规则就显得重要了。 比如应用部署在A机房,但是并没有在Apollo新建cluster,这个时候Apollo的行为是怎样的? 或者在运行时指定了cluster=SomeCluster,但是并没有在Apollo新建cluster,这个时候Apollo的行为是怎样的? 接下来就来介绍一下配置获取的规则。 ### 4.4.1 应用自身配置的获取规则 当应用使用下面的语句获取配置时,我们称之为获取应用自身的配置,也就是应用自身的application namespace的配置。 ```java Config config = ConfigService.getAppConfig(); ``` 对这种情况的配置获取规则,简而言之如下: 1. 首先查找运行时cluster的配置(通过apollo.cluster指定) 2. 如果没有找到,则查找数据中心cluster的配置 3. 如果还是没有找到,则返回默认cluster的配置 图示如下: ![application-config-precedence](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/application-config-precedence.png) 所以如果应用部署在A数据中心,但是用户没有在Apollo创建cluster,那么获取的配置就是默认cluster(default)的。 如果应用部署在A数据中心,同时在运行时指定了SomeCluster,但是没有在Apollo创建cluster,那么获取的配置就是A数据中心cluster的配置,如果A数据中心cluster没有配置的话,那么获取的配置就是默认cluster(default)的。 ### 4.4.2 公共组件配置的获取规则 以`FX.Hermes.Producer`为例,hermes producer是hermes发布的公共组件。当使用下面的语句获取配置时,我们称之为获取公共组件的配置。 ```java Config config = ConfigService.getConfig("FX.Hermes.Producer"); ``` 对这种情况的配置获取规则,简而言之如下: 1. 首先获取当前应用下的`FX.Hermes.Producer` namespace的配置 2. 然后获取hermes应用下`FX.Hermes.Producer` namespace的配置 3. 上面两部分配置的并集就是最终使用的配置,如有key一样的部分,以当前应用优先 图示如下: ![public-namespace-config-precedence](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/public-namespace-config-precedence.png) 通过这种方式,就实现了对框架类组件的配置管理,框架组件提供方提供配置的默认值,应用如果有特殊需求,可以自行覆盖。 ## 4.5 总体设计 ![overall-architecture](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/overall-architecture.png) 上图简要描述了Apollo的总体设计,我们可以从下往上看: * Config Service提供配置的读取、推送等功能,服务对象是Apollo客户端 * Admin Service提供配置的修改、发布等功能,服务对象是Apollo Portal(管理界面) * Config Service和Admin Service都是多实例、无状态部署,所以需要将自己注册到Eureka中并保持心跳 * 在Eureka之上我们架了一层Meta Server用于封装Eureka的服务发现接口 * Client通过域名访问Meta Server获取Config Service服务列表(IP+Port),而后直接通过IP+Port访问服务,同时在Client侧会做load balance、错误重试 * Portal通过域名访问Meta Server获取Admin Service服务列表(IP+Port),而后直接通过IP+Port访问服务,同时在Portal侧会做load balance、错误重试 * 为了简化部署,我们实际上会把Config Service、Eureka和Meta Server三个逻辑角色部署在同一个JVM进程中 ### 4.5.1 Why Eureka 为什么我们采用Eureka作为服务注册中心,而不是使用传统的zk、etcd呢?我大致总结了一下,有以下几方面的原因: * 它提供了完整的Service Registry和Service Discovery实现 * 首先是提供了完整的实现,并且也经受住了Netflix自己的生产环境考验,相对使用起来会比较省心。 * 和Spring Cloud无缝集成 * 我们的项目本身就使用了Spring Cloud和Spring Boot,同时Spring Cloud还有一套非常完善的开源代码来整合Eureka,所以使用起来非常方便。 * 另外,Eureka还支持在我们应用自身的容器中启动,也就是说我们的应用启动完之后,既充当了Eureka的角色,同时也是服务的提供者。这样就极大的提高了服务的可用性。 * **这一点是我们选择Eureka而不是zk、etcd等的主要原因,为了提高配置中心的可用性和降低部署复杂度,我们需要尽可能地减少外部依赖。** * Open Source * 最后一点是开源,由于代码是开源的,所以非常便于我们了解它的实现原理和排查问题。 ## 4.6 客户端设计 ![client-architecture](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/client-architecture.png) 上图简要描述了Apollo客户端的实现原理: 1. 客户端和服务端保持了一个长连接,从而能第一时间获得配置更新的推送。 2. 客户端还会定时从Apollo配置中心服务端拉取应用的最新配置。 * 这是一个fallback机制,为了防止推送机制失效导致配置不更新 * 客户端定时拉取会上报本地版本,所以一般情况下,对于定时拉取的操作,服务端都会返回304 - Not Modified * 定时频率默认为每5分钟拉取一次,客户端也可以通过在运行时指定System Property: `apollo.refreshInterval`来覆盖,单位为分钟。 3. 客户端从Apollo配置中心服务端获取到应用的最新配置后,会保存在内存中 4. 客户端会把从服务端获取到的配置在本地文件系统缓存一份 * 在遇到服务不可用,或网络不通的时候,依然能从本地恢复配置 5. 应用程序从Apollo客户端获取最新的配置、订阅配置更新通知 ### 4.6.1 配置更新推送实现 前面提到了Apollo客户端和服务端保持了一个长连接,从而能第一时间获得配置更新的推送。 长连接实际上我们是通过Http Long Polling实现的,具体而言: * 客户端发起一个Http请求到服务端 * 服务端会保持住这个连接60秒 * 如果在60秒内有客户端关心的配置变化,被保持住的客户端请求会立即返回,并告知客户端有配置变化的namespace信息,客户端会据此拉取对应namespace的最新配置 * 如果在60秒内没有客户端关心的配置变化,那么会返回Http状态码304给客户端 * 客户端在收到服务端请求后会立即重新发起连接,回到第一步 考虑到会有数万客户端向服务端发起长连,在服务端我们使用了async servlet(Spring DeferredResult)来服务Http Long Polling请求。 ## 4.7 可用性考虑 配置中心作为基础服务,可用性要求非常高,下面的表格描述了不同场景下Apollo的可用性: | 场景 | 影响 | 降级 | 原因 | |------------------------|--------------------------------------|---------------------------------------|-----------------------------------------------------------------------------------------| | 某台config service下线 | 无影响 | | Config service无状态,客户端重连其它config service | | 所有config service下线 | 客户端无法读取最新配置,Portal无影响 | 客户端重启时,可以读取本地缓存配置文件 | | | 某台admin service下线 | 无影响 | | Admin service无状态,Portal重连其它admin service | | 所有admin service下线 | 客户端无影响,portal无法更新配置 | | | | 某台portal下线 | 无影响 | | Portal域名通过slb绑定多台服务器,重试后指向可用的服务器 | | 全部portal下线 | 客户端无影响,portal无法更新配置 | | | | 某个数据中心下线 | 无影响 | | 多数据中心部署,数据完全同步,Meta Server/Portal域名通过slb自动切换到其它存活的数据中心 | # 5、Contribute to Apollo Apollo从开发之初就是以开源模式开发的,所以也非常欢迎有兴趣、有余力的朋友一起加入进来。 服务端开发使用的是Java,基于Spring Cloud和Spring Boot框架。客户端目前提供了Java和.Net两种实现。 Github地址:<a href="https://github.com/ctripcorp/apollo" target="_blank">https://github.com/ctripcorp/apollo</a> 欢迎大家发起Pull Request!
-1