pledbrook / grails-shiro

Grails Plugin for the Apache Shiro security framework
grails.org/plugin/shiro
45 stars 62 forks source link

grails-shiro support for grails 3.0.x #44

Closed beneo closed 5 years ago

beneo commented 9 years ago

When will it be ready for support grails 3.0.x ??

thx in advance

ghost commented 9 years ago

Great minds think alike :-) I just reached out to Peter Ledbrook and Peter McNeil - looks like a tentative game plan is in the works sometime very soon. This is a blocker for me so I am interested in seeing this go through.

pmcneil commented 9 years ago

Yep it shouldn't take too much to get it going. Hey either of you like doing doco ;-)

ghost commented 9 years ago

Sure, whatever is needed, just let me know and I'll happily oblige.

ghost commented 9 years ago

Also @pmcneil is this the best forum for detailed discussion/planning? I'm happy to use it but not sure if its the best format; does GitHub have a chat-type feature? IRC? If you'd like me to work on documentation (Groovy Docs, README, Grails plugin docs, etc.) I have quite a number of suggestions/ideas to bounce off of you.

pmcneil commented 9 years ago

This is as good as any, you can always email me if you like.

pmcneil commented 9 years ago

Looking at Grails 3.0 features it might be time to revisit the plugins features, e.g. with regard to

pmcneil commented 9 years ago

Hmm, looking at the upgrade procedure we might be better off creating a new repo instead of a branch. maybe?

pmcneil commented 9 years ago

Re: new repo project thoughts - Pros:

Of course you'd keep checked out branches in separate directories with associated IDE project files... but if you do switch branches it could get messy.

Cons:

Current thinking:

ghost commented 9 years ago

I agree with a branch over a new repo, although I see what you are talking about. Like you said, I think it might make sense to use semver and release this new grails-shiro as 2.0 and then make it patently obvious in the docs that if clients are running Grails 1.x or 2.x, that they need to use a 1.x version of grails-shiro.

pledbrook commented 9 years ago

You can push your own copy of the repo to a new GitHub account/repo while retaining history. In other words, "new repo" doesn't necessarily mean losing history.

I also don't think merging is the right way to do a back port. It's easy enough to create a patch from one repo that can be applied to the other, or at least no more difficult than a merge between branches :smile:

pmcneil commented 9 years ago

In case you're wondering what's happening... been busy at work. Also been trying to get all the original tests working again before porting. (just dependency manager and webdriver issues)

pmcneil commented 9 years ago

@pledbrook by new repo I meant starting a new git project root, thus losing the history. Tracking the moves in the upgrade to 3.0, and perhaps switching branches may cause a bit/lot of confusion (and re-indexing in IDEs...) anyway I'll suck it and see :-)

emacadie commented 9 years ago

Has any progress been made on this?

pmcneil commented 9 years ago

A little, I have a grails three project, that builds. New tests are needed. I got a bit snowed under with work (and waiting for intellij 15 for grails 3 support ;-) )

emacadie commented 9 years ago

If I may make a suggestion: Why not commit it? Perhaps the rest of the world could take a crack at some of the tests.

yellowsnow commented 9 years ago

Hi Gentlemen,

Is there a way I can help test the ongoing work? Is the code available somewhere? I have an app eagerly waiting for the migration. Keep groovying!

Cheers

yellowsnow commented 9 years ago

Hi, I have a work in progress that you can check out here

I'll be happy to here your feedback.

Cheers

pmcneil commented 9 years ago

G'day @yellowsnow, cool. I've pretty much had to drop the ball on this. I' got the project migrated, keeping the old plugin as a separate project... but that's as far as I got.

So I restructured the project into shiro2 and shiro3 directories with the two separate projects.

@emacadie OK I'll just commit what I have done so far, I hadn't done it because I was prepared to just throw it away.

pmcneil commented 9 years ago

OK pushed the restructure, I'm open to pull requests to get this thing going.

yellowsnow commented 9 years ago

Hi,

Just sent a PR for shiro3, this is still work in progress, for now only unit tests are working. I will happilly continue working on it this week untill i see more light.

I've kept both folders shiro2 and shiro3, will they coexist like this? or will there be a different branch for each?

Cheers

emacadie commented 9 years ago

I will try out what YellowSnow and PMcNeil have pushed in a few test projects.

yellowsnow commented 9 years ago

Hi, I have started migrating shiro2 test projects, you can follow the work in progress here. For the moment, it's just partial migration, none of them even compiles.

I propose to hook the travis build on these projects.

If you're ok with that, i have a few questions before further diving into it :

pmcneil commented 9 years ago

Good question. I planned on revisiting the test projects. All those need to be tested, I'd like to combine the integration the testing with documentation ideally so that we test the doco, and document the tests.

grails test-app should be fine, works for me.

I was planning on scripting the tests with gvm to create apps in different grails versions (or at least some different grails version, like 2.4.3 and 2.4.4 which changed a lot).

pmcneil commented 9 years ago

On a side issue, in shiro 3 can we perhaps use application.groovy, not application.yml? Personally don't see the attaction of YAML here.

yellowsnow commented 9 years ago

Yes, definitely, i'd go too for application.groovy.

On Thu, Jul 23, 2015 at 11:04 AM, Peter McNeil notifications@github.com wrote:

On a side issue, in shiro 3 can we perhaps use application.groovy, not application.yml? Personally don't see the attaction of YAML here.

— Reply to this email directly or view it on GitHub https://github.com/pledbrook/grails-shiro/issues/44#issuecomment-124058706 .

mbezjak commented 9 years ago

Just a head's up (to save you some time).

ATM, grails shiro cannot be configured to use native sessions in grails >= 2.3. I assume this also applies for grails 3.x.

Fix is to do this in shiro3: https://github.com/pledbrook/grails-shiro/pull/49

emacadie commented 9 years ago

Not to sound like a pest, but: How do I get this to work?

Every time I try "grails run-app" or "gradle build" in the shiro3 directory, I get something like this:

Error Error occurred running Grails CLI: Bad method call from inside of a branch Exception Details: Location: org/grails/cli/interactive/completers/AllClassCompleter.()V @123: invokespecial Reason: Error exists in the bytecode

I did some googling, and I found a page that suggested I set an environment variable GRAILS_OPTS to "-XX:-UseSplitVerifier -Xverify:none", but it did not help.

yellowsnow commented 9 years ago

@emacadie For the moment, the only thing that have worked for me is gradle test on the plugin located in the ./shiro3/ folder, this solely invokes unit tests.

The whole test suite consists of several apps with their very particular tests, here's the work in progress to upgrade them :

Holidays are unfortunately approaching :smile: i plan to dive into it again by the second half of august.

emacadie commented 9 years ago

@yellowsnow Any updates?

nibin commented 9 years ago

I am also eagerly waiting for this.

yellowsnow commented 9 years ago

Hi, The last PR is about cli-tests which are now working, this means shiro commands will generate the artefacts.

This is the current migration status :

I hope i get the chance to work on those subprojects ASAP, i can't give ETA for the moment as i am rarely dedicated to this project.

PRs are welcome on my repo : https://github.com/Arkilog/grails-shiro/

yellowsnow commented 9 years ago

Hi,

My current focus is on the wildcard-realm subproject

Cheers

yellowsnow commented 9 years ago

Hi,

I am happy with the current progress on #44. As of this PR, the functional tests on wildcard-realm are now working.

This is the current migration status :

The tests are unfortunately broken on the default subproject for grails 2, so i will not migrate it for the moment. My next focus is on migrating annotation-test.

For your information, you can test the project with you grails 3 application by using inline plugin technique : 1- create a settings.gradle file in the parent directory specifying the location of your application and plugin:

include 'myapp', 'grails-shiro'

2- Finally add a dependency in your application's build.gradle on the plugin:

    compile project(":grails-shiro")

Enjoy

yellowsnow commented 9 years ago

@pmcneil annotation-test should be fixed by this commit : Arkilog/grails-shiro@d1660049aae3899de3fedf8e66bb4af512dfe9a7

Would you like me to :

  1. close #52 and put annotation-test and wildcard-realm in one PR?
  2. wait for #52 to be merged to push another PR?

This is the current migration status so far :

Cheers

pmcneil commented 9 years ago

I'll merge 52 now.

On 21/10/15 03:19, yellowsnow wrote:

@pmcneil https://github.com/pmcneil |annotation-test| should be fixed by this commit : Arkilog/grails-shiro@d166004 https://github.com/Arkilog/grails-shiro/commit/d1660049aae3899de3fedf8e66bb4af512dfe9a7

Would you like me to :

  1. close #52 https://github.com/pledbrook/grails-shiro/pull/52 and put |annotation-test| and |wildcard-realm| in one PR?
  2. wait for #52 https://github.com/pledbrook/grails-shiro/pull/52 to be merged to push another PR?

This is the current migration status so far :

Cheers

— Reply to this email directly or view it on GitHub https://github.com/pledbrook/grails-shiro/issues/44#issuecomment-149620846.

web: http://nerderg.com Twitter: http://twitter.com/pmcneil Google+: https://plus.google.com/u/0/communities/110661434396927001866

emacadie commented 9 years ago

Thanks for the updates. I will try this out.

yellowsnow commented 9 years ago

Current migration status so far :

Cheers

yellowsnow commented 9 years ago

Current migration status so far :

Cheers

yellowsnow commented 9 years ago

Hi everybody,

I am happy to announce that the test suite migration is completed :

Please find the migration notes

A release is hopefully possible, what do you think?

PS : @pmcneil & @pledbrook Travis CI Job needs to be enabled on pledbrook/grails-shiro (badge was pointing on Arkilog/grails-shiro)

Cheers

pledbrook commented 9 years ago

@yellowsnow Thanks for all your work. I've enabled the Travis job now. It just needs a commit to trigger it I think (it seems I can't force it to build the project).

yellowsnow commented 9 years ago

Thank you Peter, it was a pleasure working on this migration.

I've learned and still have to learn a lot, i now value more than ever the importance of tests :-)

Cheers

On Mon, Oct 26, 2015 at 4:35 PM, Peter Ledbrook notifications@github.com wrote:

@yellowsnow https://github.com/yellowsnow Thanks for all your work. I've enabled the Travis job now. It just needs a commit to trigger it I think (it seems I can't force it to build the project).

— Reply to this email directly or view it on GitHub https://github.com/pledbrook/grails-shiro/issues/44#issuecomment-151200551 .

yellowsnow commented 9 years ago

@pmcneil @pledbrook

  1. What do you think of the limitations mentioned in the migration notes, as a newbie to shiro internals maybe i was missing something.. are they blocking?
  2. Documentation is crucial, fortunately there's already a plenty of it!! Do we need to convert the format to asciidoc as recommended here? what about hosting in gh-pages?
  3. Plugin version : what about using 2.0.x for Grails 3.x ?
  4. Do you think of other tasks that need to be done before an eventual release?

Cheers

emacadie commented 9 years ago

@yellowsnow Thanks for the work.

What will happen with grails-shiro-ui? That was a very useful plugin.

yellowsnow commented 9 years ago

@emacadie No migration has been done so far, it shouldn't hard to do. Please file an issue here As usual, PR are welcome

pledbrook commented 9 years ago

@yellowsnow It's been so long since I worked with the plugin that I can't offer too much help. But I'll try to answer your questions anyway:

  1. It's about time that the legacy configuration was put to bed. This is a full major version upgrade after all, so it's a good time to get rid of it. It's a bit worrying that tests fail with a change of cookie name. It would be worth investigating why it's happening. Is it only a problem if the new cookie name is JSESSIONID? Perhaps it's conflicting with the HTTP session.
  2. There's no need to convert to Asciidoctor, but it is a nice format to work with and better documented than gdoc. It's only worth migrating if someone has the time to do it though. GitHub Pages is the obvious place to host the docs.
  3. Yes, I think 2.0.x is fine. Probably better to keep the version in sync with Shiro rather than Grails.
  4. Update docs for the new ways of doing things.
yellowsnow commented 9 years ago

@pledbrook Thanks for your answers. Yes i confirm that using the default JSESSIONID as a cookie name breaks these tests :

I tried figuring it out but without success so far, the only workaround was setting cookie name MYSSESSIONID (yes i was really inspired :-) ).

On a side note, the whole project and the test suite work nicely in intelllij community, so anyone who feels brave enough could debug this nasty bug :-)

Cheers

emacadie commented 9 years ago

Thanks for the info.

I will try out the new grails-shiro plugin for a while first. I have to re-learn how to use it.

On Wed, Oct 28, 2015 at 4:28 AM, yellowsnow notifications@github.com wrote:

@emacadie https://github.com/emacadie No migration has been done so far, it shouldn't hard to do. Please file an issue here https://github.com/Arkilog/grails-shiro-ui/issues As usual, PR are welcome

— Reply to this email directly or view it on GitHub https://github.com/pledbrook/grails-shiro/issues/44#issuecomment-151778977 .

pmcneil commented 9 years ago

OK we need to understand what is happening with JSESSIONID in the tests.

Re asciidoc: I like asciidoc it works well, but it's a taks that doesn't need to happen right away unless someone is particularly enthusiastic :-)

@pledbrook I looked at the version numbers when I started, and in this case we need to have two versions of the plugin that can be kept in sync with the shiro plugin. So I/we thought making the plugin major version keep up with Grails was the go as it will be less confusing about which version to use, i.e. use version 3.x for grails 3.x and 2.x for grails 2.x and the latest minor version will be tested with the latest version of shiro. This way we can backport to the 2.x branch, which IMO is required since many older projects won't be upgrading to Grails 3 for budget reasons.

yellowsnow commented 9 years ago

@pmcneil @pledbrook I've just stumbled upon this issue SHIRO-351, I wonder if it's related...

Another avenue to explore imho is the new bean wiring in the ShiroGrailsPlugin, especially with native sessions enabled. maybe I missed something. I had to do these changes since there no more webXml configuration in Grails 3.

On the good news, IntelliJ 15 is here with hopefully a better grails 3 support

pmcneil commented 9 years ago

That JIRA looks related, but has been fixed for a while. I hope to have a little time to look at this this week.

Thanks for all your work!