19 Commits

Author SHA1 Message Date
Paul Van Eck
48d36fa26f Refactor capabilities
Rename the 'capabilities' endpoint to 'guidelines' to align more
with DefCore terminology. Several references to 'capabilities' were
thus updated to 'guidelines'.
Split out the actual requests to the DefCore repository so
that it can be used by other components.
Also, the cache expiration time was increased to 12 hours from 10 minutes.

Change-Id: I031798ffc32cdd66428af83a1ee610f00385c524
2016-03-23 16:12:20 -07:00
Andrey Pavlov
2895164a84 fix cleaning up auth dict on sign out
Change-Id: I5cb3c840b5ca5c16d21bea0af379dc36472ad462
2016-02-18 10:46:59 +03:00
david liu
e35a0e3429 refstack should display error message returned from openstack openid.
Closes-Bug: #1507730

Change-Id: I396f68e62b0b1ce49d9bc83c9eaf9ab35d5d8718
2015-11-13 18:28:54 +00:00
Paul Van Eck
aa3966ea7a Improve logout
The persistence of the openstackid session causes issues where
when people log out, then click "Sign-In" again, they  aren't
prompted for their password. Instead they are logged in automatically
with the users they just logged out from because the openstackid endpoint
still has them as logged in. With this patch, the user will be logged
out of refstack as well as openstackid when signing out of RefStack.

This way a  user can sign into refstack with another openstackid
without having to delete cookies or navigate to the openstackid site
to manually log out.

Change-Id: I23936ba6b64b58e4f6a3f4d62ba89439c4ddee21
2015-10-20 15:23:57 -07:00
Paul Van Eck
b6d173e664 Force no caching for Angular $http requests
There were issues with IE caching angular $http get requests, so
this patch will ensure no caching.

Change-Id: If932f307f8eeb636a99d2296b0053030057182f9
Closes-Bug: #1504818
2015-10-10 13:36:31 -07:00
Paul Van Eck
d23adad7f6 Update eslint and update angular style to match
With an updated eslint version and the addition of eslint-config-openstack
and eslint-plugin-angular, there are several more stylistic guidelines to
follow. However, this is what other OpenStack angular projects follow such
as Horizon. Some notable changes are:

* Wrapped javascript content in anonymous functions. This is a safeguard to
  keep the code from conflicting with other variables with the same name in
  other scripts on the same page.

* Explicitly inject dependencies and have controllers, factories, etc as
  explicitly declared functions.

* Use angular "controller as" syntax instead of assigning variables to $scope.

* Added eslint rule that requires JSDoc for every function declaration.

Note these are mainly stylistic changes and all the functionality of RefStack
should remain the same.

Change-Id: I044b1f473d589681a2ae9d2704700dd85687cbb6
2015-09-30 13:47:20 -07:00
Paul Van Eck
8d0690eced Fix refreshing while not logged-in issue
If the user isn't authenticated, and the user refreshes the page,
the user is taken to the home page. The user should only be redirected
on the pages that need redirection. This patch is a quick fix for this
issue.

Change-Id: I68f604af437ea934485c1bcef8d8b7fd7d91858a
Closes-Bug: #1493565
2015-09-14 17:34:11 -07:00
Jenkins
78f0f2da7c Merge "Improve authentication alerts" 2015-09-03 22:58:52 +00:00
sslypushenko
4624c926fd Improve authentication alerts
If OpenStackID returns failure user will be shown failure message.
Steps to check:
Setup RefStack as usual but point REFSTACK_HOST=127.0.0.1. It will
cause OpenStackID auth failure. So try to auth and you should get
error message in popup (instead of plain json document as it was before).

Change-Id: Icda5b219429047e89b393245a3a6eeadf171bd90
2015-09-03 15:41:17 -07:00
Jenkins
5ce5b3f946 Merge "Handle signout properly" 2015-09-03 21:01:03 +00:00
sslypushenko
8f8bf6dce3 Handle signout properly
RefStack UI should properly handle user signout.
How to check:
Open two RefStack in two browser tabs and signin in both. Then signout in first
tab. Then try to open 'Profile' or 'My Results' in second tab. If everything is
ok you will be redirected to RefStack home tab.

Change-Id: Ifc14ba953b269ce8940f82e61d7f3634682fe0da
2015-08-28 17:36:14 +03:00
sslypushenko
e504c11623 Add confirmation dialogs
Confirmation dialogs are provided by this module
http://schlogen.github.io/angular-confirm/

Closes-Bug: #1487060
Change-Id: If69652bca0b084e9c2335d9ccf256788f97dbee1
2015-08-27 16:50:55 -07:00
sslypushenko
2b89f65ad4 Add filter for signed test results and related UI
With this patch users can list their own test results.

Change-Id: Ie2d944924f6ae966a13d0ca9908810c315ade5ab
2015-08-17 17:06:02 +03:00
sslypushenko
217cadd608 Add endpoint and UI for public keys uploading
Users can upload, delete and retrieve list of their public keys.

User can upload test result with any public keys without any connection
with uploading public keys in Refstack. It means that you can upload
signed test results and upload public key later. Also, it means that
deleting public key doesn't mean deleting results signed with this key.

Change-Id: Idc418c4c90221740eef04fcf498d7071a4446b9c
2015-08-13 20:40:55 +00:00
Vladislav Kuzmin
7b48c99fcb Add authentication through openstackid.org
In Refstack's database store only fullname, email and openid.
After sign in refstack backend create session and write it id in cookie.
When UI is opened in browser, Angular try to get info from
/v1/profile. If data about user received then user is authenticated.

Change-Id: Ib2cabc0c6b4de4b2ca1f02cc9e062a6e3550daa0
2015-07-02 16:20:55 +03:00
Paul Van Eck
960e7c3e65 Add JSDoc inline comments to JS files.
Change-Id: Iea6dd40a3c1c676d62bbf6a15eaa931c824856f3
2015-06-08 22:49:35 -07:00
Michael Krotscheck
6fffbca938 Added JavaScript Style Linting
This patch adds eslint, a permissively licensed (as opposed to
jshint or jslint) javascript style linter. It also enables the use
of 'npm run lint', which may be used in OpenStack's gate to
cause build failures when improperly formed javascript is
committed.

Existing javascript was updated to pass linting rules. Note
that most of these changes were formatting and file length
concerns. The noted stylistic change that we should probably
discuss is the use of singlequote vs. doublequote. Single is
the pep8 standard used in python, and thus enforcing that
seems to make the most sense.

Change-Id: I52768fe6e7ee1f76f0d67f44273fdc48b159489a
2015-06-04 21:10:48 +00:00
Paul Van Eck
c094c27eff Add results and test report page
This is the groundwork for the community results listing page
and the test run report page. The report page is fairly basic, primarily
showing how results stack up against defcore capabilities. Design is subject
to change, but this gets the ball rolling. A config.json.sample was also added.
The UI now expects a config.json in the root which will contain the
Refstack API URL.

Change-Id: Id7a376d0bccda5cbb5daf05e52a2c174ad40b497
2015-04-27 09:50:27 -07:00
Paul Van Eck
cfe34d9371 Added groundwork for the refstack user-interface.
Used a combination of AngularJS and Bootstrap to form
a preliminary front-end website for Refstack. Most of the content
text can be considered placeholders and is subject to change.

Change-Id: Ide82783478d1863052fe54d02ca6ee88113c46b2
2015-04-13 23:43:43 -07:00