Code Explainers

Code explainers tagged #expiry

python
import base64
import hashlib
import hmac
import json

Building signed expiring tokens with HMAC

hmac authentication base64
Intermediate 7 steps
php
<?php
 
namespace App\Services;
 

Building signed, expiring download URLs in PHP in Laravel

hmac url-signing authentication
Intermediate 7 steps
ruby
class ProductCatalog
  def featured_products
    Rails.cache.fetch("catalog/featured_products", expires_in: 12.hours) do
      Product.where(featured: true)

Caching patterns with Rails.cache.fetch

caching cache-keys expiry
Intermediate 5 steps