Skip to content
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

[typescript-angular2] Allow lazy oauth token refresh (async access_token function) #6493

Closed

Conversation

alexrashed
Copy link

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master for non-breaking changes and 3.0.0 branch for breaking (non-backward compatible) changes.
  • Filed against 2.3.0 (and includes breaking changes).

Description of the PR

Fixes #6486.

  • Add authentication scheme name and necessary scopes as parameters for the accessToken function in the Configuration as seen in [Typescript-Fetch] Support additionalproperties, Enum, Auth and more. #6130
  • accessToken function now returns an Observable<string> (allows lazy renewal using the refreshToken)
  • Update some old ng2 stuff to ng4 (some copy-pasting)
  • Added some previously not committed client / petstore code

Unfortunately Travis CI build fails due to some GitHub rate limits (Travis CI build). I successfully executed mvn clean verify in the petstore client for ts-ng2 and ts-ng4, but this only invokes the compilation and no integration tests (how can I invoke any ts-ng2/4 IT locally?). But I tested it with my own project and there are no breaking changes to the petstore projects (as they are not using the accessToken function but return a static string instead).

Fix invalid auth header zip function (needs to return the resulting header for the next observable).
- Add missing rxjs operators
- Changed project name in package.json (seems like it's been overlooked after copy/pasting ng2 project)
- Update ts-ng2 & ts-ng4 petstore code (seems this hasn't been done the last time)
- Generate ts-ng2 security client (also contains some previous changes)
@wing328 wing328 changed the base branch from 2.3.0 to master September 13, 2017 16:02
@wing328
Copy link
Contributor

wing328 commented Sep 13, 2017

@alexrashed thanks for the PR. I've changed the base to master (which is 2.3.0). Please rebase on the latest master resolve the merge conflicts.

cc @TiFu @taxpon @sebastianhaas @kenisteward @Vrolijkx

- Fix swagger annotations version in jaxrs-cxf-cdi pom after 2.0.0-rc1 release (maven doesn't know anything about rc versions - used 1.99 as a workaround)
- Re-generated the jaxrs-cxf-cdi client
@alexrashed alexrashed changed the base branch from master to 2.3.0 September 13, 2017 16:19
@alexrashed alexrashed changed the base branch from 2.3.0 to master September 13, 2017 16:20
@alexrashed
Copy link
Author

alexrashed commented Sep 13, 2017

Argh, please get rid of a feature branch which has the same name as your upcoming version! :D
I'm on it :)

EDIT: Sry, pushed a bit early... Real merge/impl coming up...

# Conflicts:
#	bin/windows/typescript-angular-v2-with-npm.bat
#	modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache
#	samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts
#	samples/client/petstore/typescript-angular-v2/default/api/store.service.ts
#	samples/client/petstore/typescript-angular-v2/default/api/user.service.ts
#	samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts
#	samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts
#	samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts
#	samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts
#	samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts
#	samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts
#	samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts
#	samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts
#	samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts
#	samples/client/petstore/typescript-angular4/npm/configuration.ts
#	samples/server/petstore/jaxrs-cxf-cdi/pom.xml
@kenisteward
Copy link
Contributor

@alexrashed Hey checkout my comment on #6846 for updating the configuration object with angular. Let me know if that works for you cause it is the best case scenario for Angular.

alexrashed added a commit to alexrashed/swagger-codegen that referenced this pull request Sep 13, 2017
- Startover with a new branch after pr swagger-api#6493 was created on the wrong branch
- Handover authentication scheme name as well as the scopes to the accessToken function in the Configuration class
- accessToken returns an Observable to allow a lazy refresh of the accessToken
@alexrashed
Copy link
Author

As it was quite a pain to update the feature branch / merge the master in there (in comparison to the changes), I created a fresh branch / PR (#6496).

@alexrashed alexrashed closed this Sep 13, 2017
@alexrashed alexrashed deleted the feature/6486-async_accessToken branch September 13, 2017 18:19
@wing328
Copy link
Contributor

wing328 commented Sep 14, 2017

Argh, please get rid of a feature branch which has the same name as your upcoming version! :D

Definitely. I'll try to do it this weekend (very busy these days ...)

alexrashed added a commit to alexrashed/swagger-codegen that referenced this pull request Sep 27, 2017
- Startover with a new branch after pr swagger-api#6493 was created on the wrong branch
- Handover authentication scheme name as well as the scopes to the accessToken function in the Configuration class
- accessToken returns an Observable to allow a lazy refresh of the accessToken
alexrashed added a commit to alexrashed/swagger-codegen that referenced this pull request Oct 10, 2017
- Startover with a new branch after pr swagger-api#6493 was created on the wrong branch
- Handover authentication scheme name as well as the scopes to the accessToken function in the Configuration class
- accessToken returns an Observable to allow a lazy refresh of the accessToken
alexrashed added a commit to alexrashed/swagger-codegen that referenced this pull request Oct 10, 2017
- Startover with a new branch after pr swagger-api#6493 was created on the wrong branch
- Handover authentication scheme name as well as the scopes to the accessToken function in the Configuration class
- accessToken returns an Observable to allow a lazy refresh of the accessToken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants