GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [apex] New rule to detect inaccessible AuraEnabled getters (summer '21 security update) · Issue #3321 · pmd/pmd

[apex] New rule to detect inaccessible AuraEnabled getters (summer '21 security update) #3321

New issue
Copy link
New issue
Copy link
Closed
#3322
Closed
[apex] New rule to detect inaccessible AuraEnabled getters (summer '21 security update)#3321
#3322
Copy link
Labels
a:new-ruleProposal to add a new built-in rule

Description

@pozil
pozil
opened on Jun 1, 2021
Issue body actions

Proposed Rule Name:
InaccessibleAuraEnabledGetter

Proposed Category:
Error Prone

Description:
In the Summer '21 release, a mandatory security update enforces access modifiers on Apex properties in Lightning component markup. The update prevents access to private or protected Apex getters from Aura and Lightning Web Components.

Code Sample:

// Violating
public class Foo {
    @AuraEnabled
    public Integer counter { private get; set; }

    @AuraEnabled
    public static Foo bar()
    {
        Foo foo = new Foo();
        foo.counter = 2; 
        return foo;
    }
}

public class Foo {
    @AuraEnabled
    public static Baz bar()
    {
    	Baz baz = new Baz();
        baz.counter = 2; 
        return baz;
    }
    
    private class Baz {
        @AuraEnabled
        public Integer counter { protected get; set; }
    }
}

// Compliant
public class Foo {
    @AuraEnabled
    public Integer counter { get; set; }

    @AuraEnabled
    public static Foo bar()
    {
        Foo foo = new Foo();
        foo.counter = 2; 
        return foo;
    }
}

public class Foo {
    @AuraEnabled
    public static Baz bar()
    {
    	Baz baz = new Baz();
        baz.counter = 2; 
        return baz;
    }
    
    private class Baz {
        @AuraEnabled
        public Integer counter { get; set; }
    }
}

Possible Properties:

None.

Reacted by Jonathan Wiesel

Activity

  1. pozil
    added
    a:new-ruleProposal to add a new built-in rule
    on Jun 1, 2021
  2. rsoesemann
    closed this as completedin #3322on Jun 8, 2021
  3. oowekyala
    added a commit that references this issue on Jun 8, 2021

    Update release notes, refs #3322, #3321

    d0d6929
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:new-ruleProposal to add a new built-in rule

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.