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

feat: Auth Security #25

Merged
merged 23 commits into from
Apr 9, 2021
Merged

feat: Auth Security #25

merged 23 commits into from
Apr 9, 2021

Conversation

janniksinz
Copy link
Owner

No description provided.

Gio02092001 and others added 23 commits March 14, 2021 11:09
perf: add relation user-survey
* minor advancements

* change controller pathing

* add basic auth and whitelisting

* add User Roles and Permissions

* completed basic auth

* feat: first non-functionating draft of getSurvey

* add admin roles and permissions

* Working commit

* Working commit

* implementing SurveyService and FakeRepo

* working status,
implementation of getAllSurveys

* minor changes

Co-authored-by: Gio02092001 <[email protected]>
* feat: working repository connection

* feat: Add Repository and Services

* feat: Add findById
Co-authored-by: Gio02092001 <[email protected]>
* feat: working repository connection

* feat: working repository connection

* feat: working repository connection

* feat: Add Repository and Services

* feat: Add findById

* feat: Add findById

* working commit, add queries

* AuthTokenRepository

* feat: Add AuthToken and Relation

* commit working

* changes

* remove any security

* working commit

getting Answers from DB

* feat: get User by Id

* feat: addAnswer

* feat: addAnswer working

* changing @controller to @RestController

* feat: Add deleteUser by Id

* feat: Add deleteSurvey by Id

* working commit

* working commit

Co-authored-by: Gio02092001 <[email protected]>
Co-authored-by: inesmaurer <[email protected]>
* working commit

* working commit

* create answercontent table

* added ResultSet for AnswerPossibilities

* added ResultSet for AnswerPossibilities

* added ResultSet for AnswerPossibilities

* working commit

* added ResultClass

* set TODOs

* feat: getSurveyBySurveyId

* feat: getSurveyBySurveyId

* created DDL statements to create dummy objects

* added Positions to MCAnswerContent and AnswerPossibility as well as filled DB

* feat: Add getBasicResults

changes to DataModel:
Relation AnswerPossibility - MCAnswerContent added; position and content in MCAnswerContent deleted; Database DDL Dummy Updated
changes to logic:
in AnswerPossibilityRepository fix wrong SQL-Statement;
AnserService.results: add Initial defaultValues 0 for ArrayList
get all MCAnswersContents from DB
getPosition from reference to AnswerPossibility
counter +1
return ArrayList (can be changed later again)

Add files:
McAnswerContentRepository and McAnswerContentService

Minor Changes:
created to do createMcAnswerContent when creating Answer

* feat: Add sendSurvey

* working commit

* working commit

* add SendElement structure

* add SendElement structure

* feat: sendSurveyElement

Co-authored-by: Andreas <[email protected]>
Co-authored-by: inesmaurer <[email protected]>
Co-authored-by: Jarg <[email protected]>
Co-authored-by: Gio02092001 <[email protected]>
* database connection (#16)

* feat: Add Relation User-Survey (#13)

*major: database connection

perf: add relation user-survey

* Feat add controllers (#14)

* minor advancements

* change controller pathing

* add basic auth and whitelisting

* add User Roles and Permissions

* completed basic auth

* feat: first non-functionating draft of getSurvey

* add admin roles and permissions

* Working commit

* Working commit

* implementing SurveyService and FakeRepo

* working status,
implementation of getAllSurveys

* minor changes

Co-authored-by: Gio02092001 <[email protected]>

* Feat database access repository (#15)

* feat: working repository connection

* feat: Add Repository and Services

* feat: Add findById
Co-authored-by: Gio02092001 <[email protected]>

Co-authored-by: Gio02092001 <[email protected]>
Co-authored-by: Gio02092001 <[email protected]>

* working commit

* working commit

* create answercontent table

* added ResultSet for AnswerPossibilities

* added ResultSet for AnswerPossibilities

* added ResultSet for AnswerPossibilities

* working commit

* added ResultClass

* set TODOs

* feat: getSurveyBySurveyId

* feat: getSurveyBySurveyId

* created DDL statements to create dummy objects

* added Positions to MCAnswerContent and AnswerPossibility as well as filled DB

* feat: Add getBasicResults

changes to DataModel:
Relation AnswerPossibility - MCAnswerContent added; position and content in MCAnswerContent deleted; Database DDL Dummy Updated
changes to logic:
in AnswerPossibilityRepository fix wrong SQL-Statement;
AnserService.results: add Initial defaultValues 0 for ArrayList
get all MCAnswersContents from DB
getPosition from reference to AnswerPossibility
counter +1
return ArrayList (can be changed later again)

Add files:
McAnswerContentRepository and McAnswerContentService

Minor Changes:
created to do createMcAnswerContent when creating Answer

* feat: Add sendSurvey

* working commit

* working commit

* add SendElement structure

* add SendElement structure

* feat: sendSurveyElement

* add responseEntity and Response Code

* add CorsConfig

* add CorsConfig

* fix: getSurvey

* feat: getResultsBySurveyId + countParticipants

* fix: Controllers

* fix: importStatements

* update DDL statements to create dummy objects" including mcanswer

* fix: save survey at once with surveyElement and Answer_possibilities

Milestone 1 completed

* fix: send Answer

* fix: send Answer with Dummies

* fix: send Answer with Dummies

* fix: getResults

* cross origin annotation

* cross origin annotation

* fix: add cosConfigurer to Application

* Fix cross-origin bugs

* fix: createAnswerPossibility

* Fix cross-origin bugs (finally)

* fix: getCountParticipants and AnswerService

Co-authored-by: Gio02092001 <[email protected]>
Co-authored-by: Gio02092001 <[email protected]>
Co-authored-by: Andreas <[email protected]>
Co-authored-by: inesmaurer <[email protected]>
Co-authored-by: Jarg <[email protected]>
Co-authored-by: Marlo Kessler <[email protected]>
- source https://loizenai.com/angular-10-spring-boot-jwt-authentication-example/

- needs testing
- needs debugging

!!DONT MERGE!! functionality not tested
jwt security has been makeshift adapted to previous models and database
- endpoints for auth
- auto insert roles into db
set nonAccountLocked, nonAccountExpired, nonCredentialsExpired, Enabled to true

This could be overhauled later on?
on authentication due to inheritance of certain classes, the only way to obtain the user from the auth_token is through the username

So I had to change name back to username and integrate with the naming convention of the endpoints and the DB
* add 2 minor tests for auth

(the test base on static auth_tokens)
these tokens should be replaced by 4 requests:
- registering an admin, user
- logging into an admin, user
-> using these tokens

* add Test ToDos

* add user_token test

* fix: exception handling

* removed useless antMatcher

* feat: add changePassword()

Co-authored-by: Gio02092001 <[email protected]>
@janniksinz janniksinz merged commit 5ceedb7 into master Apr 9, 2021
@janniksinz
Copy link
Owner Author

🎉 This PR is included in version 2.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants