Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 62415 invoked from network); 24 Dec 2005 18:16:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Dec 2005 18:16:54 -0000 Received: (qmail 6735 invoked by uid 500); 24 Dec 2005 18:16:53 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 6693 invoked by uid 500); 24 Dec 2005 18:16:53 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 6684 invoked by uid 99); 24 Dec 2005 18:16:53 -0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Dec 2005 10:16:52 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 98C68CB for ; Sat, 24 Dec 2005 19:16:31 +0100 (CET) Message-ID: <50952164.1135448191624.JavaMail.jira@ajax.apache.org> Date: Sat, 24 Dec 2005 19:16:31 +0100 (CET) From: "Daniel John Debrunner (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-464) Enhance Derby by adding grant/revoke support. Grant/Revoke provide finner level of privileges than currently provided by Derby that is especially useful in network configurations. In-Reply-To: <1439014097.1121475009861.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-464?page=comments#action_12361221 ] Daniel John Debrunner commented on DERBY-464: --------------------------------------------- Some minor comments on the design spec: spec> DDL statements directly invoke executing mechanism simplify the implementation at the cost of a small increase in execution time. I don't think that's true. DDL''s are not slower due to using a constant action. That's not the reason for the way they are handled. I think the basic idea is that DDL's are limited in structure compared to DML and can easily be represented by an object that represents an action and a set of constants. DDL did generate a java class to execute the constant action but I cleaned that up to use a fixed implementation (sub-class) of BaseActivation , as otherwise each DDL would be generating an identical class. This was wasteful when most DDL is discarded after a single execution. In various tables you have the user name represented (I think) as VARCHAR(30) (GRANTEE, GRANTOR columns). Why 30? In the existing SYSSCHEMAs the user identifer is VARCHAR(128), I think 128 is a better limit for user names. spec> Permission checking is done at execution time. Could you expand on that? Are you going to match the current scheme, permissions checked when an internal ResultSet is created? Something else? spec> The permission checks could be done at compilation time. For the reasons given I think this is a bad idea, the statement cache. I do think we can set it up so that permissions are checked when the statement is prepared by the application, even when it picks up an existing compiled plan. This would be better than per execution of the statement. That's probably a separate discussion once you reveal what you are currently planning. spec > The permission checks could be done at compilation time. PreparedStatements would have to be re-compiled when permissions are revoked, as they are recompiled when tables are altered. Don't you have to recompile statement plans when permissions are revoked or granted? Even if you are checking permissions at execution time? Can you document the locking plans (e.g. what locks does grant get) and the interaction with the dependency system. I think these are key to getting the design right and secure. > Enhance Derby by adding grant/revoke support. Grant/Revoke provide finner level of privileges than currently provided by Derby that is especially useful in network configurations. > ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: DERBY-464 > URL: http://issues.apache.org/jira/browse/DERBY-464 > Project: Derby > Type: New Feature > Components: SQL > Versions: 10.0.2.1, 10.1.1.0, 10.2.0.0 > Environment: generic > Reporter: Satheesh Bandaram > Assignee: Satheesh Bandaram > Attachments: grant.html, grantRevoke.patch.Dec5, grantRevoke.stat.Dec5, grantRevokeDec23.html > > Derby currently provides a very simple permissions scheme, which is quite suitable for an embedded database system. End users of embedded Derby do not see Derby directly; they talk to a application that embeds Derby. So Derby left most of the access control work to the application. Under this scheme, Derby limits access on a per database or per system basis. A user can be granted full, read-only, or no access. > This is less suitable in a general purpose SQL server. When end users or diverse applications can issue SQL commands directly against the database, Derby must provide more precise mechanisms to limit who can do what with the database. > I propose to enhance Derby by implementing a subset of grant/revoke capabilities as specified by the SQL standard. I envision this work to involve the following tasks, at least: > 1) Develop a specification of what capabilities I would like to add to Derby. > 2) Provide a high level implementation scheme. > 3) Pursue a staged development plan, with support for DDL added to Derby first. > 4) Add support for runtime checking of these privileges. > 5) Address migration and upgrade issues from previous releases and from old scheme to newer database. > Since I think this is a large task, I would like to invite any interested people to work with me on this large and important enhancement to Derby. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira