-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
55 changed files
with
1,566 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
AC_INIT([geni-chapi], [1.29], [[email protected]]) | ||
AC_INIT([geni-chapi], [2.1], [[email protected]]) | ||
AM_INIT_AUTOMAKE([foreign -Wall -Wno-portability]) | ||
AC_PROG_MKDIR_P | ||
AC_PROG_INSTALL | ||
|
@@ -20,5 +20,5 @@ AM_CONDITIONAL([GPO_LAB], [test x$gpo_lab = xtrue]) | |
AM_CONDITIONAL(INSTALL_GITHASH, [test -f etc/geni-chapi-githash]) | ||
|
||
AC_CONFIG_FILES([Makefile plugins/Makefile tools/Makefile etc/Makefile]) | ||
AC_CONFIG_FILES([bin/Makefile man/Makefile data/Makefile]) | ||
AC_CONFIG_FILES([bin/Makefile man/Makefile data/Makefile db/Makefile]) | ||
AC_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@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wOwYDVQQDEzRnZW5p | ||
Ly9nbGFiMDc3LmU0LnVrbC5nZXJtYW4tbGFiLmRlLy9nY2YuYXV0aG9yaXR5LnNh | ||
MB4XDTE1MDEwNDIxNTEyMloXDTIwMDEwMzIxNTEyMlowPzE9MDsGA1UEAxM0Z2Vu | ||
aS8vZ2xhYjA3Ny5lNC51a2wuZ2VybWFuLWxhYi5kZS8vZ2NmLmF1dGhvcml0eS5z | ||
YTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAv76cqQLqz1RBVvORMNY0KURt | ||
4KOudBeQDyAQWpEHosYaFY+QR2uSLjxrILdtEekixkMAQmgBE0jFRCDFT7RPfDvV | ||
cu8ZSsurnPJtDjQmKh+L5C74kk1iJPXk1zgmZ15JZi65rJwdWUqkNFj7IVIvcJ3o | ||
/Hj8WoAaIg2zJ40WVSUCAwEAAaOBkzCBkDAPBgNVHRMBAf8EBTADAQH/MH0GA1Ud | ||
EQR2MHSGQ3VybjpwdWJsaWNpZDpJRE4rZ2VuaTpnbGFiMDc3LmU0LnVrbC5nZXJt | ||
YW4tbGFiLmRlOmdjZithdXRob3JpdHkrc2GGLXVybjp1dWlkOjk4NTMwMzhlLTJh | ||
ODUtNGZhZi05ZTkyLTljYzA0ZGJhMzIzNjANBgkqhkiG9w0BAQQFAAOBgQBCy8AO | ||
Nfyyrf5j+pPbjxLhjuoHNkNtlsZDtbMEsa/knoNSYjNChUdQp9beCMfC1MZub8mC | ||
htsjJlYqn++QBpwZTyb3gIEld0PRsT4ibbtkjcgrDKqYulChGmoJ6AO8U8Ijyul+ | ||
foxjB/BExNJkNRxUsnFygV+RtFuPFTPz4Eb+Iw== | ||
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Put the db files in a subdirectory of pkgdatadir | ||
dbdir = $(pkgdatadir)/db | ||
|
||
nobase_dist_db_DATA = \ | ||
cs/postgresql/data.sql \ | ||
cs/postgresql/disable_lockdown.sql \ | ||
cs/postgresql/enable_lockdown.sql \ | ||
cs/postgresql/schema.sql \ | ||
cs/postgresql/update-1.sql \ | ||
cs/postgresql/update-2.sql \ | ||
cs/postgresql/update-3.sql \ | ||
cs/postgresql/update-4.sql \ | ||
cs/postgresql/update-5.sql \ | ||
cs/postgresql/update-6.sql \ | ||
cs/postgresql/update-7.sql \ | ||
cs/postgresql/update-8.sql \ | ||
logging/postgresql/data.sql \ | ||
logging/postgresql/schema.sql \ | ||
logging/postgresql/update-1.sql \ | ||
logging/postgresql/update-2.sql \ | ||
logging/postgresql/update-3.sql \ | ||
ma/postgresql/data.sql \ | ||
ma/postgresql/schema.sql \ | ||
ma/postgresql/update-1.sql \ | ||
ma/postgresql/update-2.sql \ | ||
ma/postgresql/update-3.sql \ | ||
ma/postgresql/update-4.sql \ | ||
ma/postgresql/update-5.sql \ | ||
migration/migrate-assertions.sql \ | ||
migration/sliver-info.sql \ | ||
pa/postgresql/data.sql \ | ||
pa/postgresql/schema.sql \ | ||
pa/postgresql/update-1.sql \ | ||
pa/postgresql/update-2.sql \ | ||
pa/postgresql/update-3.sql \ | ||
pa/postgresql/update-4.sql \ | ||
pa/postgresql/update-5.sql \ | ||
sa/postgresql/data.sql \ | ||
sa/postgresql/README.txt \ | ||
sa/postgresql/schema.sql \ | ||
sa/postgresql/update-1.sql \ | ||
sa/postgresql/update-2.sql \ | ||
sa/postgresql/update-3.sql \ | ||
sr/postgresql/data.sql \ | ||
sr/postgresql/README.txt \ | ||
sr/postgresql/schema.sql \ | ||
sr/postgresql/update-1.sql \ | ||
sr/postgresql/update-2.sql \ | ||
sr/postgresql/update-3.sql \ | ||
sr/postgresql/update-4.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
|
||
-- ---------------------------------------------------------------------- | ||
-- A few initial records to insert into the database | ||
-- ---------------------------------------------------------------------- | ||
|
||
-- Define attributes | ||
INSERT INTO cs_attribute (id, name) values (1, 'LEAD'); | ||
INSERT INTO cs_attribute (id, name) values (2, 'ADMIN'); | ||
INSERT INTO cs_attribute (id, name) values (3, 'MEMBER'); | ||
INSERT INTO cs_attribute (id, name) values (4, 'AUDITOR'); | ||
INSERT INTO cs_attribute (id, name) values (5, 'OPERATOR'); | ||
|
||
-- Define privileges | ||
INSERT INTO cs_privilege (id, name) values (1, 'DELEGATE'); | ||
INSERT INTO cs_privilege (id, name) values (2, 'READ'); | ||
INSERT INTO cs_privilege (id, name) values (3, 'WRITE'); | ||
INSERT INTO cs_privilege (id, name) values (4, 'USE'); | ||
|
||
-- Define context types | ||
insert into cs_context_type (id, name) values (1, 'PROJECT'); | ||
insert into cs_context_type (id, name) values (2, 'SLICE'); | ||
insert into cs_context_type (id, name) values (3, 'RESOURCE'); | ||
insert into cs_context_type (id, name) values (4, 'SERVICE'); | ||
insert into cs_context_type (id, name) values (5, 'MEMBER'); | ||
|
||
-- Define actions | ||
insert into cs_action (name, privilege, context_type) values ('project_read', 2, 1); | ||
insert into cs_action (name, privilege, context_type) values ('project_write', 3, 1); | ||
insert into cs_action (name, privilege, context_type) values ('project_use', 4, 1); | ||
insert into cs_action (name, privilege, context_type) values ('slice_read', 2, 2); | ||
insert into cs_action (name, privilege, context_type) values ('slice_write', 3, 2); | ||
insert into cs_action (name, privilege, context_type) values ('slice_use', 4, 2); | ||
insert into cs_action (name, privilege, context_type) values ('create_project', 3, 3); | ||
insert into cs_action (name, privilege, context_type) values ('administer_members', 3, 5); | ||
|
||
-- Define initial set of policies based on PROJECT/SLICE READ/WRITE/USE | ||
insert into cs_policy (attribute, context_type, privilege) values ('1', '1','2'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('1', '1','3'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('1', '1','4'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('2', '1','2'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('2', '1','3'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('2', '1','4'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('3', '1','2'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('3', '1','4'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('4', '1','2'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '1','2'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '1','3'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '1','4'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('1', '2','2'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('1', '2','3'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('1', '2','4'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('2', '2','2'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('2', '2','3'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('2', '2','4'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('3', '2','2'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('3', '2','4'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('4', '2','2'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '2','2'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '2','3'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '2','4'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('1', '3','3'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '3','1'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '3','2'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '3','3'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '4','1'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '4','2'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '4','3'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '5','1'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '5','2'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '5','3'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '3','4'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '4','4'); | ||
insert into cs_policy (attribute, context_type, privilege) values ('5', '5','4'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
update cs_action set privilege = privilege + 100 where privilege < 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
update cs_action | ||
set privilege = privilege - 100 | ||
where | ||
privilege > 0 and | ||
name in ('create_assertion', | ||
'create_policy' | ||
'create_assertion', | ||
'create_policy', | ||
'renew_assertion', | ||
'delete_policy', | ||
-- 'query_assertions', | ||
-- 'query_policies', | ||
-- 'lookup_slice', | ||
-- 'lookup_slices', | ||
-- 'lookup_slice_ids', | ||
-- 'get_slice_credential', | ||
-- 'add_slivers', | ||
-- 'delete_slivers', | ||
'renew_slice', | ||
-- 'get_slice_members', | ||
-- 'get_slices_for_member', | ||
-- 'lookup_slices_by_ids', | ||
-- 'get_slice_members_for_project', | ||
-- 'list_resources', | ||
-- 'get_services', | ||
-- 'get_services_of_type', | ||
'register_service', | ||
'remove_service', | ||
'create_project', | ||
'delete_project', | ||
-- 'get_projects', | ||
-- 'get_project_by_lead', | ||
-- 'lookup_project', | ||
-- 'update_project', | ||
-- 'get_project_members', | ||
-- 'get_projects_for_member', | ||
'administer_resources', | ||
'administer_services', | ||
'administer_members', | ||
'change_lead', | ||
'add_project_member', | ||
'remove_project_member', | ||
'change_member_role', | ||
'remove_slice_member', | ||
'add_slice_member', | ||
'change_slice_member_role', | ||
'create_slice', | ||
'invite_member', | ||
'modify_slice_membership', | ||
'modify_project_membership'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
-- Tables for CS (Credential Store) of GENI Prototype Clearinghouse | ||
|
||
-- avoid innocuous NOTICEs about automatic sequence creation | ||
set client_min_messages='WARNING'; | ||
|
||
-- Tell psql to stop on an error. Default behavior is to proceed. | ||
\set ON_ERROR_STOP 1 | ||
|
||
-- ---------------------------------------------------------------------- | ||
-- | ||
-- ---------------------------------------------------------------------- | ||
-- Drop the data first, then the type. | ||
DROP TABLE IF EXISTS cs_assertion CASCADE; | ||
DROP TABLE IF EXISTS cs_policy CASCADE; | ||
DROP TABLE IF EXISTS cs_action CASCADE; | ||
DROP TABLE IF EXISTS cs_attribute CASCADE; | ||
DROP TABLE IF EXISTS cs_privilege CASCADE; | ||
DROP TABLE IF EXISTS cs_context_type CASCADE; | ||
|
||
-- List of all known attributes/roles on a principal | ||
CREATE TABLE cs_attribute ( | ||
id SERIAL PRIMARY KEY, | ||
name VARCHAR NOT NULL UNIQUE | ||
); | ||
|
||
-- List of all known privileges that a principal may take | ||
CREATE TABLE cs_privilege ( | ||
id SERIAL PRIMARY KEY, | ||
name VARCHAR NOT NULL UNIQUE | ||
); | ||
|
||
-- A mapping of context type ID to name | ||
CREATE TABLE cs_context_type ( | ||
id SERIAL PRIMARY KEY, | ||
name VARCHAR NOT NULL UNIQUE | ||
); | ||
|
||
-- List of all known actions and the required privilege and context type | ||
CREATE TABLE cs_action ( | ||
id SERIAL PRIMARY KEY, | ||
name VARCHAR NOT NULL, | ||
privilege int, | ||
context_type int NOT NULL REFERENCES cs_context_type(id) | ||
); | ||
|
||
-- An assertion is a signed statement that a given principal has a given | ||
-- attribute, possibly in a given context | ||
CREATE TABLE cs_assertion ( | ||
id SERIAL, | ||
signer UUID, | ||
principal UUID NOT NULL, | ||
attribute INT NOT NULL REFERENCES cs_attribute(id), -- Index into cs_attribute table | ||
context_type INT NOT NULL REFERENCES cs_context_type(id), -- 0 = NONE, 1 = PROJECT, 2 = SLICE, 3 = SLIVER | ||
context UUID, | ||
expiration TIMESTAMP, | ||
assertion_cert VARCHAR, | ||
PRIMARY KEY (id) | ||
); | ||
-- can signer, principal, context by authorities who aren't in tables? | ||
|
||
-- A policy is a signed statement that a given holder of a given attribute | ||
-- has a given privilege. Again, this is potentially context dependent. | ||
CREATE TABLE cs_policy ( | ||
id SERIAL PRIMARY KEY, | ||
signer UUID, | ||
attribute INT NOT NULL REFERENCES cs_attribute(id), -- Index into cs_attribute | ||
context_type INT NOT NULL REFERENCES cs_context_type(id), -- 0 = NONE, 1 = PROJECT, 2 = SLICE, 3 = SLIVER | ||
privilege INT NOT NULL REFERENCES cs_privilege(id), -- Index into cs_privilege | ||
policy_cert VARCHAR | ||
); | ||
|
||
|
Oops, something went wrong.