Skip to content

Instantly share code, notes, and snippets.

@maheshkelkar
maheshkelkar / CommitsToBeMerged.log
Created September 25, 2017 17:17
commits to be merged from android-security to android-platform
02f4f5bb2b049f27e938d86ee60f9badec481112 y Add arm64-v8a platform support
9664218a1aacb1ac16aa62b8528d6298dbefd7ef y Fix jenkins failing on NDK
77389814f2d0bc6af57af77cba110ed690fb5d33 y SQL database connection should not be closed
6c5c943e8d69ce9c09ecd880f959548dbd7910b8 x Remove newsroom and acquisition from android-security
4dd53f5d7d74caee03035efc829a365367e1df9c y Dont reset GUID if appintel says not a threat
153dc8f7ef0583577bf44a4ec0e36e404a6dfe5c y Monitor events should be published via event provider
7ed4d709f4dfd4266e9d88341455df4d2251a57e y Add selinux.enforce to configuration manifest
09b1fe2625cdb26d0de17ba69a63a895b2aea663 y Dont crash if A/S is not initialized when app is installed
diff --git a/finagle-core/src/main/scala/com/twitter/finagle/service/FailureAccrualFactory.scala b/finagle-core/src/main/scala/com/twitter/finagle/service/FailureAccrualFactory.scala
index 50956e2..5c2bcbb 100644
--- a/finagle-core/src/main/scala/com/twitter/finagle/service/FailureAccrualFactory.scala
+++ b/finagle-core/src/main/scala/com/twitter/finagle/service/FailureAccrualFactory.scala
@@ -1,5 +1,7 @@
package com.twitter.finagle.service
+import java.net.InetSocketAddress
+
import com.twitter.conversions.time._
@maheshkelkar
maheshkelkar / FailureAccrualFactory_temp.scala
Created July 12, 2016 22:36
FailureAccrualFactory.scala with additional logs
package com.twitter.finagle.service
import java.net.InetSocketAddress
import com.twitter.conversions.time._
import com.twitter.finagle.Stack.{Params, Role}
import com.twitter.finagle._
import com.twitter.finagle.client.Transporter
import com.twitter.finagle.service.exp.FailureAccrualPolicy
import com.twitter.finagle.stats.StatsReceiver
@maheshkelkar
maheshkelkar / jsonToMap.java
Created May 25, 2016 21:34
Simple example on how to convert Json string to Hash Map<String, Object>
//http://stackoverflow.com/questions/21720759/convert-a-json-string-to-a-hashmap
public static Map<String, Object> jsonToMap(JSONObject json) throws JSONException {
Map<String, Object> retMap = new HashMap<String, Object>();
if(json != JSONObject.NULL) {
retMap = toMap(json);
}
return retMap;
}
***MVK: ServiceFilter: method = GET, path = /ent
***MVK: SessionIdFilter: method = GET, path = /ent
***MVK: SessionIdFilter: path = /ent, redirect-path = /a, sessionId = SessionId(2015-11-03 19:52:58 +0000,Vector(99, 47, 24, 114, 80, -77, 103, -87, 17, 13, 27, 84, 15, 36, -47, -17),Secret(-79,2015-11-03 19:52:44 +0000,Vector(97, 2, -38, -32, -63, -25, -128, 100, 89, -15, -33, 39, 43, -72, 68, 9)),Vector(-34, -78, -122, 20, 101, 46, -101, 78, -87, 15, 11, -110, 25, 24, 90, -99, -35, 32, 48, -50, -96, 27, -35, 47, -124, -120, 55, -123, 18, -37, 31, -47))
***MVK: ServiceFilter: method = GET, path = /a
***MVK: SessionIdFilter: method = GET, path = /a
***MVK: MainGlueService: path = /a
Sending to: /a
***MVK: KeymasterMethodMuxLoginFilter: method = GET, path = /a, sessionId = SessionId(2015-11-03 19:52:58 +0000,Vector(99, 47, 24, 114, 80, -77, 103, -87, 17, 13, 27, 84, 15, 36, -47, -17),Secret(-79,2015-11-03 19:52:44 +0000,Vector(97, 2, -38, -32, -63, -25, -128, 100, 89, -15, -33, 39, 43, -72, 68, 9)),Vector(-34,
@maheshkelkar
maheshkelkar / FinagleHttpsQuestion.scala
Created October 30, 2015 19:23
Finagle HTTP question
//build.sbt
resolvers += "twttr" at "https://maven.twttr.com/"
libraryDependencies ++= Seq(
"com.twitter" %% "twitter-server" % "1.14.0",
"com.twitter" %% "finagle-httpx" % "6.28.0",
"com.twitter" %% "finagle-stats" % "6.28.0"
)
@maheshkelkar
maheshkelkar / CirceEncoderDecoder.scala
Last active October 23, 2015 18:54
Circe Encoder Decoder question
import com.twitter.finagle.httpx.Method
import com.twitter.finagle.httpx.path.Path
import cats.data.Xor
import io.circe.Json.JString
import io.circe.{Encoder, _}
import io.circe.jawn._
import io.circe.generic.auto._
case class Foo(method: Option[com.twitter.finagle.httpx.Method])
@maheshkelkar
maheshkelkar / endpoint.scala
Last active October 23, 2015 18:30
Adding endpoint concept to keymaster
/******* Option-1: **********/
/**
* Keymaster Config:
*
* "keymaster" {
* "upstreamEndpoints" : {
* identityProvider" : {
* "hosts" : "localhost:8081", // CSV of servers
* "path" : "/identityProvider" // use this path upstream
@maheshkelkar
maheshkelkar / gist:1fe6d36d31d6b4c51a7f
Created September 17, 2015 17:40
circe json parsing question
case class SubServerConfig(
val a: String = "inside-test",
val b: Int = 9999
)
case class ServerConfig(
val a: String = "outside-test",
val b: Int = 8888,
val c: List[SubServerConfig] = List()
)
@maheshkelkar
maheshkelkar / gist:8a9d2706f61ce786af60
Created September 16, 2015 21:47
circe failure to find implicit value for parameter d, with 0.2.0-SNAPSHOT
CirceTest.scala
=================
package mvkpackage
import io.circe._
import cats.data.Xor
import scala.io.Source
object Main extends App {