Announcement

Collapse
No announcement yet.

Get Action of the request from request_rec

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Get Action of the request from request_rec

    Hi All,

    Is there any built-in method is there to get actual Action(checkout, export, get-dir, update or delete) of the request from the request_rec.

    I have to differentiate the delete request from the propset(svn custom property) request.

    Thanks...

  • #2
    Can anyone please tell me to get the actual action of the request....

    Comment


    • #3
      Hi,

      I assume this is a follow on from your other thread, so what you're looking for is a way for Subversion to log the specific action? If so you have what was discussed in the previous thread, there's also the commit messages that you could parse to get the action taken?

      Comment


      • #4
        Hi,

        This is for allowing/blocking(not for logging) the specific action in apache, as we have to allow the delete action only from specific svn client tool(by using user-agent)... not for all clients.

        How do we allow svn delete operation only for specific client. We are able get the user-agent from request_rec structure. If we allow DELETE method(for delete we have to allow M_DELETE,M_PROPPATCH and M_MERGE), then svn propset(both revision and version) also allowed. How to restrict this ?

        Thanks....

        Comment


        • #5
          I was looking at pre-commit hook script examples to see if there's a way of doing this and I suspect there will be, but deletes are problematic. If you prevent someone from deleting you also prevent them from moving files (as that's the same as a copy file then a delete of the original), however they can delete the contents of a file and commit it empty which would have the same effect.

          Would you be able to specify read only access for these people, and if they need to submit code have them create a patch file which could then be reviewed and committed by a more senior developer?

          Comment


          • #6
            Hi,

            What we supposed to do is to allow the delete operation for specific client tool only like TortoiseSVN(not for specific user) by using User-Agent and need to block the same for all other client tools.

            Is it possible to differentiate the client tool in pre-commit hook ?

            Comment


            • #7
              It's not, no - the commit hooks receive environment variables and the command-line commands (and perameters) that were run, there's no information about the client there.

              Comment


              • #8
                Hi,

                we have to differentiate the svn delete operations from all other request in Apache. So that we can allow/block the operations based on the user-agent of client tool.

                Is it possible to differentiate the delete operation(delete requests from all other requests) in Apache ?
                Last edited by satheesh; 07-30-2014, 09:13 AM.

                Comment


                • #9
                  Yes, as I said the svn commands that are run are passed to the commit hooks so that would be possible

                  Comment


                  • #10
                    What about
                    Originally posted by satheesh View Post
                    What we supposed to do is to allow the delete operation for specific client tool only like TortoiseSVN(not for specific user) by using User-Agent and need to block the same for all other client tools.
                    Is it possible ? this is what exactly we want...
                    Last edited by satheesh; 07-30-2014, 09:42 AM.

                    Comment


                    • #11
                      As I said before:

                      It's not, no - the commit hooks receive environment variables and the command-line commands (and perameters) that were run, there's no information about the client there.
                      You could do it based on the command that's run - that information is sent to the hook scripts. You can't do it based on client though, because that information isn't sent to the hook scripts.

                      Comment


                      • #12
                        I'm not talking about only hook scripts, any possible way in Apache modules.

                        Comment


                        • #13
                          Ah, beg pardon. Yes, that's possible, though bear in mind it's possible to spoof that information.

                          Comment

                          Working...
                          X