Skip to content

Commit 39e6b0d

Browse files
committed
Credentials: add sample
1 parent f4a3941 commit 39e6b0d

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
credentials:
2+
users:
3+
admin:
4+
password: 'T0p_Secret_P@$$w0rd'
5+
roles: [ super ]
6+
replicator:
7+
password: 'topsecret'
8+
roles: [ replication ]
9+
storage:
10+
password: 'secret'
11+
roles: [ sharding ]
12+
testuser:
13+
password: '123456'
14+
privileges:
15+
- permissions: [ session ]
16+
- permissions: [ execute ]
17+
lua_eval: true
18+
- permissions: [ read ]
19+
spaces: [ writers, books ]
20+
- permissions: [ read, write ]
21+
spaces: [ writers ]
22+
23+
24+
groups:
25+
group001:
26+
replicasets:
27+
replicaset001:
28+
instances:
29+
instance001:
30+
iproto:
31+
listen:
32+
- uri: '127.0.0.1:3301'
33+
34+
# Load sample data
35+
app:
36+
file: 'myapp.lua'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
instance001:
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
function create_spaces()
2+
box.schema.space.create('writers')
3+
box.space.writers:format({
4+
{ name = 'id', type = 'unsigned' },
5+
{ name = 'name', type = 'string' }
6+
})
7+
box.space.writers:create_index('primary', { parts = { 'id' } })
8+
9+
box.schema.space.create('books')
10+
box.space.books:format({
11+
{ name = 'id', type = 'unsigned' },
12+
{ name = 'title', type = 'string' },
13+
{ name = 'author_id', foreign_key = { space = 'writers', field = 'id' } },
14+
})
15+
box.space.books:create_index('primary', { parts = { 'id' } })
16+
end
17+
18+
function load_data()
19+
box.space.writers:insert { 1, 'Leo Tolstoy' }
20+
box.space.writers:insert { 2, 'Fyodor Dostoevsky' }
21+
box.space.writers:insert { 3, 'Alexander Pushkin' }
22+
23+
box.space.books:insert { 1, 'War and Peace', 1 }
24+
box.space.books:insert { 2, 'Crime and Punishment', 2 }
25+
box.space.books:insert { 3, 'Eugene Onegin', 3 }
26+
end

0 commit comments

Comments
 (0)