[PATCH conductor] BZ767210 - "Users and Groups" tab now reads "Users"
by Matt Wagner
Implements https://bugzilla.redhat.com/show_bug.cgi?id=767210
---
src/app/views/users/show.html.haml | 2 +-
src/config/locales/en.yml | 4 ++--
src/features/user.feature | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/app/views/users/show.html.haml b/src/app/views/users/show.html.haml
index d1b0f6a..63aa794 100644
--- a/src/app/views/users/show.html.haml
+++ b/src/app/views/users/show.html.haml
@@ -2,7 +2,7 @@
%header.admin-page-header
#obj_actions
=t'users.return_to'
- = link_to "Users & Groups", users_path, :class => 'rounded-link'
+ = link_to t('users.users_groups'), users_path, :class => 'rounded-link'
%section.admin-content-section.user
.content
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index 895a23e..e74ec9e 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -6,7 +6,7 @@ en:
one: 1 hour
other: %{count} hours
users:
- users_groups: "Users & Groups"
+ users_groups: "Users"
return_to: "Return to:"
users: Users
confirm_delete: "Are you sure you want to delete this user?"
@@ -1179,7 +1179,7 @@ en:
monitor: Monitor
administer: Administer
second_level:
- users_groups: Users & Groups
+ users_groups: Users
environments: Environments
content: Content
cloud_providers: Cloud Providers
diff --git a/src/features/user.feature b/src/features/user.feature
index 516dae7..01a8467 100644
--- a/src/features/user.feature
+++ b/src/features/user.feature
@@ -75,7 +75,7 @@ Feature: Manage Users
| First name | Joe |
| Last name | Tester |
| E-mail | testuser2(a)example.com |
- And I follow "Users & Groups"
+ And I follow "Users"
Then I should be on the users page
And there should not be user with login "canceluser"
--
1.7.6.5
12 years, 4 months
Checking of oauth_body_hash
by Pete Zaitcev
Hi, Matt:
I put together a patch to verify the oauth_body_hash (see attached).
However, I'm still not convinced that it helps much of anything, enough
to be actually implemented. The uglifying of the code that it brings
is annoying, and it adds nothing that supporting SSL would not either.
If you still want it, I'll build you an RPM with it for testing.
-- Pete
commit dc4e890b9051d2280a7963b5219e3ad221b54de7
Author: Pete Zaitcev <zaitcev(a)yahoo.com>
Date: Sun Jan 8 19:33:11 2012 -0700
Check the oauth_body_hash.
diff --git a/configure.ac b/configure.ac
index ad9d53d..d013936 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,6 +75,8 @@ AC_CHECK_LIB([oauth], [oauth_init_nss],
[AC_MSG_ERROR([Missing required oauth lib])])
AC_SUBST([OAUTH_LIB])
+AC_CHECK_LIB([ssl], [SSL_new], SSL_LIBS=-lssl)
+
PKG_CHECK_MODULES([HAIL],[libhail >= 0.8])
AC_SUBST([HAIL_LIBS])
AC_SUBST([HAIL_CFLAGS])
diff --git a/rest.c b/rest.c
index 1aca0af..526e8b6 100644
--- a/rest.c
+++ b/rest.c
@@ -38,6 +38,7 @@
#include <curl/curl.h>
#include <oauth.h>
+#include "base64.h"
#include "configmake.h" /* for LOCALEDIR */
#include "dirname.h"
#include "iwh.h"
@@ -1404,13 +1405,26 @@ proxy_bucket_post (void *cctx, struct MHD_Connection *conn, const char *url,
post_iterator,ms->dict);
if (!ms->post)
return MHD_NO;
+ if (ms->body_hash_present)
+ SHA1_Init(&ms->sha1);
gc_register_finalizer_ms(ms);
}
else if (*data_size) {
+ if (ms->body_hash_present)
+ SHA1_Update(&ms->sha1,data,*data_size);
MHD_post_process(ms->post,data,*data_size);
*data_size = 0;
}
else {
+ if (ms->body_hash_present) {
+ unsigned char buf[SHA_DIGEST_LENGTH];
+ SHA1_Final(buf,&ms->sha1);
+ if (memcmp(ms->body_hash,buf,SHA_DIGEST_LENGTH)!=0) {
+ return do_resp(conn,ms,MHD_HTTP_FORBIDDEN,NULL,
+ "403 body hash mismatch\r\n");
+ }
+ }
+
int rc = MHD_HTTP_BAD_REQUEST;
key = kv_hash_lookup(ms->dict,"_key");
if (key) {
@@ -1609,13 +1623,26 @@ proxy_object_post (void *cctx, struct MHD_Connection *conn, const char *url,
post_iterator,ms->dict);
if (!ms->post)
return MHD_NO;
+ if (ms->body_hash_present)
+ SHA1_Init(&ms->sha1);
gc_register_finalizer_ms(ms);
}
else if (*data_size) {
+ if (ms->body_hash_present)
+ SHA1_Update(&ms->sha1,data,*data_size);
MHD_post_process(ms->post,data,*data_size);
*data_size = 0;
}
else {
+ if (ms->body_hash_present) {
+ unsigned char buf[SHA_DIGEST_LENGTH];
+ SHA1_Final(buf,&ms->sha1);
+ if (memcmp(ms->body_hash,buf,SHA_DIGEST_LENGTH)!=0) {
+ return do_resp(conn,ms,MHD_HTTP_FORBIDDEN,NULL,
+ "403 body hash mismatch\r\n");
+ }
+ }
+
int rc = MHD_HTTP_BAD_REQUEST;
if (!kv_find_val(ms->dict,post_find,NULL)) {
op = kv_hash_lookup(ms->dict,"op");
@@ -2456,6 +2483,13 @@ oauth_param_find(char **argv, int argc, const char *key)
return -1;
}
+static bool
+stash_hash(unsigned char *shabuf, const char *b64hash)
+{
+ size_t len = SHA_DIGEST_LENGTH;
+ return base64_decode(b64hash, strlen(b64hash), (char *)shabuf, &len);
+}
+
static int
do_oauth (struct MHD_Connection *conn, my_state *ms,
const char *url, const char *method)
@@ -2472,6 +2506,7 @@ do_oauth (struct MHD_Connection *conn, my_state *ms,
const char *user_name;
const char *sig_method;
const char *sig_supplied, *sig_calculated;
+ const char *hash_supplied;
/*
* Don't recalculate everything in case of POST or long data piped.
@@ -2615,6 +2650,15 @@ do_oauth (struct MHD_Connection *conn, my_state *ms,
x = oauth_param_find(argv,argc,"oauth_body_hash");
if (x != -1) {
oargv[oargc++] = argv[x];
+
+ hash_supplied = oauth_param_val(argv[x]);
+ if (!hash_supplied ||
+ !stash_hash(ms->body_hash, hash_supplied)) {
+ do_resp(conn,ms,MHD_HTTP_INTERNAL_SERVER_ERROR,NULL,
+ "500 bad oauth_body_hash\r\n");
+ return 1;
+ }
+ ms->body_hash_present = true;
}
oauth_sign_array2_process(&oargc, &oargv, NULL, omethod, method,
diff --git a/state_defs.h b/state_defs.h
index 6b09c55..243791c 100644
--- a/state_defs.h
+++ b/state_defs.h
@@ -19,6 +19,7 @@
#include <stdbool.h>
#include <sys/queue.h>
#include <microhttpd.h>
+#include <openssl/sha.h>
#include "hash.h"
#include "mpipe.h"
#include "template.h"
@@ -50,6 +51,9 @@ typedef struct _my_state {
MHD_AccessHandlerCallback handler;
ms_state state;
bool authorized;
+ bool body_hash_present;
+ char *auth_hdr;
+ char *auth_user;
/* for GC library */
LIST_ENTRY(_my_state) gc_link;
/* for proxy ops */
@@ -65,6 +69,8 @@ typedef struct _my_state {
long rc;
/* for proxy puts (and logging) */
size_t size;
+ unsigned char body_hash[SHA_DIGEST_LENGTH];
+ SHA_CTX sha1;
/* for proxy puts, queries, and registrations */
struct MHD_Connection *conn;
/* for proxy queries */
12 years, 4 months
[PATCH configure] BZ 746702 - improve whitepace checking in /etc/aeolus-configure/nodes configs
by Richard Su
Only "parameters" and "classes" should be top level nodes.
If spaces are missing from the actual parameters, the config file would still
be valid YAML and not flagged as an error.
---
bin/aeolus-node-check | 28 ++++++++++++++++++-
.../nodes/no-two-spaces-before-parameter-name | 4 +++
spec/node-check_spec.rb | 1 +
3 files changed, 31 insertions(+), 2 deletions(-)
create mode 100644 spec/fixtures/nodes/no-two-spaces-before-parameter-name
diff --git a/bin/aeolus-node-check b/bin/aeolus-node-check
index 139ecd7..3647bd5 100755
--- a/bin/aeolus-node-check
+++ b/bin/aeolus-node-check
@@ -17,25 +17,49 @@
require "yaml"
filename = ARGV[0]
+errors = []
if File.exist?(filename) == false
puts "File not found: #{filename}"
exit 1
else
+
+ # file should be parseable
begin
YAML::parse_file(filename)
rescue => e
- puts "Error found in #{filename}"
if e.to_s.index("line")
line_number = e.to_s.split("line")[1].split(",")[0].strip.to_i + 1
- puts "Incorrect format found on or before line #{line_number}"
+ errors << "Incorrect format found on or before line #{line_number}"
else
+ errors << e
+ end
+ end
+
+ # file should only have parameters and classes as top nodes
+ if errors.size == 0
+ begin
+ root = YAML::load_file(filename)
+ root.each do |key, value|
+ if key != "parameters" && key != "classes"
+ errors << "Please check formatting in line containing #{key} #{value}"
+ end
+ end
+ rescue => e
+ errors << e
+ end
+ end
+
+ if errors.size > 0
+ puts "Error found in #{filename}"
+ errors.each do |e|
puts e
end
puts "parameters must be in the form [space][space][parameter name][colon][space][parameter value]"
puts "classes must be in the form [dash][space][class name]"
exit 1
end
+
end
exit 0
diff --git a/spec/fixtures/nodes/no-two-spaces-before-parameter-name b/spec/fixtures/nodes/no-two-spaces-before-parameter-name
new file mode 100644
index 0000000..1513ea5
--- /dev/null
+++ b/spec/fixtures/nodes/no-two-spaces-before-parameter-name
@@ -0,0 +1,4 @@
+parameters:
+ enable_https: true
+rhevm_nfs_server: server.com
+classes:
\ No newline at end of file
diff --git a/spec/node-check_spec.rb b/spec/node-check_spec.rb
index e4a687c..eb61c5f 100644
--- a/spec/node-check_spec.rb
+++ b/spec/node-check_spec.rb
@@ -28,6 +28,7 @@ describe "aeolus-node-check" do
run_and_check_status("no-colon-between-parameter-name-and-value", 1)
run_and_check_status("no-space-between-dash-and-class-name", 1)
run_and_check_status("no-space-between-parameter-name-and-value", 1)
+ run_and_check_status("no-two-spaces-before-parameter-name", 1)
run_and_check_status("one-space-before-parameter-name", 1)
run_and_check_status("three-spaces-before-parameter-name", 1)
end
--
1.7.6.5
12 years, 4 months
[PATCH conductor] BZ 758644 - added rake task to decrement login counter
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
This rake task is called from aeolus-configure after successful login.
---
src/lib/tasks/dc_tasks.rake | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/src/lib/tasks/dc_tasks.rake b/src/lib/tasks/dc_tasks.rake
index 84637bb..7d5942d 100644
--- a/src/lib/tasks/dc_tasks.rake
+++ b/src/lib/tasks/dc_tasks.rake
@@ -122,6 +122,25 @@ namespace :dc do
end
end
+ desc "Decrement user's login counter"
+ task :decrement_counter, [:login] => :environment do |t, args|
+ user = User.find_by_login(args.login)
+
+ unless user
+ puts "User '#{args.login}' not found"
+ exit(1)
+ end
+
+ user.login_count = user.login_count > 1 ? user.login_count - 1 : 0
+
+ if user.save
+ puts "Login counter for user #{args.login} updated"
+ else
+ puts "Failed to update login counter for user #{args.login}: #{user.errors.join(', ')}"
+ end
+
+ end
+
def get_account(provider_name, account_name)
unless provider = Provider.find_by_name(provider_name)
raise "There is no provider with '#{provider_name}' name"
--
1.7.7.5
12 years, 4 months
Conductor under Internet Explorer
by Tomas Sedovic
The dreaded time has come.
Since a significant part of our users will be using Internet Explorer
(by choice or otherwise), we need to make sure that Conductor works and
looks properly under IE.
To calm you all down somewhat, we're *not* going to support IE6.
Anything above and including 7 must work, though.
I went ahead and looked at Conductor through the IE7 lenses and here are
all the issues that I've discovered.
Don't panic. You have been warned.
Javascript
----------
* errors on loading application.js
* errors on loading our backbone scripts
-- these two mean that out of the box, we're pretty much without JS
which makes the whole experience more sluggisg
Styling
-------
* General layout
* misaligned user dropdown
* missing round corners on the user dropdown
* misaligned copyright disclaimer in the footer
* the brownish darker-grey footer background is missing
* missing round corners on the content section
* missing separator between two breadcrumbs
* misaligned text on the error messages
* missing the vertical separator in the top notifications box
* Pools page
* misaligned New Pool button
* scorebox spens the entire width of the content section (it should be
only wide enough to fit its contents)
* garbled Alerts table
* missing round corners on the Alerts counter
* missing round corners on the Your Pools counter
* misaligned the New Deployment and catalog selection buttons
* Pretty view
* the pool card rows have no horizontal space separating them
* missing round corners on the pools list items
* missing round corners on the pools cards
* Filter view
* misaligned elements in the filter section of the table
* missing round corners on the search box
* misaligned search icon
* missing "Search" text in the search box
* missing round corners on the elements count
* Pool details
* Misaligned the New Deployment, Catalog Selection, Edit and Delete
buttons
* missing round corners on the counters next to the tabs
* Pretty view
* the deployment card rows have no horizontal space separating them
* Deployment details
* wrong colour of the horizontal separator line in the instance cards
* missing round corners in the counters next to the tabs
* Stop & Restart buttons not centered
* no space between the Stop, Restart buttons
* New/Edit pool
* the "unlimited" checkbox not properly vertically aligned
* the Save button's border is too thick and wrong colour (black
instead of
grey)
* Launch deployable from a Catalog
* missing round corners on the Edit, Select and Cancel buttons
* missing arrow next to the Details item
* clicking on Details doesn't show the image details
* The element containing each catalog is too wide
* Weird pixelation in the catalog title texts
* clicking on the Select button shows the wrong (too thick and black)
border again
* Launch overview
* Missing icon in the Launch button
* the Launch button is too wide
* Wrong colours when the Launch button is disabled
* the Cancel and Back buttons are vertically
* Admin section
* Missing icons in the admin section tabs
* Users
* Missing the Users header icon
* Missing the Users and Global Role Grants tabs
* User details
* Missing the user card contents
* Misaligned contents
* New/Edit user
* The "Maximum Running Instances" field is wrapped
* The Save User button's border is too thick and has a wrong colour
* The header is too high
* The "return to" link is misaligned
* No border around the user card
* missing round corners on the user card
* Pool Families
* Missing the Pool Families / Images tabs
* Missing the header icon
* New Pool, New Image butons:
* no round corners
* missing border
* top and bottom padding too low
* no round corners on the pool family tables
* wrong colour for the table border lines
* Pool Family details
* The Edit, Delet buttons
* misaligned
* wrong shape
* wrong size
* unexpected wrench icon above the Role Assignments tab
* Edit Pool Family
* Misaligned the header icon
* Misaligned the "return to" link
* The Maximum Running Instances label should not be wrapped
* Image details
* Misaligned the button row
* misaligned the "View build" row
* New Image
* Misaligned the "return to" link
* Create Deployable from Image
* missing picture
* missing borders on the catalog dropdown menu (when expanded)
* Content
* Missing the Catalogs/Realm/Hardware tabs
* Catalog details
* Missing background on the Properties section
* Deployable details
* missing icons for Images, Build and Catalogs headers
* misaligned the Build missing/Push missing dropdown in the Build
section
* misaligned image status message and icon in the accounts list
* bultetted list in the Build section when some images are not in
the IWHD
(the list should not have bullets)
* misaligned icon for the Role Assignments hedare
* misaligned "Choose a catalog..." area
* missing rounded corners in the Image Ready / Repair Images labels
* New Deployable
* "Choose Deployable XML file" should not be wrapped
* misaligned "Edit XML..."
* Cloud Providers
* Misaligned the header icon
* Misaligned the "Choose a provider" section
* No rounded corners on the providers dropdown menu
* Wrong border and shape of the Save Changes and Delete Provider
buttons
* Grant Access
* Misaligned the Grand Access and Cancel buttons
* Misaligned the header icon
Now, now. Remember not to panic. It seems to me that a sizeable chunk of
these can be reduced to a fairly small amount of issues -- like IE's
lack of rounded-corners support and some inconsistent layout and image
behaviour.
I think that mostly, we're in a decent shape and we could get to a good
one pretty quickly.
If you're going to be working on fixing any of these, the IE Developer
Toolbar should be of help:
http://www.microsoft.com/download/en/confirmation.aspx?id=18359
Thomas
--
No trees were killed to send this message, but a large number of
electrons were terribly inconvenienced.
12 years, 4 months
[PATCH conductor] BZ#770555 - Deployment creation with blank entries displays The record you tried to access does not exists, it may have been deleted
by Tomas Hrcka
---
src/app/controllers/deployments_controller.rb | 5 +++++
src/app/views/deployments/_launch_new.html.haml | 2 +-
src/config/locales/en.yml | 1 +
3 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/app/controllers/deployments_controller.rb b/src/app/controllers/deployments_controller.rb
index a03ea4d..3fb128e 100644
--- a/src/app/controllers/deployments_controller.rb
+++ b/src/app/controllers/deployments_controller.rb
@@ -56,6 +56,11 @@ class DeploymentsController < ApplicationController
def launch_time_params
+ unless params.has_key?(:deployable_id)
+ flash[:error] = t('deployments.flash.warning.deployable_not_selected')
+ redirect_to launch_new_deployments_path(:pool_id => params[:deployment][:pool_id]) and return
+ end
+
@deployable = Deployable.find(params[:deployable_id])
@deployment = Deployment.new(params[:deployment])
@pool = @deployment.pool
diff --git a/src/app/views/deployments/_launch_new.html.haml b/src/app/views/deployments/_launch_new.html.haml
index d8e62f5..6403f76 100644
--- a/src/app/views/deployments/_launch_new.html.haml
+++ b/src/app/views/deployments/_launch_new.html.haml
@@ -37,7 +37,7 @@
%p
%label{:for => 'frontend_realm_id'}
= t('realms.index.realm')
- = select :deployment, :frontend_realm_id, @realms.map{|r| [r.name, r.id]}, :include_blank => true
+ = select :deployment, :frontend_realm_id, @realms.map{|r| [r.name, r.id]}
%fieldset.options
= submit_tag t('.next'), :class => 'button', :id => "next_button"
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index ad5f784..330ddda 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -247,6 +247,7 @@ en:
warning:
disabled_pool: "Cannot launch a Deployment in this Pool. The pool has been disabled."
failed_to_launch: "Deployment launch failed!"
+ deployable_not_selected: "You need to select deployable"
error:
not_launched: "Some assemblies will not be launched:"
failed_to_launch_assemblies: "Failed to launch following assemblies:"
--
1.7.7.5
12 years, 4 months
[PATCH aeolus-cli] BZ#768317 Handle Ambiguous Option Exception
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
---
lib/aeolus_cli/command/config_parser.rb | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/aeolus_cli/command/config_parser.rb b/lib/aeolus_cli/command/config_parser.rb
index e74401d..cb804eb 100644
--- a/lib/aeolus_cli/command/config_parser.rb
+++ b/lib/aeolus_cli/command/config_parser.rb
@@ -51,11 +51,11 @@ module Aeolus
def parse(opts)
begin
opts.parse(@args)
- rescue OptionParser::InvalidOption => io
- puts "Warning, " + io.message + "\n\tSee `aeolus-image " + @command + " -h` for usage information."
+ rescue OptionParser::ParseError => e
+ puts "Warning, " + e.message + "\n\tSee `aeolus-image " + @command + " -h` for usage information."
exit(1)
- rescue OptionParser::MissingArgument => e
- puts "Warning, #{e.message}" + "\n\tSee `aeolus-image " + @command + " -h` for usage information."
+ rescue
+ puts "An error occurred: See `aeolus-image " + @command + " -h` for usage information."
exit(1)
end
end
--
1.7.6.4
12 years, 4 months