Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wrr-cat
apollo
提交
b9bca870
apollo
项目概览
wrr-cat
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b9bca870
编写于
9月 07, 2017
作者:
张
张乐
提交者:
GitHub
9月 07, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #738 from nobodyiam/fix-spring-security-auth
fix for spring security auth table case issue
上级
d62ba3d1
4d0bf71d
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
107 addition
and
103 deletion
+107
-103
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/auth/WebSecurityConfig.java
...om/ctrip/framework/apollo/biz/auth/WebSecurityConfig.java
+4
-1
apollo-configservice/src/test/java/com/ctrip/framework/apollo/ConfigServiceTestConfiguration.java
...trip/framework/apollo/ConfigServiceTestConfiguration.java
+1
-1
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/RestTemplateFactory.java
...ramework/apollo/portal/component/RestTemplateFactory.java
+1
-22
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/UserPO.java
...a/com/ctrip/framework/apollo/portal/entity/po/UserPO.java
+5
-5
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java
...rk/apollo/portal/spi/configuration/AuthConfiguration.java
+37
-41
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/EmailConfiguration.java
...k/apollo/portal/spi/configuration/EmailConfiguration.java
+2
-1
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/MQConfiguration.java
...work/apollo/portal/spi/configuration/MQConfiguration.java
+2
-1
scripts/sql-docker/apolloportaldb.sql
scripts/sql-docker/apolloportaldb.sql
+15
-15
scripts/sql/apolloportaldb.sql
scripts/sql/apolloportaldb.sql
+15
-15
scripts/sql/delta/v060-v062/apolloportaldb-v060-v062.sql
scripts/sql/delta/v060-v062/apolloportaldb-v060-v062.sql
+1
-1
scripts/sql/delta/v080-v090/apolloportaldb-v080-v090.sql
scripts/sql/delta/v080-v090/apolloportaldb-v080-v090.sql
+24
-0
未找到文件。
apollo-
common/src/main/java/com/ctrip/framework/apollo/common
/auth/WebSecurityConfig.java
→
apollo-
biz/src/main/java/com/ctrip/framework/apollo/biz
/auth/WebSecurityConfig.java
浏览文件 @
b9bca870
package
com.ctrip.framework.apollo.common.auth
;
package
com.ctrip.framework.apollo.biz.auth
;
import
com.ctrip.framework.apollo.common.condition.ConditionalOnMissingProfile
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -8,6 +10,7 @@ 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
;
@ConditionalOnMissingProfile
(
"auth"
)
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity
(
prePostEnabled
=
true
)
...
...
apollo-configservice/src/test/java/com/ctrip/framework/apollo/ConfigServiceTestConfiguration.java
浏览文件 @
b9bca870
package
com.ctrip.framework.apollo
;
import
com.ctrip.framework.apollo.
common
.auth.WebSecurityConfig
;
import
com.ctrip.framework.apollo.
biz
.auth.WebSecurityConfig
;
import
com.ctrip.framework.apollo.configservice.ConfigServiceApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/RestTemplateFactory.java
浏览文件 @
b9bca870
package
com.ctrip.framework.apollo.portal.component
;
import
com.google.common.io.BaseEncoding
;
import
com.ctrip.framework.apollo.portal.component.config.PortalConfig
;
import
org.apache.http.Header
;
import
org.apache.http.auth.AuthScope
;
import
org.apache.http.auth.UsernamePasswordCredentials
;
import
org.apache.http.impl.client.BasicCredentialsProvider
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClientBuilder
;
import
org.apache.http.message.BasicHeader
;
import
org.springframework.beans.factory.FactoryBean
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -21,8 +13,6 @@ import org.springframework.stereotype.Component;
import
org.springframework.web.client.RestTemplate
;
import
java.io.UnsupportedEncodingException
;
import
java.util.ArrayList
;
import
java.util.Collection
;
@Component
public
class
RestTemplateFactory
implements
FactoryBean
<
RestTemplate
>,
InitializingBean
{
...
...
@@ -47,18 +37,7 @@ public class RestTemplateFactory implements FactoryBean<RestTemplate>, Initializ
}
public
void
afterPropertiesSet
()
throws
UnsupportedEncodingException
{
Collection
<
Header
>
defaultHeaders
=
new
ArrayList
<
Header
>();
Header
header
=
new
BasicHeader
(
"Authorization"
,
"Basic "
+
BaseEncoding
.
base64
().
encode
(
"apollo:"
.
getBytes
(
"UTF-8"
)));
defaultHeaders
.
add
(
header
);
BasicCredentialsProvider
credentialsProvider
=
new
BasicCredentialsProvider
();
credentialsProvider
.
setCredentials
(
AuthScope
.
ANY
,
new
UsernamePasswordCredentials
(
"apollo"
,
""
));
CloseableHttpClient
httpClient
=
HttpClientBuilder
.
create
().
setDefaultCredentialsProvider
(
credentialsProvider
)
.
setDefaultHeaders
(
defaultHeaders
).
build
();
CloseableHttpClient
httpClient
=
HttpClientBuilder
.
create
().
build
();
restTemplate
=
new
RestTemplate
(
httpMessageConverters
.
getConverters
());
HttpComponentsClientHttpRequestFactory
requestFactory
=
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/UserPO.java
浏览文件 @
b9bca870
...
...
@@ -12,18 +12,18 @@ import javax.persistence.Table;
* @author lepdou 2017-04-08
*/
@Entity
@Table
(
name
=
"
u
sers"
)
@Table
(
name
=
"
U
sers"
)
public
class
UserPO
{
@Id
@GeneratedValue
@Column
(
name
=
"Id"
)
private
long
id
;
@Column
(
name
=
"
u
sername"
,
nullable
=
false
)
@Column
(
name
=
"
U
sername"
,
nullable
=
false
)
private
String
username
;
@Column
(
name
=
"
p
assword"
,
nullable
=
false
)
@Column
(
name
=
"
P
assword"
,
nullable
=
false
)
private
String
password
;
@Column
(
name
=
"
e
nabled"
,
nullable
=
false
)
@Column
(
name
=
"
E
nabled"
,
nullable
=
false
)
private
int
enabled
;
public
long
getId
()
{
...
...
@@ -62,7 +62,7 @@ public class UserPO {
UserInfo
userInfo
=
new
UserInfo
();
userInfo
.
setName
(
this
.
getUsername
());
userInfo
.
setUserId
(
this
.
getUsername
());
userInfo
.
setEmail
(
"apollo
@acme.com"
);
userInfo
.
setEmail
(
this
.
getUsername
()
+
"
@acme.com"
);
return
userInfo
;
}
}
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java
浏览文件 @
b9bca870
...
...
@@ -34,7 +34,6 @@ 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.crypto.password.PasswordEncoder
;
import
org.springframework.security.provisioning.JdbcUserDetailsManager
;
import
org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint
;
...
...
@@ -211,11 +210,11 @@ public class AuthConfiguration {
}
@Bean
public
JdbcUserDetailsManager
jdbcUserDetailsManager
(
DataSource
datasource
)
{
JdbcUserDetailsManager
userDetailsService
=
new
JdbcUserDetailsManager
();
userDetailsService
.
setDataSource
(
datasource
);
return
userDetailsService
;
public
JdbcUserDetailsManager
jdbcUserDetailsManager
(
AuthenticationManagerBuilder
auth
,
DataSource
datasource
)
throws
Exception
{
return
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
()
;
}
@Bean
...
...
@@ -224,42 +223,27 @@ public class AuthConfiguration {
return
new
SpringSecurityUserService
();
}
}
@Order
(
99
)
@Configuration
@Profile
(
"auth"
)
@EnableWebSecurity
@EnableGlobalMethodSecurity
(
prePostEnabled
=
true
)
static
class
SpringSecurityConfigurer
extends
WebSecurityConfigurerAdapter
{
public
static
final
String
USER_ROLE
=
"user"
;
@Autowired
private
DataSource
datasource
;
@Override
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
http
.
csrf
().
disable
();
http
.
headers
().
frameOptions
().
sameOrigin
();
http
.
authorizeRequests
()
.
antMatchers
(
"/openapi/*"
).
permitAll
()
.
antMatchers
(
"/*"
).
hasAnyRole
(
USER_ROLE
);
http
.
formLogin
().
loginPage
(
"/signin"
).
permitAll
().
failureUrl
(
"/signin?#/error"
).
and
().
httpBasic
();
http
.
logout
().
invalidateHttpSession
(
true
).
clearAuthentication
(
true
).
logoutSuccessUrl
(
"/signin?#/logout"
);
http
.
exceptionHandling
().
authenticationEntryPoint
(
new
LoginUrlAuthenticationEntryPoint
(
"/signin"
));
}
@Autowired
public
void
configureGlobal
(
AuthenticationManagerBuilder
auth
,
JdbcUserDetailsManager
userDetailsService
)
throws
Exception
{
PasswordEncoder
encoder
=
new
BCryptPasswordEncoder
();
auth
.
userDetailsService
(
userDetailsService
).
passwordEncoder
(
encoder
);
auth
.
jdbcAuthentication
().
dataSource
(
datasource
).
usersByUsernameQuery
(
"select username,password, enabled from users where username=?"
);
}
@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
(
"/openapi/*"
).
permitAll
()
.
antMatchers
(
"/*"
).
hasAnyRole
(
USER_ROLE
);
http
.
formLogin
().
loginPage
(
"/signin"
).
permitAll
().
failureUrl
(
"/signin?#/error"
).
and
().
httpBasic
();
http
.
logout
().
invalidateHttpSession
(
true
).
clearAuthentication
(
true
).
logoutSuccessUrl
(
"/signin?#/logout"
);
http
.
exceptionHandling
().
authenticationEntryPoint
(
new
LoginUrlAuthenticationEntryPoint
(
"/signin"
));
}
}
...
...
@@ -296,4 +280,16 @@ public class AuthConfiguration {
}
}
@ConditionalOnMissingProfile
(
"auth"
)
@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
();
}
}
}
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/EmailConfiguration.java
浏览文件 @
b9bca870
package
com.ctrip.framework.apollo.portal.spi.configuration
;
import
com.ctrip.framework.apollo.common.condition.ConditionalOnMissingProfile
;
import
com.ctrip.framework.apollo.portal.spi.EmailService
;
import
com.ctrip.framework.apollo.portal.spi.ctrip.CtripEmailService
;
import
com.ctrip.framework.apollo.portal.spi.ctrip.CtripEmailRequestBuilder
;
...
...
@@ -36,7 +37,7 @@ public class EmailConfiguration {
* spring.profiles.active != ctrip
*/
@Configuration
@
Profile
({
"!
ctrip"
})
@
ConditionalOnMissingProfile
({
"
ctrip"
})
public
static
class
DefaultEmailConfiguration
{
@Bean
@ConditionalOnMissingBean
(
EmailService
.
class
)
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/MQConfiguration.java
浏览文件 @
b9bca870
package
com.ctrip.framework.apollo.portal.spi.configuration
;
import
com.ctrip.framework.apollo.common.condition.ConditionalOnMissingProfile
;
import
com.ctrip.framework.apollo.portal.spi.ctrip.CtripMQService
;
import
com.ctrip.framework.apollo.portal.spi.defaultimpl.DefaultMQService
;
...
...
@@ -24,7 +25,7 @@ public class MQConfiguration {
* spring.profiles.active != ctrip
*/
@Configuration
@
Profile
({
"!
ctrip"
})
@
ConditionalOnMissingProfile
({
"
ctrip"
})
public
static
class
DefaultMQConfiguration
{
@Bean
...
...
scripts/sql-docker/apolloportaldb.sql
浏览文件 @
b9bca870
...
...
@@ -276,29 +276,29 @@ CREATE TABLE `UserRole` (
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'用户和role的绑定表'
;
#
Dump
of
table
u
sers
#
Dump
of
table
U
sers
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`
u
sers`
;
DROP
TABLE
IF
EXISTS
`
U
sers`
;
CREATE
TABLE
`
u
sers`
(
CREATE
TABLE
`
U
sers`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`
u
sername`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'用户名'
,
`
p
assword`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'密码'
,
`
e
nabled`
tinyint
(
4
)
DEFAULT
NULL
COMMENT
'是否有效'
,
`
U
sername`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'用户名'
,
`
P
assword`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'密码'
,
`
E
nabled`
tinyint
(
4
)
DEFAULT
NULL
COMMENT
'是否有效'
,
PRIMARY
KEY
(
`Id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COMMENT
=
'用户表'
;
#
Dump
of
table
a
uthorities
#
Dump
of
table
A
uthorities
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`
a
uthorities`
;
DROP
TABLE
IF
EXISTS
`
A
uthorities`
;
CREATE
TABLE
`
a
uthorities`
(
CREATE
TABLE
`
A
uthorities`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`
u
sername`
varchar
(
50
)
NOT
NULL
,
`
a
uthority`
varchar
(
50
)
NOT
NULL
,
`
U
sername`
varchar
(
50
)
NOT
NULL
,
`
A
uthority`
varchar
(
50
)
NOT
NULL
,
PRIMARY
KEY
(
`Id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
...
...
@@ -309,15 +309,15 @@ INSERT INTO `ServerConfig` (`Key`, `Value`, `Comment`)
VALUES
(
'apollo.portal.envs'
,
'dev'
,
'可支持的环境列表'
),
(
'organizations'
,
'[{
\"
orgId
\"
:
\"
全辅导
\"
,
\"
orgName
\"
:
\"
全辅导
\"
},{
\"
orgId
\"
:
\"
全课云
\"
,
\"
orgName
\"
:
\"
全课云
\"
}]'
,
'部门列表'
),
(
'superAdmin'
,
'a
dmin
'
,
'Portal超级管理员'
),
(
'superAdmin'
,
'a
pollo
'
,
'Portal超级管理员'
),
(
'api.readTimeout'
,
'10000'
,
'http接口read timeout'
),
(
'consumer.token.salt'
,
'someSalt'
,
'consumer token salt'
);
INSERT
INTO
`
users`
(
`username`
,
`password`
,
`e
nabled`
)
INSERT
INTO
`
Users`
(
`Username`
,
`Password`
,
`E
nabled`
)
VALUES
(
'a
dmin
'
,
'$2a$10$7r20uS.BQ9uBpf3Baj3uQOZvMVvB1RN3PYoKE94gtz2.WAOuiiwXS'
,
1
);
(
'a
pollo
'
,
'$2a$10$7r20uS.BQ9uBpf3Baj3uQOZvMVvB1RN3PYoKE94gtz2.WAOuiiwXS'
,
1
);
INSERT
INTO
`
authorities`
(
`username`
,
`authority`
)
VALUES
(
'admin
'
,
'ROLE_user'
);
INSERT
INTO
`
Authorities`
(
`Username`
,
`Authority`
)
VALUES
(
'apollo
'
,
'ROLE_user'
);
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */
;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */
;
...
...
scripts/sql/apolloportaldb.sql
浏览文件 @
b9bca870
...
...
@@ -275,29 +275,29 @@ CREATE TABLE `UserRole` (
KEY
`IX_UserId_RoleId`
(
`UserId`
,
`RoleId`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'用户和role的绑定表'
;
#
Dump
of
table
u
sers
#
Dump
of
table
U
sers
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`
u
sers`
;
DROP
TABLE
IF
EXISTS
`
U
sers`
;
CREATE
TABLE
`
u
sers`
(
CREATE
TABLE
`
U
sers`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`
u
sername`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'用户名'
,
`
p
assword`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'密码'
,
`
e
nabled`
tinyint
(
4
)
DEFAULT
NULL
COMMENT
'是否有效'
,
`
U
sername`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'用户名'
,
`
P
assword`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'密码'
,
`
E
nabled`
tinyint
(
4
)
DEFAULT
NULL
COMMENT
'是否有效'
,
PRIMARY
KEY
(
`Id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COMMENT
=
'用户表'
;
#
Dump
of
table
a
uthorities
#
Dump
of
table
A
uthorities
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`
a
uthorities`
;
DROP
TABLE
IF
EXISTS
`
A
uthorities`
;
CREATE
TABLE
`
a
uthorities`
(
CREATE
TABLE
`
A
uthorities`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`
u
sername`
varchar
(
50
)
NOT
NULL
,
`
a
uthority`
varchar
(
50
)
NOT
NULL
,
`
U
sername`
varchar
(
50
)
NOT
NULL
,
`
A
uthority`
varchar
(
50
)
NOT
NULL
,
PRIMARY
KEY
(
`Id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
...
...
@@ -308,15 +308,15 @@ INSERT INTO `ServerConfig` (`Key`, `Value`, `Comment`)
VALUES
(
'apollo.portal.envs'
,
'dev'
,
'可支持的环境列表'
),
(
'organizations'
,
'[{
\"
orgId
\"
:
\"
TEST1
\"
,
\"
orgName
\"
:
\"
样例部门1
\"
},{
\"
orgId
\"
:
\"
TEST2
\"
,
\"
orgName
\"
:
\"
样例部门2
\"
}]'
,
'部门列表'
),
(
'superAdmin'
,
'a
dmin
'
,
'Portal超级管理员'
),
(
'superAdmin'
,
'a
pollo
'
,
'Portal超级管理员'
),
(
'api.readTimeout'
,
'10000'
,
'http接口read timeout'
),
(
'consumer.token.salt'
,
'someSalt'
,
'consumer token salt'
);
INSERT
INTO
`
users`
(
`username`
,
`password`
,
`e
nabled`
)
INSERT
INTO
`
Users`
(
`Username`
,
`Password`
,
`E
nabled`
)
VALUES
(
'a
dmin
'
,
'$2a$10$7r20uS.BQ9uBpf3Baj3uQOZvMVvB1RN3PYoKE94gtz2.WAOuiiwXS'
,
1
);
(
'a
pollo
'
,
'$2a$10$7r20uS.BQ9uBpf3Baj3uQOZvMVvB1RN3PYoKE94gtz2.WAOuiiwXS'
,
1
);
INSERT
INTO
`
authorities`
(
`username`
,
`authority`
)
VALUES
(
'admin
'
,
'ROLE_user'
);
INSERT
INTO
`
Authorities`
(
`Username`
,
`Authority`
)
VALUES
(
'apollo
'
,
'ROLE_user'
);
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */
;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */
;
...
...
scripts/sql/delta/v060-v062/apolloportaldb-v060-v062.sql
浏览文件 @
b9bca870
#
delta
schema
to
upgrade
apollo
config
db
from
v0
.
6
.
0
to
v0
.
6
.
2
#
delta
schema
to
upgrade
apollo
portal
db
from
v0
.
6
.
0
to
v0
.
6
.
2
Use
ApolloPortalDB
;
...
...
scripts/sql/delta/v080-v090/apolloportaldb-v080-v090.sql
0 → 100644
浏览文件 @
b9bca870
#
delta
schema
to
upgrade
apollo
portal
db
from
v0
.
8
.
0
to
v0
.
9
.
0
Use
ApolloPortalDB
;
CREATE
TABLE
`Users`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`Username`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'用户名'
,
`Password`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'密码'
,
`Enabled`
tinyint
(
4
)
DEFAULT
NULL
COMMENT
'是否有效'
,
PRIMARY
KEY
(
`Id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COMMENT
=
'用户表'
;
CREATE
TABLE
`Authorities`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`Username`
varchar
(
50
)
NOT
NULL
,
`Authority`
varchar
(
50
)
NOT
NULL
,
PRIMARY
KEY
(
`Id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
INSERT
INTO
`Users`
(
`Username`
,
`Password`
,
`Enabled`
)
VALUES
(
'apollo'
,
'$2a$10$7r20uS.BQ9uBpf3Baj3uQOZvMVvB1RN3PYoKE94gtz2.WAOuiiwXS'
,
1
);
INSERT
INTO
`Authorities`
(
`Username`
,
`Authority`
)
VALUES
(
'apollo'
,
'ROLE_user'
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录