-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESA 1.0 #602
Conversation
Great job on this, looking forward to it 👍 |
@peec: please go ahead and try it - early feedback is really important at this stage. |
I am trying to get this to work with one of my projects. Since there is no more In my import Ember from 'ember';
import Application from '../../app';
import Router from '../../router';
import config from '../../config/environment';
import 'simple-auth-testing/test-helpers';
export default function startApp(attrs) {
var application;
var attributes = Ember.merge({}, config.APP);
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
Ember.run(function() {
application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
});
return application;
} But now, obviously, the tests error:
What should I import instead? |
I can't comment on 5eed942 because it crashes my browser, but have you considered transitioning to |
The test helpers haven't been transitioned to the new structure yet. I guess they would have to be moved to the |
@lan0: transitioning to |
I’m getting |
@andrewbranch: yeah, I think the store isn't currently registered. As a workaround it should work though when you define an application store as in the dummy app. |
@andrewbranch: 46a24be fixes the ephemeral session store default; be aware that the ´store´ config setting has been removed though - you can use a different store by simply defining |
@marcoow when you will merge this? |
This also includes support for Ember 2.0. For now please install from GitHub - there's no ETA for the 1.0 release really - I hope soon but there are open issues still. If you want to help submit a PR! |
@marcoow this is fantastic. Thanks for all your hard work. |
Would be great if we can have the Any chance? |
@SeyZ: you can already upgrade to 2.0 and install ESA from this branch - see the dummy app in the tests for guidance. |
@marcoow Found the dummy app. I did not see the installation instruction. It would be great to include here for clarification.
Another question, I am going to use |
Tried with this setting
|
@marcoow Tried installation instruction. It works. Now i am using the #1.0.0 version. Confirmed that it got rid of warning message of I think in the guide is also missing
I got an loader error when I start my app (tried with add bower.json dependency)
I have a file
|
I have removed dependency from First, I have rename Then I run into I guess I have to wait until documentation is out and do the full re-write. |
Congratulations! |
🎉 |
🎉 thanks for the fantastic work @marcoow (and contributors) |
Bravo! Excellent work! |
Awesome job! Looking forward to contribute in this project. Inspiring! |
Great work @marcoow and other contributors. Thanks for this great addon. |
🎆 Thanks for the great work. |
🐹 🎈 🍄 |
👍 thanks for all the effort! |
Thank you for your work on the project! This is awesome :)
|
Haha! I just installed Simple Auth in my project today and I'm busy implementing a custom session with Ember Data. Time to start from scratch. 😄 |
@constantm sorry for that ;) |
Thanks @marcoow, congrats! 🍰 |
Awesome work @marcoow! 👍👍👍 |
Thanks for the great work! Happily running it on my production app |
Thanks for the hard work! It looks like the crossOriginWhitelist option has been removed in 1.0. Is there an equivalent to prevent CORS errors? |
Good job, its nice to see its finally here. |
Auto-authorization has been dropped altogether so there's no need for a
|
Thanks all involved!!! Nice work @marcoow |
Docs are awesome :) Just noticed a spelling error ... " Should be OAuth2BearerAuthorizer - is in three places! On Sat, Oct 17, 2015 at 5:18 AM, Duke notifications@github.com wrote:
|
Thank you @danielalbertjeffery the pull request #723 fix one OAuth2BearerAuhtorizer mistake, do you can point the other mistakes you found, I think @MattNguyen can fix them |
Sure! On Sat, Oct 17, 2015 at 9:26 AM, Duke notifications@github.com wrote:
|
👍 |
nvm, I solved the issue. It was caused by an outdated |
The latest version of simple auth (that supports Ember 2.0) changed its path. Instead of 'simple-auth,' it's now 'ember-simple-auth'. See documentation here: mainmatter/ember-simple-auth#602
https://github.com/simplabs/ember-simple-auth/tree/jj-abrams/tests/dummy this link is broken |
@AlfaroLore I believe the |
Exactly same here, works converting to js. |
(this was previously #522 and the
ember-cli-addon
branch but as 1.0 will actually include more changes than just making ESA an Ember CLI Addon-only project the branch was renamed tojj-abrams
following a nice ember tradition)This will be the 1.0 release of Ember Simple Auth, turning the library into a first class Ember CLI addon and removing the bower and globals distributions. The 1.0 version will of course also support Ember 2.0.
For more info on Ember Simple Auth 1.0 see the talk @marcoow gave at the September Ember.js Munich Meetup.
Installation Instructions
ember-simple-auth
package frombower.json
ember-cli-simple-auth*
packages frompackage.json
package.json
:"ember-simple-auth": "simplabs/ember-simple-auth#jj-abrams"
bower install && npm install
See the dummy app for example usage of 1.0 ESA which contains quite a few breaking changes.
I gave a talk introducing Ember Simple Auth 1.0 and the changes that come with it at Ember.js Munich: https://www.youtube.com/watch?v=aeH_9YGgt9E
TODO
session-stores:application
which can be overridden inapp/session-stores/application.js
ApplicationRouteMixin.sessionInvalidated
- [ ] clean up code and tests (e.g. session code is pretty messy, some tests use session instead of mocked session service etc.)(this can actually be moved to after the 1.0 release as it won't affect the public API)currently fail in beta and canary because of remove resetViews from 'it' emberjs/ember-mocha#48- this is fine now but the release tests fails as they seem to run with Ember 2.0 and Ember Data 1.3)session-stores/application.js
doesn't really make sense as the store isn't really extensible anyway and you'd always want to use the ephemeral store in the test env.Idea for the new API is to add an
authorize
method to the session that generates authorization data with a given authorizer, e.g.When the session is not authenticated or there is not token, the authorizer would simply not call the block. That way the authorizer doesn't depend on e.g. jQuery anymore.
There should also be mixins for common scenarios, e.g. Ember Data:
- [ ] move the setup of(this shouldn't actually be necessary)$.ajaxPrefilter
into a dedicated initializer that can optionally be loaded (there should probably also be an initializer that e.g. sets up authorization on the Ember Data adapter instead). The current method of automatically loading it should be extracted into an addon so it's easy to upgrade projects in a non-breaking way.- [ ] rename(don't think this is actually a good idea)Authenticator.restore
toAuthenticator.validate