This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//PLEASE NOTE: Typing actor refs are really hard problem(take a look at the discussions in Akka mailing list regarding this subject). This is no way a complete solution. This will only work if you know all the possible | |
//messages an actor can handle (that means no become/unbecome business). | |
package experiment | |
import akka.actor.{Props, ActorSystem, Actor, ActorRef} | |
case class TypedActorRef[A](actorRef: ActorRef) extends AnyVal { | |
def ![B](msg: B)(implicit ev: A <:< B, sender: ActorRef = Actor.noSender) = actorRef ! msg | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
@Target(ElementType.METHOD) | |
@Retention(RetentionPolicy.RUNTIME) | |
public @interface Audited { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "net/http" | |
import "io" | |
import "runtime" | |
import "log" | |
type authHandler func(http.ResponseWriter, *http.Request) | |
func allowed(r *http.Request) bool { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.squareup.alcatraz.auth; | |
import com.google.common.base.Optional; | |
import com.unboundid.ldap.sdk.Filter; | |
import com.unboundid.ldap.sdk.LDAPConnection; | |
import com.unboundid.ldap.sdk.LDAPException; | |
import com.unboundid.ldap.sdk.ResultCode; | |
import com.unboundid.ldap.sdk.SearchRequest; | |
import com.unboundid.ldap.sdk.SearchResult; | |
import com.unboundid.ldap.sdk.SearchResultEntry; |