openshift-evangelists / workshopper

Workshop content rendering tool
63 stars 41 forks source link

Provide user credentials #21

Open jorgemoralespou opened 7 years ago

jorgemoralespou commented 7 years ago

As many of the workshops provide information with user credentials which can not be repeated per attendee, I think it would be nice to have the following feature:

When you click in an event/workshop, if it's configured to provide credentials you would have an intermediate page that would provide those to you (Or maybe just display the credentials on the top banner and modify instructions accordingly to the credentials of the user). A cookie should be set so that the user will always get the same credentials.

Credentials could come from:

jorgemoralespou commented 7 years ago

Still relevant. I can help with design, not with code, since now in Ruby :-P

marekjelen commented 6 years ago

To enable this feature variable DYNAMIC_USER_NAME has to be defined.

User name will be USER_NAME variable suffixed with an auto-incrementing number.

If NUM_USERS variable is provided, the system will throw error when the generated number reaches the limit.

Password is static defined through the USER_PASSWORD variable.

jorgemoralespou commented 6 years ago

I would rather get these values in new variables, and make it possible to reassign to the existing ones.

Something like: DYNAMIC_USER_NAME=user%02d (format for the number)

The previous format would allow to have the number formatted to 2 digits, 3 digits, ... depending on the size of the workshop.

And then, in the regular vars for the workshop, we could use, re-assignment: USER_NAME={{DYNAMIC_USER_NAME}}

PASSWORD for the time being, as it's being static, would be possible kept as it is.

These would prevent breaking changes when the option is activated.

marekjelen commented 6 years ago

I like the idea with formatting, and IMHO OK to enforce it, so that

if DYNAMIC_USER_NAME is defined then USER_NAME is going to behave as a template as per

https://ruby-doc.org/core-2.5.0/Kernel.html#method-i-sprintf

with one argument being passed in.

siamaksade commented 6 years ago

DYNAMIC_USER_NAME var would be both the format for generating usernames and also the generated username?

Why do we need to cap the number of usernames generated?

marekjelen commented 6 years ago

DYNAMIC_USER_NAME is just a marker to enable the behaviour

USER_NAME has the format

You do not have to, if NUM_USERS is not provided or is 0 then it will go till it OOMs.

siamaksade commented 6 years ago

I don't think NUM_USERS is needed to be implemented. It should just act as a counter. How many users are available is not really relevant to workshopper.

Would that be implemented using an embedded db?

marekjelen commented 6 years ago

@siamaksade we already have it, have just reused it.

https://github.com/openshift-labs/starter-guides/blob/master/_modules.yml#L27

marekjelen commented 6 years ago

what's the state on this @siamaksade @jorgemoralespou ?

jorgemoralespou commented 6 years ago

@marekjelen, what do you mean? If this is still relevant? Yes. If there's been test? No, but if it's testable I'll go ahead and give feedback