Omniauth::Strategies::CentralLogin
I just pushed omniauth-central_login
to rubygems.org, to make it easy to integrate CentralLogin with other ruby apps. It is a companion gem to CentralLogin, a batteries included open source OAuth2 Provider based on Rails, Doorkeeper & Devise, with simple user managment tools.
Installation
Add this line to your application's Gemfile:
ruby
gem 'omniauth-central_login'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install omniauth-central_login
Usage
Configuring Omniauth:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :central_login, ENV['CENTRAL_LOGIN_CLIENT_ID'], ENV['CENTRAL_LOGIN_CLIENT_SECRET'], {
scope: "openid email profile",
client_options: {
site: ENV['CENTRAL_LOGIN_URL']
}
}
end
Configuration for Devise (using omniauthable):
co...
CentralLogin
A simple OAuth provider by murb. See below for more information, or check out the source of CentralLogin on GitLab. To integrate it with your ruby-apps, use the omniauth-central_login
gem.
Introducing CentralLogin, an OpenID Connect Provider
This app builds on the foundations of the Doorkeeper, Doorkeeper::OpenidConnect and Devise to provide a central login system.
While Doorkeeper supports other OAuth flows, CentralLogin focusses on OpenID Connect as it is a more complete, and hence useful standard, for most use cases where you want to support authentication & authorization.
This project builds on years of juggling with different authentication providers and implementations. It may cut corners to be a pragmatic and less flexible solution which you can host on your own. You don't have to tie your users to a closed authentication system such as Auth0, Azure Directory, Cognito (the horror, really, stay away from it) or something else. In the past I've been a happy user of Keycloak, which is definitely way more advanced than this project, but it in the end it is a Java application and hence harder for me to maintain and not focussed on what I think are the core requirements :)
So, are you in the market for:
- a…
Introducing BrandingRepo (for Rails)
Ever had the problem that you reuse the same project for a managemable number of clients? Too few to store branding materials in a database, but more than one making it hard to keep separate branches in sync?
Introducing BrandingRepo (for Rails)
The idea is simple: create a configuration file with those files that are specific to different brands/customers and store their mods in a different repository. Repository is quite a big word here: we simply create a config/brands
folder in your current branch where you can push and pull your brand specific adjustments from. All managed in the same git repository.
What it is not:
- it is not git within git.
- it is not a design system, nor has it anything to do with it (I think perhaps with a few additional hacks it can be made to work with centrally managed gems/node-modules; like here: https://twitter.com/hopsoft/status/1451358882161332225?s=10)
- it is not adding brand icons to your project
Installation
Add this …
Why I stopped inheriting from ruby’s core Array class
Inheritance is considered bad practice for quite some time now (Gamma, Helm, Johnson & Vlissides, 1994). Little did I know when I started the ‘workbook’-project in 2012 (note that I don’t have a computer science background).
The main reason I wrote this workbook-gem was that I wanted the most predictable API for working with spreadsheet data (acting as arrays of arrays), not having to use a different API when reading XLSX or CSV files, nor when writing it.
After learning that inheritance is not always a good thing, I still often thought of a workbook
as an array of arrays and hence an exception to the rule. But then I came accross a helpful post by Avdi Grimm: [Why you shouldn’t inherit from Ruby’s core classes (an…
- delicious 28 May ´19 EmailInquire gem
- shared 24 Jan ´19 Stubbing External Services in Rails
- delicious 24 Jan ´19 VCR
- delicious 04 Dec ´18 Standard gem
Rails CMS-systems
When developing full stack webapplications, I typically use Rails. While Rails is the perfect system to create CMS'es, for sites that are less applications and more websites CMS-gems for Rails may help.
- delicious 01 Aug ´18 SpinaCMS
- delicious 28 May ´18 `log_analyzer`
JavaScript & Rails: a `webpacker` evaluation
Webpacker is still opt-in for new Rails projects. But this might change. The JavaScript ecosystem is moving fast and new JavaScript frameworks are pushing customer’s expectations to higher levels. To use these frameworks with your Rails app, you had a few options:
- Include the JavaScript manually; which requires you to manually copy the files in place
- Use a gem-wrapper to to install the JavaScript library; but this required quite some maintenance on the Gem-author’s side.
- Try to mangle
npm
oryarn
into the asset pipeline yourself - Use Rails Assets (an automagic Gem-wrapper)
A small praise for Rails Assets
I have been using rails-assets.org the past few years to keep my JavaScript dependencies up to date. It thought it was smart solution; instead of requiring individual developers to maintain Gem-wrappers, Gem wrappers are created on the fly by RailsAssets.org. It was smart and light weight on the developers side and worked perfectly with the Rails' Asset p…
- shared 04 Sep ´17 Gem Check - Help developers make other developers happier
Eat your own dogfood
Just a small note that I've made some improvements to my SocialLinker-gem lately and while I've been using it on a few sites already, I wasn't using it on my very own blog. Today I found some time to change exactly that: you've got to eat your own dog food. If you want to have a taste of it: murb/social_linker (if you're a ruby-dev) or just click the share icons below :)
Image CC-licensed BY: Sh4rp_i
SocialLinker
I had a few projects that I thought could use some share 'buttons', but I didn't like to include the JavaScript loaded and privacy invading share buttons that the networks try to sell you by default. Neither did I like to concatenate the links with all variables required for each project… so I wrote a small rubygem on a back and forth train trip (#ilovetrains ;)): social_linker.
The idea is that you share something about a certain subject, hence you initalize the SocialLinker::Subject
and then you'll be able to generate share links from it:
subject.share_link(:facebook)
How it works
Initialize the subject with enough material to generate links from, such as the page's url, maybe the media url (mainly for Pinterest type-shares), a description, tags etc.
For example, initialize the SocialLinker::Subject
as follows:
social_linker_subject = SocialLinker::Subject...
Mijn werk: “AxlBase”.
LinkedIn confronteerde me onlangs nog met het feit: murb bestaat alweer 6 jaar. Een goed moment om verder te gaan met terugblikken op de opdrachten van weleer.
De belangrijkste opdrachtgever in mijn beginjaren was de ING bank. Een belangrijk product dat ik in de begintijd aldaar heb gebouwd is een database op basis van Excel-bestanden (iets dat ik ooit nog wil(de) uitrollen als 'AxlBase'). Zoals ik eerder al schreef, soms moet je een bestaande werkwijze omarmen. Wat is het precies en van waaruit is het ontstaan?
Wat is het?
Een database op basis van Excel-bestanden. Niet echt in technische zin (achterliggend is het een traditionele database), maar wel in de praktische zin. Excel is hét bestandsformaat van de gewone kantoormedewerker voor gestructureerde data. Het wordt veelvuldig gebruikt in allerlei projecten. AxlBase is in staat verschillende Excel-bestanden per o.a….
The `workbook`-gem
workbook
is simple ruby framework for containing spreadsheet like data in a datastructure that is known to most programmers: the (multidimensional) Array
.
News
Mijn werk: Concordia weekoverzicht
murb bestaat inmiddels een aantal jaar, daarom lijkt het me leuk om de komende blogposts een aantal mooie resultaten te delen. Als eerste in de rij: Het Concordia Weekoverzicht.
Wat is het?
Concordia, een culturele instelling in Enschede, brengt iedere week een weekoverzicht op A5-formaat uit. De weekoverzicht tool die ik voor hen heb gebouwd maakt het mogelijk deze zonder veel moeite wekelijks uit te draaien.
Het probleem
Tot zomer 2015 was het maken van het weekoverzicht een repetitieve handmatige invuloefening met dure en ingewikkelde Adobe software, terwijl de meeste gegevens keurig waren opgeslagen in hun ticketsysteem en de kijkwijzer-database. Het voordeel van de Adobe-pakketten was weliswaar oneindige mogelijkheden qua opmaak, maar in de praktijk was het eindproduct telkens vrijwel hetzelfde. Ondertussen koste het handmatig opmaken dus relatief veel tijd en kunde.
De oplossing
Het volledig automatisch genereren van e…
- delicious 13 Jan ´16 Eliminating Known Vulnerabilities With Snyk – Smashing Magazine
- delicious 13 Jan ´16 Eliminating Known Vulnerabilities With Snyk – Smashing Magazine
KeywordFinder gem released
For a project I'm working on, I decided to develop some functionality in a separate gem, so the project doesn't get cluttered too much with special librarly like classes. And since I like open source, I've got something to share with you.
We were dealing with the following situation:
Given a set of the following keywords: "aardappelen", "zachtkokende aardappelen", "zout", "schimmelkaas", "kaas", "oude harde kaas", "kikkererwten", "maïs", "bruine bonen", "shiitake", "boter"
Can you recognize:
"een grote pan zachtkokende aardappelen met een snufje zout"=>["zachtkokende aardappelen", "zout"],
"schimmelkaas" => ["schimmelkaas"],
"(schimmel)kaas" => ["schimmelkaas"],
"old amsterdam (maar een andere oude harde kaas kan natuurlijk ook)" => ["oude harde kaas"],
"g (verse) shiitake in bitesize stukjes gesneden" => ["shiitake"],
"pot hak bonenmix (kikkererwten maïs kidney en bruine bonen) afgespoeld en uitgelekt" => ["kikkerwerwten", "maïs", "bruine bo...
Rails and elasticsearch for beginners - follow up
In a previous post I described how simple integrating elasticsearch is with Rails for beginners. You could've been happy with the fact that you now have implemented full text search, but that too basic set up probably doesn't work that much better than adding a column to your model, throwing in all text in it and running a LIKE query (although elasticsearch does try to rearrange the results a bit).
In this post I will learn you two things that makes elasticsearch worth it.
Analyzers
Analyzers add some fuzziness to your searches. First, make sure your analyzer is in the right language, this will improve your results. You add the following bit to your model (I typically place it just below where the scopes and validation are defined).
settings index: { number_of_shards: 1 } do
...
- delicious 12 Jan ´15 yob's pdf-reader at master - GitHub
- twitter 21 Jan ´13 To the #rubyists: I wrote a bit on a #gem called #workbook, making handling with #spreadsheets easier, on my blog http://t.co/NZq4tvs7
- twitter 21 Jan ´13 To the #rubyists: I wrote a bit on a #gem called #workbook, making handling with #spreadsheets easier, on my blog http://murb.nl/articles/174-introducing-workbook-a-new-rubygem
- delicious 20 Sep ´12 David Dollar
- delicious 20 Sep ´12 David Dollar
- delicious 28 Oct ´11 crafterm/comma - GitHub
- delicious 28 Oct ´11 crafterm/comma - GitHub
- twitter 12 Feb ´10 almost freaking out on #radiantcms and #gem versions... (works local, but not on server) :( #iamanoob
- delicious 08 Jan ´09 Comfortable Mexican Sofa
Dit artikel van murblog van Maarten Brouwers (murb) is in licentie gegeven volgens een Creative Commons Naamsvermelding 3.0 Nederland licentie .