Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Consider re-implementing ProtectedAttributeAssignmentEr ror
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Trevor Turk  
View profile  
 More options Jul 31 2008, 12:12 pm
From: Trevor Turk <trevort...@gmail.com>
Date: Thu, 31 Jul 2008 09:12:39 -0700 (PDT)
Local: Thurs, Jul 31 2008 12:12 pm
Subject: Consider re-implementing ProtectedAttributeAssignmentError
A gotcha that has bitten me quite a few times - when you try to mass-
assign a protected attribute, it fails "silently" (but appears in the
debug log). There is some useful discussion about this subject here:

http://dev.rubyonrails.org/ticket/9966

But I thought this worth bringing up after seeing this commit:

http://github.com/rails/rails/commit/108db00aa90fe266564483ab301cf066...

Perhaps this protected attribute assignment error is worth revisiting
with the addition of the extremely handy rescue_from additions that
have made their way into core?

http://github.com/rails/rails/commit/90c930f45c5c6766306929241462ffff...

Of course, I'm getting better about remembering to add attributes via
attr_accessible after being bitten by this one a few times, but
perhaps others have been confounded by this gotcha as well?

Thanks,
- Trevor


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Cruft  
View profile  
 More options Aug 1 2008, 9:02 am
From: Chris Cruft <c...@hapgoods.com>
Date: Fri, 1 Aug 2008 06:02:42 -0700 (PDT)
Local: Fri, Aug 1 2008 9:02 am
Subject: Re: Consider re-implementing ProtectedAttributeAssignmentError
I like the idea of assignment to a protected attribute being an
exception.  I kinda grok the link to ARes, but it seems that the
change in AR is overly "practical" and doesn't pass the sniff test:
assigning to a protected attribute looks like an exception, it can be
severe (security-wise) and it used to be an exception.

On Jul 31, 12:12 pm, Trevor Turk <trevort...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Koziarski  
View profile  
 More options Aug 4 2008, 9:08 am
From: "Michael Koziarski" <mich...@koziarski.com>
Date: Mon, 4 Aug 2008 15:08:36 +0200
Local: Mon, Aug 4 2008 9:08 am
Subject: Re: [Rails-core] Consider re-implementing ProtectedAttributeAssignmentError

The silent dropping of values bugs me, but in this case I think the
cure is worse than the disease.  When we had it enabled previously all
of my exception trackers were spammed with dozens of random junk
coming from adventurous users or broken spam bots.

The current behaviour doesn't have any security related downsides, and
it's just being slightly postel-friendly in the way it behaves.

We could add a hook to make it easier for plugins to handle this
situation, but at present I think it's just a little too annoying for
enabling it by default.

--
Cheers

Koz


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steven A Bristol  
View profile  
 More options Aug 4 2008, 10:28 am
From: "Steven A Bristol" <stevenbris...@gmail.com>
Date: Mon, 4 Aug 2008 10:28:02 -0400
Local: Mon, Aug 4 2008 10:28 am
Subject: Re: [Rails-core] Re: Consider re-implementing ProtectedAttributeAssignmentError

> The silent dropping of values bugs me, but in this case I think the
> cure is worse than the disease.  When we had it enabled previously all
> of my exception trackers were spammed with dozens of random junk
> coming from adventurous users or broken spam bots.

I would love it if this would only raise an exception in
non-production environments.

steven bristol


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Trevor Turk  
View profile  
 More options Aug 4 2008, 7:49 pm
From: Trevor Turk <trevort...@gmail.com>
Date: Mon, 4 Aug 2008 16:49:01 -0700 (PDT)
Local: Mon, Aug 4 2008 7:49 pm
Subject: Re: Consider re-implementing ProtectedAttributeAssignmentError
On Aug 4, 8:08 am, "Michael Koziarski" <mich...@koziarski.com> wrote:

> The silent dropping of values bugs me, but in this case I think the
> cure is worse than the disease...

> We could add a hook to make it easier for plugins to handle this
> situation, but at present I think it's just a little too annoying for
> enabling it by default.

Yeah, I'm not sure this "issue" warrants an exception either. Still,
debugging problems that arise due to about attempts to assign
protected (and perhaps read-only) attributes seems unnecessarily
difficult to me at present. I think I've learned my lesson by now, but
perhaps this is a good target for framework polishing? I'm happy to
work on a patch if there's agreement on a smart way to approach the
problem.

Thanks for your responses all,
- Trevor


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Koziarski  
View profile  
 More options Aug 6 2008, 6:52 am
From: "Michael Koziarski" <mich...@koziarski.com>
Date: Wed, 6 Aug 2008 12:52:54 +0200
Local: Wed, Aug 6 2008 6:52 am
Subject: Re: [Rails-core] Re: Consider re-implementing ProtectedAttributeAssignmentError

> Yeah, I'm not sure this "issue" warrants an exception either. Still,
> debugging problems that arise due to about attempts to assign
> protected (and perhaps read-only) attributes seems unnecessarily
> difficult to me at present. I think I've learned my lesson by now, but
> perhaps this is a good target for framework polishing? I'm happy to
> work on a patch if there's agreement on a smart way to approach the
> problem.

I think the first step might be to prise apart that code so that the
handling of protected attributes is handled in a single method like

def handle_unprotected_attribute_assignment(*attributes)
 logger.something
end

You could then override that method with a plugin to aid with
debugging during dev and test.

> Thanks for your responses all,
> - Trevor

--
Cheers

Koz


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Trevor Turk  
View profile  
 More options Aug 6 2008, 6:30 pm
From: Trevor Turk <trevort...@gmail.com>
Date: Wed, 6 Aug 2008 15:30:29 -0700 (PDT)
Local: Wed, Aug 6 2008 6:30 pm
Subject: Re: Consider re-implementing ProtectedAttributeAssignmentError
On Aug 6, 5:52 am, "Michael Koziarski" <mich...@koziarski.com> wrote:

> I think the first step might be to prise apart that code so that the
> handling of protected attributes is handled in a single method like

> def handle_unprotected_attribute_assignment(*attributes)
>  logger.something
> end

I'll give this a shot.

Thanks for your reply,
- Trevor


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Trevor Turk  
View profile  
 More options Aug 11 2008, 10:53 pm
From: Trevor Turk <trevort...@gmail.com>
Date: Mon, 11 Aug 2008 19:53:53 -0700 (PDT)
Local: Mon, Aug 11 2008 10:53 pm
Subject: Re: Consider re-implementing ProtectedAttributeAssignmentError
On Aug 6, 5:52 am, "Michael Koziarski" <mich...@koziarski.com> wrote:

> I think the first step might be to prise apart that code so that the
> handling of protected attributes is handled in a single method like

> > def handle_unprotected_attribute_assignment(*attributes)
> >  logger.something
> > end

I've attached a patch and example monkey patch over here:

http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/80...

I think this would meet my needs, but it should open up the
possibility for doing other interesting things as well.

Thanks again for your responses all,
- Trevor


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google