Re: [Spacewalk-devel] [PATCH] New global configuration table, to store default organization for externally authenticated users.

2014-01-16 Thread Tomas Lestach
Hello Jan,

we decided to store the global configuration in a different way. See the 
rhnConfiguration table.
I applied your 2nd patch as: 6406c9ce65b8d68ba86cca50955b1cca01219597

Thank you,
--
Tomas Lestach
Red Hat Satellite Engineering, Red Hat


- Original Message -
 From: Jan Pazdziora jpazdzi...@redhat.com
 To: spacewalk-devel@redhat.com
 Sent: Tuesday, January 14, 2014 4:32:32 AM
 Subject: Re: [Spacewalk-devel] [PATCH] New global configuration table, to 
 store default organization for externally
 authenticated users.
 
 On Mon, Jan 13, 2014 at 05:36:16PM +0800, Jan Pazdziora wrote:
  
  please consider the attached patch which creates new global
  rhnConfiguration table (to avoid adding more confiugration options
  to /etc/rhn/rhn.conf) to be able to define which organization
  externally-authenticated users should be created in.
 
 I'll do another attempt of making a patch which actually makes sense.
 
 Also included are two new tables for mapping external groups to
 Spacewalk's local permissions/roles.
 
 --
 Jan Pazdziora
 Principal Software Engineer, Identity Management Engineering, Red Hat
 
 ___
 Spacewalk-devel mailing list
 Spacewalk-devel@redhat.com
 https://www.redhat.com/mailman/listinfo/spacewalk-devel

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


Re: [Spacewalk-devel] [PATCH] New global configuration table, to store default organization for externally authenticated users.

2014-01-16 Thread Jan Pazdziora
On Thu, Jan 16, 2014 at 10:29:12AM -0500, Tomas Lestach wrote:
 
 we decided to store the global configuration in a different way. See the 
 rhnConfiguration table.

OK. Wouldn't it be better thou if its definition was under
schema/spacewalk/common/tables?

 I applied your 2nd patch as: 6406c9ce65b8d68ba86cca50955b1cca01219597

Thank you,

-- 
Jan Pazdziora
Principal Software Engineer, Identity Management Engineering, Red Hat

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


Re: [Spacewalk-devel] [PATCH] New global configuration table, to store default organization for externally authenticated users.

2014-01-16 Thread Tomas Lestach
  we decided to store the global configuration in a different way.
  See the rhnConfiguration table.
 
 OK. Wouldn't it be better thou if its definition was under
 schema/spacewalk/common/tables?

Oh, no!
Sure, it would. Fixed.

Thanks,
Tomas
--
Tomas Lestach
Red Hat Satellite Engineering, Red Hat

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


[Spacewalk-devel] [PATCH] New global configuration table, to store default organization for externally authenticated users.

2014-01-13 Thread Jan Pazdziora

Hello,

please consider the attached patch which creates new global
rhnConfiguration table (to avoid adding more confiugration options
to /etc/rhn/rhn.conf) to be able to define which organization
externally-authenticated users should be created in.

-- 
Jan Pazdziora
Principal Software Engineer, Identity Management Engineering, Red Hat
From cd652fd1045aa2c4f3e5a4219a7bff4421ff7083 Mon Sep 17 00:00:00 2001
From: Jan Pazdziora jpazdzi...@redhat.com
Date: Mon, 13 Jan 2014 17:29:45 +0800
Subject: [PATCH] New global configuration table, to store default organization
 for externally authenticated users.

---
 schema/spacewalk/common/rhnConfiguration.sql   | 35 ++
 .../spacewalk/oracle/triggers/rhnConfiguration.sql | 24 +++
 .../postgres/triggers/rhnConfiguration.sql | 29 ++
 .../040-rhnConfiguration.sql   | 35 ++
 .../041-rhnConfiguration-trigger.sql.oracle| 24 +++
 .../041-rhnConfiguration-trigger.sql.postgresql| 29 ++
 6 files changed, 176 insertions(+)
 create mode 100644 schema/spacewalk/common/rhnConfiguration.sql
 create mode 100644 schema/spacewalk/oracle/triggers/rhnConfiguration.sql
 create mode 100644 schema/spacewalk/postgres/triggers/rhnConfiguration.sql
 create mode 100644 
schema/spacewalk/upgrade/spacewalk-schema-2.0-to-spacewalk-schema-2.1/040-rhnConfiguration.sql
 create mode 100644 
schema/spacewalk/upgrade/spacewalk-schema-2.0-to-spacewalk-schema-2.1/041-rhnConfiguration-trigger.sql.oracle
 create mode 100644 
schema/spacewalk/upgrade/spacewalk-schema-2.0-to-spacewalk-schema-2.1/041-rhnConfiguration-trigger.sql.postgresql

diff --git a/schema/spacewalk/common/rhnConfiguration.sql 
b/schema/spacewalk/common/rhnConfiguration.sql
new file mode 100644
index 000..0b1731f
--- /dev/null
+++ b/schema/spacewalk/common/rhnConfiguration.sql
@@ -0,0 +1,35 @@
+--
+-- Copyright (c) 2014 Red Hat, Inc.
+--
+-- This software is licensed to you under the GNU General Public License,
+-- version 2 (GPLv2). There is NO WARRANTY for this software, express or
+-- implied, including the implied warranties of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+-- along with this software; if not, see
+-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+--
+-- Red Hat trademarks are not licensed under GPLv2. No permission is
+-- granted to use or replicate Red Hat trademarks that are incorporated
+-- in this software or its documentation.
+--
+
+create table rhnOrgConfiguration
+(
+id number not null
+   default (42) not null
+   check(id = 42),
+default_ext_customer_id number
+   constraint rhn_conf_default_org_id_fk
+   references web_customer(id)
+   on delete cascade,
+createdtimestamp with local time zone
+   default (current_timestamp) not null,
+modified   timestamp with local time zone
+   default (current_timestamp) not null
+)
+enable row movement
+;
+
+create unique index rhn_conf_id
+on rhnConfiguration (id)
+tablespace [[8m_tbs]];
diff --git a/schema/spacewalk/oracle/triggers/rhnConfiguration.sql 
b/schema/spacewalk/oracle/triggers/rhnConfiguration.sql
new file mode 100644
index 000..538c6d1
--- /dev/null
+++ b/schema/spacewalk/oracle/triggers/rhnConfiguration.sql
@@ -0,0 +1,24 @@
+--
+-- Copyright (c) 2014 Red Hat, Inc.
+--
+-- This software is licensed to you under the GNU General Public License,
+-- version 2 (GPLv2). There is NO WARRANTY for this software, express or
+-- implied, including the implied warranties of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+-- along with this software; if not, see
+-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+--
+-- Red Hat trademarks are not licensed under GPLv2. No permission is
+-- granted to use or replicate Red Hat trademarks that are incorporated
+-- in this software or its documentation.
+--
+
+create or replace trigger
+rhn_conf_mod_trig
+before insert or update on rhnConfiguration
+for each row
+begin
+:new.modified := current_timestamp;
+end;
+/
+show errors
diff --git a/schema/spacewalk/postgres/triggers/rhnConfiguration.sql 
b/schema/spacewalk/postgres/triggers/rhnConfiguration.sql
new file mode 100644
index 000..b7c6b91
--- /dev/null
+++ b/schema/spacewalk/postgres/triggers/rhnConfiguration.sql
@@ -0,0 +1,29 @@
+-- oracle equivalent source sha1 ebf4903b278ce8c8315da67743451186fb9b8b7a
+--
+-- Copyright (c) 2014 Red Hat, Inc.
+--
+-- This software is licensed to you under the GNU General Public License,
+-- version 2 (GPLv2). There is NO WARRANTY for this software, express or
+-- 

Re: [Spacewalk-devel] [PATCH] New global configuration table, to store default organization for externally authenticated users.

2014-01-13 Thread Jan Pazdziora
On Mon, Jan 13, 2014 at 05:36:16PM +0800, Jan Pazdziora wrote:
 
 please consider the attached patch which creates new global
 rhnConfiguration table (to avoid adding more confiugration options
 to /etc/rhn/rhn.conf) to be able to define which organization
 externally-authenticated users should be created in.

I'll do another attempt of making a patch which actually makes sense.

Also included are two new tables for mapping external groups to
Spacewalk's local permissions/roles.

-- 
Jan Pazdziora
Principal Software Engineer, Identity Management Engineering, Red Hat
From aff19c2fd86a95a4804b8e5e5fa71d531b4ba9c6 Mon Sep 17 00:00:00 2001
From: Jan Pazdziora jpazdzi...@redhat.com
Date: Mon, 13 Jan 2014 17:29:45 +0800
Subject: [PATCH 1/2] New global configuration table, to store default
 organization for externally authenticated users.

---
 .../spacewalk/common/tables/rhnConfiguration.sql   | 34 ++
 schema/spacewalk/common/tables/tables.deps |  1 +
 .../spacewalk/oracle/triggers/rhnConfiguration.sql | 24 +++
 .../postgres/triggers/rhnConfiguration.sql | 29 ++
 .../040-rhnConfiguration.sql   | 34 ++
 .../041-rhnConfiguration-trigger.sql.oracle| 24 +++
 .../041-rhnConfiguration-trigger.sql.postgresql| 29 ++
 7 files changed, 175 insertions(+)
 create mode 100644 schema/spacewalk/common/tables/rhnConfiguration.sql
 create mode 100644 schema/spacewalk/oracle/triggers/rhnConfiguration.sql
 create mode 100644 schema/spacewalk/postgres/triggers/rhnConfiguration.sql
 create mode 100644 
schema/spacewalk/upgrade/spacewalk-schema-2.0-to-spacewalk-schema-2.1/040-rhnConfiguration.sql
 create mode 100644 
schema/spacewalk/upgrade/spacewalk-schema-2.0-to-spacewalk-schema-2.1/041-rhnConfiguration-trigger.sql.oracle
 create mode 100644 
schema/spacewalk/upgrade/spacewalk-schema-2.0-to-spacewalk-schema-2.1/041-rhnConfiguration-trigger.sql.postgresql

diff --git a/schema/spacewalk/common/tables/rhnConfiguration.sql 
b/schema/spacewalk/common/tables/rhnConfiguration.sql
new file mode 100644
index 000..aba0c21
--- /dev/null
+++ b/schema/spacewalk/common/tables/rhnConfiguration.sql
@@ -0,0 +1,34 @@
+--
+-- Copyright (c) 2014 Red Hat, Inc.
+--
+-- This software is licensed to you under the GNU General Public License,
+-- version 2 (GPLv2). There is NO WARRANTY for this software, express or
+-- implied, including the implied warranties of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+-- along with this software; if not, see
+-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+--
+-- Red Hat trademarks are not licensed under GPLv2. No permission is
+-- granted to use or replicate Red Hat trademarks that are incorporated
+-- in this software or its documentation.
+--
+
+create table rhnConfiguration
+(
+id number default (42) not null
+   constraint rhn_conf_single_rec_ck check(id 
= 42),
+default_ext_customer_id number
+   constraint rhn_conf_default_org_id_fk
+   references web_customer(id)
+   on delete cascade,
+createdtimestamp with local time zone
+   default (current_timestamp) not null,
+modified   timestamp with local time zone
+   default (current_timestamp) not null
+)
+enable row movement
+;
+
+create unique index rhn_conf_id
+on rhnConfiguration (id)
+tablespace [[8m_tbs]];
diff --git a/schema/spacewalk/common/tables/tables.deps 
b/schema/spacewalk/common/tables/tables.deps
index 4125c6e..8baf543 100644
--- a/schema/spacewalk/common/tables/tables.deps
+++ b/schema/spacewalk/common/tables/tables.deps
@@ -63,6 +63,7 @@ rhnConfigFile  :: rhnConfigChannel 
rhnConfigFileState rhnConfigF
 rhnConfigFile_foreignkeys  :: rhnConfigRevision
 rhnConfigChannel   :: web_customer rhnConfigChannelType
 rhnConfigRevision  :: rhnConfigFile rhnConfigInfo rhnConfigContent 
rhnConfigFileType
+rhnConfiguration   :: web_customer
 rhnCpu :: rhnServer rhnCpuArch
 rhnCryptoKey   :: rhnCryptoKeyType
 rhnCryptoKeyKickstart  :: rhnCryptoKey rhnKSData
diff --git a/schema/spacewalk/oracle/triggers/rhnConfiguration.sql 
b/schema/spacewalk/oracle/triggers/rhnConfiguration.sql
new file mode 100644
index 000..538c6d1
--- /dev/null
+++ b/schema/spacewalk/oracle/triggers/rhnConfiguration.sql
@@ -0,0 +1,24 @@
+--
+-- Copyright (c) 2014 Red Hat, Inc.
+--
+-- This software is licensed to you under the GNU General Public License,
+-- version 2 (GPLv2). There is NO WARRANTY for this software, express or
+-- implied, including the implied warranties of MERCHANTABILITY or FITNESS
+-- FOR