This file contains hidden or 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 xmlcombinators | |
import scala.util.parsing.combinator.Parsers | |
import scala.util.parsing.input.{NoPosition, Reader} | |
import javax.xml.stream.events.{Attribute, EndElement, XMLEvent} | |
import javax.xml.stream.{XMLEventReader, XMLInputFactory} | |
import collection.mutable.ArrayBuffer | |
import java.io.File | |
/** |
This file contains hidden or 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
val rejectionHandler = RejectionHandler.default | |
def logDuration(inner: Route): Route = { ctx => | |
val start = System.currentTimeMillis() | |
// handling rejections here so that we get proper status codes | |
val innerRejectionsHandled = handleRejections(rejectionHandler)(inner) | |
mapResponse { resp => | |
val d = System.currentTimeMillis() - start | |
logger.info(s"[${resp.status.intValue()}] ${ctx.request.method.name} ${ctx.request.uri} took: ${d}ms") | |
resp | |
}(innerRejectionsHandled)(ctx) |
This file contains hidden or 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
# create keytab for radius user | |
ipa-getkeytab -p 'radius/HOSTNAME' -k /etc/raddb/radius.keytab | |
chown root:radiusd /etc/raddb/radius.keytab | |
chmod 640 /etc/raddb/radius.keytab | |
# make radius use the keytab for SASL GSSAPI | |
mkdir -p /etc/systemd/system/radiusd.service.d | |
cat > /etc/systemd/system/radiusd.service.d/krb5_keytab.conf << EOF | |
[Service] | |
Environment=KRB5_CLIENT_KTNAME=/etc/raddb/radius.keytab |