id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
22815625_69
{ "fields": [ { "declarator": "TEST_CHANNEL_COUNT = 4", "modifier": "public static final", "original_string": "public static final int TEST_CHANNEL_COUNT = 4;", "type": "int", "var_name": "TEST_CHANNEL_COUNT" }, { "declarator": "TEST_SAMPLE_COUNT = 10", "modifier"...
{ "body": "@Test\n\tpublic void testAddSamples() {\n\t\tassertEquals(0, theSource.getNextInsertPos());\n\t\tfloat[] samples = null;\n\t\tsamples = new float[] {1.0F, 2.0F, 3.0F, 4.0F};\n\t\ttheSource.addSamples(samples);\n\t\tassertEquals(1, theSource.getNextInsertPos());\n\t\tassertFalse(theSource.isFull());\n\t\tsa...
{ "fields": [ { "declarator": "listenerList = new EventListenerList()", "modifier": "private", "original_string": "private EventListenerList listenerList = new EventListenerList();", "type": "EventListenerList", "var_name": "listenerList" }, { "declarator": "nextInsertP...
{ "body": "@Override\n\tpublic synchronized void addSamples(float[] newSamples) {\n\n\t\taddSampleChunk(newSamples);\n\t\tfireNewSamplesAddedEvent();\n\n\t}", "class_method_signature": "RoundBufferMultichannelSampleSource.addSamples(float[] newSamples)", "constructor": false, "full_signature": "@Override public...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 22815625, "size": 24710, "stargazer_count": 15, "stars": null, "updates": null, "url": "https://github.com/BrainTech/svarog" }
22815625_28
{ "fields": [], "file": "svarog/src/test/java/org/signalml/math/iirdesigner/InitialStateCalculatorTest.java", "identifier": "InitialStateCalculatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testCalculateZID() {\n\n\t\t//coefficients 1\n\t\tInitialStateCalculator calculator = new InitialStateCalculator(getSampleFilterCoefficients1());\n\t\tRealVector actual = calculator.calculateZID();\n\n\t\tRealVector expected = new ArrayRealVector(new double[] {0.00236855, 0.00024174, 0...
{ "fields": [ { "declarator": "bCoefficients", "modifier": "private", "original_string": "private double[] bCoefficients;", "type": "double[]", "var_name": "bCoefficients" }, { "declarator": "aCoefficients", "modifier": "private", "original_string": "private...
{ "body": "protected RealVector calculateZID() {\n\t\tdouble[] bSubArray = new double[numberOfCoefficients-1];\n\t\tdouble[] aSubArray = new double[numberOfCoefficients-1];\n\n\t\tSystem.arraycopy(bCoefficients, 1, bSubArray, 0, bSubArray.length);\n\t\tSystem.arraycopy(aCoefficients, 1, aSubArray, 0, aSubArray.length...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 22815625, "size": 24710, "stargazer_count": 15, "stars": null, "updates": null, "url": "https://github.com/BrainTech/svarog" }
22815625_4
{ "fields": [], "file": "svarog/src/test/java/org/signalml/math/iirdesigner/FilterCoefficientsTest.java", "identifier": "FilterCoefficientsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testTransformLowpassToBandpass() throws BadFilterParametersException {\n\n\t\tdouble[] b = new double[] {0.06264858};\n\t\tdouble[] a = new double[] {1.00000000, 0.57450003, 1.41502514, 0.54893711,\n\t\t\t\t\t\t\t\t 0.40796631, 0.06264858\n\t\t\t\t\t\t\t\t };\n\t\tFilterCoefficients...
{ "fields": [ { "declarator": "bCoefficients", "modifier": "private", "original_string": "private double[] bCoefficients;", "type": "double[]", "var_name": "bCoefficients" }, { "declarator": "aCoefficients", "modifier": "private", "original_string": "private...
{ "body": "protected void transformLowpassToBandpass(double w0, double bw) throws BadFilterParametersException {\n\n\t\tint D = aCoefficients.length - 1;\n\t\tint N = bCoefficients.length - 1;\n\t\tint ma = Math.max(D,N);\n\t\tint Np = N + ma;\n\t\tint Dp = D + ma;\n\n\t\tdouble[] bprime = new double[Np + 1];\n\t\tdo...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 22815625, "size": 24710, "stargazer_count": 15, "stars": null, "updates": null, "url": "https://github.com/BrainTech/svarog" }
22815625_5
{ "fields": [], "file": "svarog/src/test/java/org/signalml/math/iirdesigner/FilterCoefficientsTest.java", "identifier": "FilterCoefficientsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testTransformLowpassToBandstop() throws BadFilterParametersException {\n\n\t\tdouble[] b = new double[] {0.06264858};\n\t\tdouble[] a = new double[] {1.00000000, 0.57450003, 1.41502514, 0.54893711,\n\t\t\t\t\t\t\t\t 0.40796631, 0.06264858\n\t\t\t\t\t\t\t\t };\n\t\tFilterCoefficients...
{ "fields": [ { "declarator": "bCoefficients", "modifier": "private", "original_string": "private double[] bCoefficients;", "type": "double[]", "var_name": "bCoefficients" }, { "declarator": "aCoefficients", "modifier": "private", "original_string": "private...
{ "body": "protected void transformFromLowpassToBandstop(double w0, double bw) throws BadFilterParametersException {\n\n\t\tint D = aCoefficients.length - 1;\n\t\tint N = bCoefficients.length - 1;\n\t\tint ma = Math.max(D,N);\n\t\tint Np = ma + ma;\n\t\tint Dp = ma + ma;\n\n\t\tdouble[] bprime = new double[Np + 1];\n...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 22815625, "size": 24710, "stargazer_count": 15, "stars": null, "updates": null, "url": "https://github.com/BrainTech/svarog" }
22815625_29
{ "fields": [], "file": "svarog/src/test/java/org/signalml/math/iirdesigner/InitialStateCalculatorTest.java", "identifier": "InitialStateCalculatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testCalculateZIN() {\n\n\t\t//coefficients 1\n\t\tInitialStateCalculator calculator = new InitialStateCalculator(getSampleFilterCoefficients1());\n\t\tRealMatrix actual = calculator.calculateZIN();\n\n\t\tRealMatrix expected = new Array2DRowRealMatrix(new double[][] {\n\t\t\t{-1.686157...
{ "fields": [ { "declarator": "bCoefficients", "modifier": "private", "original_string": "private double[] bCoefficients;", "type": "double[]", "var_name": "bCoefficients" }, { "declarator": "aCoefficients", "modifier": "private", "original_string": "private...
{ "body": "protected RealMatrix calculateZIN() {\n\t\tRealMatrix identityMatrix = MatrixUtils.createRealIdentityMatrix(numberOfCoefficients-1);\n\t\tRealMatrix subtrahend = calculateSubtrahendForZIN();\n\n\t\treturn identityMatrix.subtract(subtrahend);\n\t}", "class_method_signature": "InitialStateCalculator.calcul...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 22815625, "size": 24710, "stargazer_count": 15, "stars": null, "updates": null, "url": "https://github.com/BrainTech/svarog" }
22815625_68
{ "fields": [ { "declarator": "TEST_CHANNEL_COUNT = 4", "modifier": "public static final", "original_string": "public static final int TEST_CHANNEL_COUNT = 4;", "type": "int", "var_name": "TEST_CHANNEL_COUNT" }, { "declarator": "TEST_SAMPLE_COUNT = 10", "modifier"...
{ "body": "@Test\n\tpublic void testIncrNextInsertPos() {\n\t\tassertEquals(0, theSource.getNextInsertPos());\n\t\ttheSource.incrNextInsertPos();\n\t\tassertEquals(1, theSource.getNextInsertPos());\n\t\ttheSource.setNextInsertPos(TEST_SAMPLE_COUNT - 2);\n\t\ttheSource.incrNextInsertPos();\n\t\tassertEquals(TEST_SAMPL...
{ "fields": [ { "declarator": "listenerList = new EventListenerList()", "modifier": "private", "original_string": "private EventListenerList listenerList = new EventListenerList();", "type": "EventListenerList", "var_name": "listenerList" }, { "declarator": "nextInsertP...
{ "body": "protected synchronized void incrNextInsertPos() {\n\n\t\tnextInsertPos++;\n\t\tif (nextInsertPos == sampleCount) {\n\t\t\tfull = true;\n\t\t\tnextInsertPos = 0;\n\t\t}\n\n\t}", "class_method_signature": "RoundBufferMultichannelSampleSource.incrNextInsertPos()", "constructor": false, "full_signature":...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 22815625, "size": 24710, "stargazer_count": 15, "stars": null, "updates": null, "url": "https://github.com/BrainTech/svarog" }
22815625_44
{ "fields": [], "file": "svarog/src/test/java/org/signalml/math/ArrayOperationsTest.java", "identifier": "ArrayOperationsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testRemoveFirstElements() {\n\n\t\tdouble[] array = new double[] {1, 2, 3, 4, 5, 6};\n\t\tdouble[] trimmed = ArrayOperations.removeFirstElements(array, 2);\n\n\t\tassertEquals(4, trimmed.length);\n\t\tassertArrayEquals(trimmed, new double[] {3, 4, 5, 6}, 0.001);\n\n\t}", "class_metho...
{ "fields": [], "file": "svarog/src/main/java/org/signalml/math/ArrayOperations.java", "identifier": "ArrayOperations", "interfaces": "", "methods": [ { "class_method_signature": "ArrayOperations.padArrayWithZerosToSize(double[] array, int newSize)", "constructor": false, "full_signature...
{ "body": "public static double[] removeFirstElements(double[] array, int numberOfElements) {\n\n\t\tassert(array.length > numberOfElements);\n\n\t\tdouble[] trimmedArray = new double[array.length - numberOfElements];\n\n\t\tfor (int i = 0; i < trimmedArray.length; i++)\n\t\t\ttrimmedArray[i] = array[i + numberOfElem...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 22815625, "size": 24710, "stargazer_count": 15, "stars": null, "updates": null, "url": "https://github.com/BrainTech/svarog" }
22815625_13
{ "fields": [], "file": "svarog/src/test/java/org/signalml/math/iirdesigner/math/SpecialMathTest.java", "identifier": "SpecialMathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testFactorialTest() {\n\n\t\tassertEquals(1, factorial(0));\n\t\tassertEquals(1, factorial(1));\n\t\tassertEquals(2, factorial(2));\n\t\tassertEquals(6, factorial(3));\n\t\tassertEquals(120, factorial(5));\n\n\t}", "class_method_signature": "SpecialMathTest.testFactorialTest()", "c...
{ "fields": [ { "declarator": "logger = Logger.getLogger(SpecialMath.class)", "modifier": "protected static final", "original_string": "protected static final Logger logger = Logger.getLogger(SpecialMath.class);", "type": "Logger", "var_name": "logger" }, { "declarator"...
{ "body": "public static int factorial(int n) {\n\n\t\tif (n < 0)\n\t\t\tthrow new IllegalArgumentException(\"n must be >= 0\");\n\n\t\tint value = 1;\n\t\tfor (int i = 2; i <= n; i++)\n\t\t\tvalue *= i;\n\t\treturn value;\n\n\t}", "class_method_signature": "SpecialMath.factorial(int n)", "constructor": false, ...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 22815625, "size": 24710, "stargazer_count": 15, "stars": null, "updates": null, "url": "https://github.com/BrainTech/svarog" }
22815625_52
{ "fields": [], "file": "svarog/src/test/java/org/signalml/math/fft/FourierTransformTest.java", "identifier": "FourierTransformTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testPadWithZeroIfNecessary() {\n\t\tdouble[] signal = new double[] {1, 2, 3, 4, 5};\n\t\tdouble[] paddedSignal = FourierTransform.padWithZeroIfNecessary(signal);\n\t\tdouble[] expected = new double[] {1, 2, 3, 4, 5, 0, 0, 0};\n\t\tassertArrayEquals(expected, paddedSignal, 1e-5);\n\n\t\...
{ "fields": [ { "declarator": "windowFunction = new WindowFunction(WindowType.RECTANGULAR)", "modifier": "private", "original_string": "private WindowFunction windowFunction = new WindowFunction(WindowType.RECTANGULAR);", "type": "WindowFunction", "var_name": "windowFunction" } ...
{ "body": "public static double[] padWithZeroIfNecessary(double[] signal) {\n\t\tint powerOfTwoSize = getPowerOfTwoSize(signal.length);\n\t\tif (powerOfTwoSize != signal.length) {\n\t\t\treturn ArrayOperations.padArrayWithZerosToSize(signal, powerOfTwoSize);\n\t\t} else {\n\t\t\treturn signal;\n\t\t}\n\t}", "class_...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 22815625, "size": 24710, "stargazer_count": 15, "stars": null, "updates": null, "url": "https://github.com/BrainTech/svarog" }
22815625_25
{ "fields": [ { "declarator": "iirdesigner = new ButterworthIIRDesigner()", "modifier": "", "original_string": "ButterworthIIRDesigner iirdesigner = new ButterworthIIRDesigner();", "type": "ButterworthIIRDesigner", "var_name": "iirdesigner" } ], "file": "svarog/src/test/java/...
{ "body": "@Test\n\tpublic void testCalculatePrototype() {\n\n\t\tFilterZerosPolesGain zpk1 = iirdesigner.calculatePrototype(3);\n\n\t\tComplex[] poles = new Complex[] {new Complex(-0.5, 8.66025404e-1), new Complex(-1.0, 0.0), new Complex(-0.5, -8.66025404e-1)};\n\t\tFilterZerosPolesGain zpk2 = new FilterZerosPolesGa...
{ "fields": [], "file": "svarog/src/main/java/org/signalml/math/iirdesigner/ButterworthIIRDesigner.java", "identifier": "ButterworthIIRDesigner", "interfaces": "", "methods": [ { "class_method_signature": "ButterworthIIRDesigner.calculatePrototype(int filterOrder, double gpass, double gstop)", ...
{ "body": "@Override\n\tprotected FilterZerosPolesGain calculatePrototype(int filterOrder, double gpass, double gstop) {\n\t\treturn calculatePrototype(filterOrder);\n\t}", "class_method_signature": "ButterworthIIRDesigner.calculatePrototype(int filterOrder, double gpass, double gstop)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 22815625, "size": 24710, "stargazer_count": 15, "stars": null, "updates": null, "url": "https://github.com/BrainTech/svarog" }
22815625_9
{ "fields": [], "file": "svarog/src/test/java/org/signalml/math/iirdesigner/math/SpecialMathTest.java", "identifier": "SpecialMathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testGetMachineEpsilon() {\n\t\tassertEquals(1.1102230246251565E-16, getMachineEpsilon(), 1e-32);\n\t}", "class_method_signature": "SpecialMathTest.testGetMachineEpsilon()", "constructor": false, "full_signature": "@Test public void testGetMachineEpsilon()", "identifier": "testG...
{ "fields": [ { "declarator": "logger = Logger.getLogger(SpecialMath.class)", "modifier": "protected static final", "original_string": "protected static final Logger logger = Logger.getLogger(SpecialMath.class);", "type": "Logger", "var_name": "logger" }, { "declarator"...
{ "body": "public static double getMachineEpsilon() {\n\n\t\tif (machineEpsilon == 0.0) {\n\t\t\tmachineEpsilon = 0.5;\n\t\t\twhile (1+machineEpsilon > 1)\n\t\t\t\tmachineEpsilon /= 2;\n\t\t}\n\t\treturn machineEpsilon;\n\n\t}", "class_method_signature": "SpecialMath.getMachineEpsilon()", "constructor": false, ...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 22815625, "size": 24710, "stargazer_count": 15, "stars": null, "updates": null, "url": "https://github.com/BrainTech/svarog" }
22815625_72
{ "fields": [ { "declarator": "TEST_SAMPLE_COUNT = 4", "modifier": "public static final", "original_string": "public static final int TEST_SAMPLE_COUNT = 4;", "type": "int", "var_name": "TEST_SAMPLE_COUNT" }, { "declarator": "source", "modifier": "private", ...
{ "body": "@Test\n\tpublic void testGetSamples() {\n\n\t\tdouble target[];\n\n\t\t//what happens when getting samples from an empty buffer?\n\t\ttarget = new double[4];\n\t\tsource.getSamples(target, 0, 4, 0);\n\t\tfor (int i = 0; i < 4; i++)\n\t\t\tassertEquals(target[i], 0.0, 0.0000001);\n\n\t\tsource.addSamples(ne...
{ "fields": [ { "declarator": "nextInsertPos = 0", "modifier": "protected", "original_string": "protected int nextInsertPos = 0;", "type": "int", "var_name": "nextInsertPos" }, { "declarator": "full", "modifier": "protected", "original_string": "protected bo...
{ "body": "public double[] getSamples() {\n\t\treturn this.samples;\n\t}", "class_method_signature": "RoundBufferSampleSource.getSamples()", "constructor": false, "full_signature": "public double[] getSamples()", "identifier": "getSamples", "invocations": [], "modifiers": "public", "parameters": "()", ...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 22815625, "size": 24710, "stargazer_count": 15, "stars": null, "updates": null, "url": "https://github.com/BrainTech/svarog" }
22815625_64
{ "fields": [], "file": "svarog/src/test/java/org/signalml/domain/signal/filter/iir/helper/GrowSignalSampleSourceTest.java", "identifier": "GrowSignalSampleSourceTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testGetSamples() {\n\n\t\tdouble[][] samples = new double[][]\n\t\t\t\t{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}};\n\n\t\tDoubleArraySampleSource multichannelSampleSource = new DoubleArraySampleSource(samples, samples.length, samples[0].length);\n\t\tChannelSelectorSampleSource ...
{ "fields": [ { "declarator": "bCoefficients", "modifier": "protected", "original_string": "protected double[] bCoefficients;", "type": "double[]", "var_name": "bCoefficients" }, { "declarator": "aCoefficients", "modifier": "protected", "original_string": "p...
{ "body": "@Override\n\tpublic void getSamples(double[] target, int signalOffset, int count, int arrayOffset) {\n\n\t\tdouble[] left = getLeftPart(signalOffset, count);\n\t\tdouble[] center = getCenterPart(signalOffset, count);\n\t\tdouble[] right = getRightPart(signalOffset, count);\n\n\t\tSystem.arraycopy(left, 0, ...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 22815625, "size": 24710, "stargazer_count": 15, "stars": null, "updates": null, "url": "https://github.com/BrainTech/svarog" }
22815625_33
{ "fields": [], "file": "svarog/src/test/java/org/signalml/math/iirdesigner/FilterFrequencyResponseCalculatorTest.java", "identifier": "FilterFrequencyResponseCalculatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testGetGroupDelayResponse() {\n\n\t\tFilterCoefficients coeffs = new FilterCoefficients(\n\t\t\tnew double[] {0.0562, -0.0260, -0.0603, -0.0260, 0.0562},\n\t\t\tnew double[] {1.0000, -3.0870, 3.7266, -2.1103, 0.4806});\n\t\tFilterFrequencyResponseCalculator calc = new FilterFrequencyRe...
{ "fields": [ { "declarator": "logger = Logger.getLogger(FilterFrequencyResponseCalculator.class)", "modifier": "protected static final", "original_string": "protected static final Logger logger = Logger.getLogger(FilterFrequencyResponseCalculator.class);", "type": "Logger", "var_nam...
{ "body": "public FilterFrequencyResponse getGroupDelayResponse() {\n\t\t/**\n\t\t * Implementation details:\n\t\t * https://ccrma.stanford.edu/~jos/filters/Numerical_Computation_Group_Delay.html\n\t\t * https://ccrma.stanford.edu/~jos/filters/Group_Delay_Computation_grpdelay_m.html\n\t\t *\n\t\t * This algorithm poo...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 22815625, "size": 24710, "stargazer_count": 15, "stars": null, "updates": null, "url": "https://github.com/BrainTech/svarog" }
22815625_48
{ "fields": [], "file": "svarog/src/test/java/org/signalml/math/fft/FourierTransformTest.java", "identifier": "FourierTransformTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testForwardFFT() {\n\t\tFourierTransform transform = new FourierTransform();\n\t\tdouble[] signal = new double[] {1,4,2,-1,7,4,5,2};\n\t\tComplex[] expectedFFT = new Complex[] {\n\t\t\tnew Complex(24.00000000,0),\n\t\t\tnew Complex(-3.87867966, 5.12132034),\n\t\t\tnew Complex(1.0000000...
{ "fields": [ { "declarator": "windowFunction = new WindowFunction(WindowType.RECTANGULAR)", "modifier": "private", "original_string": "private WindowFunction windowFunction = new WindowFunction(WindowType.RECTANGULAR);", "type": "WindowFunction", "var_name": "windowFunction" } ...
{ "body": "public Complex[] forwardFFT(double[] signal) {\n\t\tFastFourierTransformer transformer = new FastFourierTransformer();\n\t\tdouble[] windowedSignal = windowFunction.applyWindow(signal);\n\t\tdouble[] paddedSignal = padWithZeroIfNecessary(windowedSignal);\n\t\treturn transformer.transform(paddedSignal);\n\n...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 22815625, "size": 24710, "stargazer_count": 15, "stars": null, "updates": null, "url": "https://github.com/BrainTech/svarog" }
1184582_8
{ "fields": [], "file": "zenithr/zenithr/src/test/java/org/kiegroup/zenithr/drools/regex/ConverterUtilsTest.java", "identifier": "ConverterUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetOutputDeclaredType() {\n Spec spec = buildSpec();\n spec.setOutput(\"Results\");\n ConverterUtils converter = new ConverterUtils(spec);\n assertEquals(\"output.setAverage((math.getNumber() + physics.getNumber() + biology.getNumber()) / 3);\", conver...
{ "fields": [ { "declarator": "VARIABLE_SEPARATOR = \"\\\\.\"", "modifier": "private static final", "original_string": "private static final String VARIABLE_SEPARATOR = \"\\\\.\";", "type": "String", "var_name": "VARIABLE_SEPARATOR" }, { "declarator": "VARIABLES_PATTERN...
{ "body": "public String parseOutput(String right) {\n return parseOutput(null, right);\n }", "class_method_signature": "ConverterUtils.parseOutput(String right)", "constructor": false, "full_signature": "public String parseOutput(String right)", "identifier": "parseOutput", "invocations": [ "...
{ "created": "12/20/2010 3:42:26 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 1184582, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-15T09:59:20+00:00", "url": "https://github.com/kiegroup/droolsjb...
1184582_4
{ "fields": [], "file": "zenithr/zenithr/src/test/java/org/kiegroup/zenithr/drools/model/SpecTest.java", "identifier": "SpecTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseRules() throws IOException {\n JsonArray rules = buildRules();\n JsonObject json = Json.createObjectBuilder()\n .add(Spec.FIELD_INPUTS, buildInputs())\n .add(Spec.FIELD_TYPES, buildTypes())\n ...
{ "fields": [ { "declarator": "DEFAULT_SPEC_NAME = \"Zenithr\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_SPEC_NAME = \"Zenithr\";", "type": "String", "var_name": "DEFAULT_SPEC_NAME" }, { "declarator": "FIELD_NAME = \"n...
{ "body": "public List<Rule> getRules() {\n return rules;\n }", "class_method_signature": "Spec.getRules()", "constructor": false, "full_signature": "public List<Rule> getRules()", "identifier": "getRules", "invocations": [], "modifiers": "public", "parameters": "()", "return": "List<Rule>",...
{ "created": "12/20/2010 3:42:26 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 1184582, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-15T09:59:20+00:00", "url": "https://github.com/kiegroup/droolsjb...
1184582_5
{ "fields": [], "file": "zenithr/zenithr/src/test/java/org/kiegroup/zenithr/drools/regex/ConverterUtilsTest.java", "identifier": "ConverterUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetOutputFieldTypeString() {\n Spec spec = buildSpec();\n spec.setOutput(\"string\");\n ConverterUtils converter = new ConverterUtils(spec);\n assertEquals(\"output.setString(\\\"F\\\");\", converter.parseOutput(\"F\"));\n assertEquals(\"output....
{ "fields": [ { "declarator": "VARIABLE_SEPARATOR = \"\\\\.\"", "modifier": "private static final", "original_string": "private static final String VARIABLE_SEPARATOR = \"\\\\.\";", "type": "String", "var_name": "VARIABLE_SEPARATOR" }, { "declarator": "VARIABLES_PATTERN...
{ "body": "public String parseOutput(String right) {\n return parseOutput(null, right);\n }", "class_method_signature": "ConverterUtils.parseOutput(String right)", "constructor": false, "full_signature": "public String parseOutput(String right)", "identifier": "parseOutput", "invocations": [ "...
{ "created": "12/20/2010 3:42:26 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 1184582, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-15T09:59:20+00:00", "url": "https://github.com/kiegroup/droolsjb...
1184582_9
{ "fields": [], "file": "zenithr/zenithr/src/test/java/org/kiegroup/zenithr/drools/regex/ConverterUtilsTest.java", "identifier": "ConverterUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetter() {\n ConverterUtils converter = new ConverterUtils(buildSpec());\n assertEquals(\"name.getString()\", converter.getGetter(\"name\"));\n assertEquals(\"user.getAge()\", converter.getGetter(\"user.age\"));\n assertEquals(\"grade.getNumber()\", co...
{ "fields": [ { "declarator": "VARIABLE_SEPARATOR = \"\\\\.\"", "modifier": "private static final", "original_string": "private static final String VARIABLE_SEPARATOR = \"\\\\.\";", "type": "String", "var_name": "VARIABLE_SEPARATOR" }, { "declarator": "VARIABLES_PATTERN...
{ "body": "public String getGetter(String text) {\n String[] parts = text.split(VARIABLE_SEPARATOR);\n if (parts.length == 0) {\n return \"\";\n }\n if (parts.length == 1) {\n return getGetter(text + \".\" + types.get(text).getValue());\n }\n StringBuffe...
{ "created": "12/20/2010 3:42:26 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 1184582, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-15T09:59:20+00:00", "url": "https://github.com/kiegroup/droolsjb...
1184582_2
{ "fields": [], "file": "zenithr/zenithr/src/test/java/org/kiegroup/zenithr/drools/model/SpecTest.java", "identifier": "SpecTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testOutputComplexType() throws IOException {\n JsonObject json = Json.createObjectBuilder()\n .add(Spec.FIELD_INPUTS, Json.createArrayBuilder())\n .add(Spec.FIELD_TYPES, buildTypes())\n .add...
{ "fields": [ { "declarator": "DEFAULT_SPEC_NAME = \"Zenithr\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_SPEC_NAME = \"Zenithr\";", "type": "String", "var_name": "DEFAULT_SPEC_NAME" }, { "declarator": "FIELD_NAME = \"n...
{ "body": "public String getOutput() {\n return output;\n }", "class_method_signature": "Spec.getOutput()", "constructor": false, "full_signature": "public String getOutput()", "identifier": "getOutput", "invocations": [], "modifiers": "public", "parameters": "()", "return": "String", "sig...
{ "created": "12/20/2010 3:42:26 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 1184582, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-15T09:59:20+00:00", "url": "https://github.com/kiegroup/droolsjb...
1184582_3
{ "fields": [], "file": "zenithr/zenithr/src/test/java/org/kiegroup/zenithr/drools/model/SpecTest.java", "identifier": "SpecTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseDeclare() throws IOException {\n JsonObject json = Json.createObjectBuilder()\n .add(Spec.FIELD_INPUTS, Json.createArrayBuilder())\n // .add(Spec.FIELD_RULES, Json.createArrayBuilder())\n ...
{ "fields": [ { "declarator": "DEFAULT_SPEC_NAME = \"Zenithr\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_SPEC_NAME = \"Zenithr\";", "type": "String", "var_name": "DEFAULT_SPEC_NAME" }, { "declarator": "FIELD_NAME = \"n...
{ "body": "public Map<String, DeclaredType> getTypes() {\n return types;\n }", "class_method_signature": "Spec.getTypes()", "constructor": false, "full_signature": "public Map<String, DeclaredType> getTypes()", "identifier": "getTypes", "invocations": [], "modifiers": "public", "parameters": "...
{ "created": "12/20/2010 3:42:26 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 1184582, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-15T09:59:20+00:00", "url": "https://github.com/kiegroup/droolsjb...
1184582_0
{ "fields": [], "file": "jbpm-simulation/src/test/java/org/jbpm/simulation/impl/ht/StaffPoolImplTest.java", "identifier": "StaffPoolImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSingleWorkingHours() {\n HumanTaskNode node = new HumanTaskNode();\n\n Map<String, Object> properties = new HashMap<String, Object>();\n properties.put(SimulationConstants.STAFF_AVAILABILITY, 1);\n properties.put(SimulationConstants.TIMEUNIT, \"min\");...
{ "fields": [ { "declarator": "properties", "modifier": "private", "original_string": "private Map<String, Object> properties;", "type": "Map<String, Object>", "var_name": "properties" }, { "declarator": "poolSize", "modifier": "private", "original_string": ...
{ "body": "protected long allocate(long startTime, long duration) {\n\t\tperformedWork += duration;\n\t \n\t return rangeChain.allocateWork(startTime, duration);\n\t}", "class_method_signature": "StaffPoolImpl.allocate(long startTime, long duration)", "constructor": false, "full_signature": "protected lon...
{ "created": "12/20/2010 3:42:26 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 1184582, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-15T09:59:20+00:00", "url": "https://github.com/kiegroup/droolsjb...
1184582_1
{ "fields": [], "file": "jbpm-simulation/src/test/java/org/jbpm/simulation/impl/ht/StaffPoolImplTest.java", "identifier": "StaffPoolImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRangeWorkingHours() {\n HumanTaskNode node = new HumanTaskNode();\n\n Map<String, Object> properties = new HashMap<String, Object>();\n properties.put(SimulationConstants.STAFF_AVAILABILITY, 1);\n properties.put(SimulationConstants.TIMEUNIT, \"min\");\...
{ "fields": [ { "declarator": "properties", "modifier": "private", "original_string": "private Map<String, Object> properties;", "type": "Map<String, Object>", "var_name": "properties" }, { "declarator": "poolSize", "modifier": "private", "original_string": ...
{ "body": "protected long allocate(long startTime, long duration) {\n\t\tperformedWork += duration;\n\t \n\t return rangeChain.allocateWork(startTime, duration);\n\t}", "class_method_signature": "StaffPoolImpl.allocate(long startTime, long duration)", "constructor": false, "full_signature": "protected lon...
{ "created": "12/20/2010 3:42:26 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 1184582, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-15T09:59:20+00:00", "url": "https://github.com/kiegroup/droolsjb...
1184582_6
{ "fields": [], "file": "zenithr/zenithr/src/test/java/org/kiegroup/zenithr/drools/regex/ConverterUtilsTest.java", "identifier": "ConverterUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetOutputFieldTypeInteger() {\n Spec spec = buildSpec();\n spec.setOutput(\"integer\");\n ConverterUtils converter = new ConverterUtils(spec);\n assertEquals(\"output.setInteger(34);\", converter.parseOutput(\"34\"));\n assertEquals(\"output.set...
{ "fields": [ { "declarator": "VARIABLE_SEPARATOR = \"\\\\.\"", "modifier": "private static final", "original_string": "private static final String VARIABLE_SEPARATOR = \"\\\\.\";", "type": "String", "var_name": "VARIABLE_SEPARATOR" }, { "declarator": "VARIABLES_PATTERN...
{ "body": "public String parseOutput(String right) {\n return parseOutput(null, right);\n }", "class_method_signature": "ConverterUtils.parseOutput(String right)", "constructor": false, "full_signature": "public String parseOutput(String right)", "identifier": "parseOutput", "invocations": [ "...
{ "created": "12/20/2010 3:42:26 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 1184582, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-15T09:59:20+00:00", "url": "https://github.com/kiegroup/droolsjb...
1184582_10
{ "fields": [], "file": "machinelearning/7.0.x/drools-learner/src/test/java/org/drools/learner/InstanceTest.java", "identifier": "InstanceTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testInstanceCreationAndReadAccessor() {\n Schema schema = Schema.createSchemaStructure(Car.class, Learner.DataType.STRUCTURED);\n InstanceFactory instFactory = new InstanceFactory(schema);\n Instance m1 = instFactory.createInstance(new Car( \"m1\",2, \"s\", \"p\...
{ "fields": [ { "declarator": "attributes", "modifier": "private", "original_string": "private HashMap<String, Attribute> attributes;", "type": "HashMap<String, Attribute>", "var_name": "attributes" }, { "declarator": "weight = 1.0", "modifier": "private", "...
{ "body": "public Attribute getAttr(String fieldName) {\n return attributes.get(fieldName);\n }", "class_method_signature": "Instance.getAttr(String fieldName)", "constructor": false, "full_signature": "public Attribute getAttr(String fieldName)", "identifier": "getAttr", "invocations": [ "get...
{ "created": "12/20/2010 3:42:26 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 1184582, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-15T09:59:20+00:00", "url": "https://github.com/kiegroup/droolsjb...
1184582_7
{ "fields": [], "file": "zenithr/zenithr/src/test/java/org/kiegroup/zenithr/drools/regex/ConverterUtilsTest.java", "identifier": "ConverterUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetOutputFieldTypeNumber() {\n Spec spec = buildSpec();\n spec.setOutput(\"number\");\n ConverterUtils converter = new ConverterUtils(spec);\n assertEquals(\"output.setNumber((math.getNumber() + physics.getNumber() + biology.getNumber()) / 3);\", conve...
{ "fields": [ { "declarator": "VARIABLE_SEPARATOR = \"\\\\.\"", "modifier": "private static final", "original_string": "private static final String VARIABLE_SEPARATOR = \"\\\\.\";", "type": "String", "var_name": "VARIABLE_SEPARATOR" }, { "declarator": "VARIABLES_PATTERN...
{ "body": "public String parseOutput(String right) {\n return parseOutput(null, right);\n }", "class_method_signature": "ConverterUtils.parseOutput(String right)", "constructor": false, "full_signature": "public String parseOutput(String right)", "identifier": "parseOutput", "invocations": [ "...
{ "created": "12/20/2010 3:42:26 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 1184582, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-15T09:59:20+00:00", "url": "https://github.com/kiegroup/droolsjb...
26862250_54
{ "fields": [ { "declarator": "service = new DefaultUserInfoUserDetailsService()", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate DefaultUserInfoUserDetailsService service = new DefaultUserInfoUserDetailsService();", "type": "DefaultUserInfoUserDetailsSe...
{ "body": "@Test\n\tpublic void loadByUsername_regular_success() {\n\n\t\tMockito.when(userInfoRepository.getByUsername(regularUsername)).thenReturn(userInfoRegular);\n\t\tUserDetails user = service.loadUserByUsername(regularUsername);\n\t\tArrayList<GrantedAuthority> userAuthorities = Lists.newArrayList(user.getAuth...
{ "fields": [ { "declarator": "repository", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate UserInfoRepository repository;", "type": "UserInfoRepository", "var_name": "repository" }, { "declarator": "ROLE_USER = new SimpleGrantedAuthority(...
{ "body": "@Override\n\tpublic UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {\n\t\tUserInfo userInfo = repository.getByUsername(username);\n\n\t\tif (userInfo != null) {\n\n\t\t\t// TODO: make passwords configurable? part of object?\n\t\t\tString password = \"password\";\n\n\t\t\tL...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_42
{ "fields": [ { "declarator": "DELTA = 100L", "modifier": "private static final", "original_string": "private static final long DELTA = 100L;", "type": "long", "var_name": "DELTA" }, { "declarator": "authentication", "modifier": "private", "original_string":...
{ "body": "@Test\n\tpublic void refreshAccessToken_requestingSameScope() {\n\n\t\tOAuth2AccessTokenEntity token = service.refreshAccessToken(refreshTokenValue, tokenRequest);\n\n\t\tassertThat(token.getScope(), equalTo(storedScope));\n\t}", "class_method_signature": "TestDefaultOAuth2ProviderTokenService.refreshAcc...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n\tpublic OAuth2AccessTokenEntity refreshAccessToken(String refreshTokenValue, TokenRequest authRequest) throws AuthenticationException {\n\n\t\tOAuth2RefreshTokenEntity refreshToken = tokenRepository.getRefreshTokenByValue(refreshTokenValue);\n\n\t\tif (refreshToken == null) {\n\t\t\tthrow new I...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_108
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test(expected = UnsupportedOperationException.class)\n public void testExportDisabled() throws IOException {\n \tJsonWriter writer = new JsonWriter(new StringWriter());\n \tdataService.exportData(writer);\n }", "class_method_signature": "TestMITREidDataService_1_1.testExportDisabled()", "c...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_1.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_1.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void exportData(JsonWriter writer) throws IOException {\n throw new UnsupportedOperationException(\"Can not export 1.1 format from this version.\");\n }", "class_method_signature": "MITREidDataService_1_1.exportData(JsonWriter writer)", "constructor": false, "full_sign...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_39
{ "fields": [ { "declarator": "DELTA = 100L", "modifier": "private static final", "original_string": "private static final long DELTA = 100L;", "type": "long", "var_name": "DELTA" }, { "declarator": "authentication", "modifier": "private", "original_string":...
{ "body": "@Test(expected = InvalidTokenException.class)\n\tpublic void refreshAccessToken_noRefreshToken() {\n\n\t\tMockito.when(tokenRepository.getRefreshTokenByValue(Matchers.anyString())).thenReturn(null);\n\n\t\tservice.refreshAccessToken(refreshTokenValue, tokenRequest);\n\t}", "class_method_signature": "Test...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n\tpublic OAuth2AccessTokenEntity refreshAccessToken(String refreshTokenValue, TokenRequest authRequest) throws AuthenticationException {\n\n\t\tOAuth2RefreshTokenEntity refreshToken = tokenRepository.getRefreshTokenByValue(refreshTokenValue);\n\n\t\tif (refreshToken == null) {\n\t\t\tthrow new I...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_81
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n public void testExportAuthenticationHolders() throws IOException {\n OAuth2Request req1 = new OAuth2Request(new HashMap<String, String>(), \"client1\", new ArrayList<GrantedAuthority>(),\n true, new HashSet<String>(), new HashSet<String>(), \"...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_2.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_2.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void exportData(JsonWriter writer) throws IOException {\n\n // version tag at the root\n writer.name(MITREID_CONNECT_1_2);\n\n writer.beginObject();\n\n // clients list\n writer.name(CLIENTS);\n writer.beginArray();\n writeClients(write...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_78
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n\tpublic void testImportWhitelistedSites() throws IOException {\n\t\tWhitelistedSite site1 = new WhitelistedSite();\n site1.setId(1L);\n site1.setClientId(\"foo\");\n\n WhitelistedSite site2 = new WhitelistedSite();\n site2.setId(2L);\n site2.setClientId(\"bar\");\...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_2.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_2.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_112
{ "fields": [ { "declarator": "serverConfig", "modifier": "", "original_string": "ServerConfiguration serverConfig;", "type": "ServerConfiguration", "var_name": "serverConfig" }, { "declarator": "clientConfig", "modifier": "", "original_string": "RegisteredC...
{ "body": "@Test(expected = AuthenticationServiceException.class)\n\tpublic void buildAuthRequestUrl_badUri() {\n\n\t\tMockito.when(serverConfig.getAuthorizationEndpointUri()).thenReturn(\"e=mc^2\");\n\n\t\tMap<String, String> options = ImmutableMap.of(\"foo\", \"bar\");\n\n\t\turlBuilder.buildAuthRequestUrl(serverCo...
{ "fields": [], "file": "OpenID-Connect-MITREid-Java-Spring-Server/openid-connect-client/src/main/java/org/mitre/openid/connect/client/service/impl/PlainAuthRequestUrlBuilder.java", "identifier": "PlainAuthRequestUrlBuilder", "interfaces": "implements AuthRequestUrlBuilder", "methods": [ { "class_me...
{ "body": "@Override\n\tpublic String buildAuthRequestUrl(ServerConfiguration serverConfig, RegisteredClient clientConfig, String redirectUri, String nonce, String state, Map<String, String> options) {\n\t\ttry {\n\n\t\t\tURIBuilder uriBuilder = new URIBuilder(serverConfig.getAuthorizationEndpointUri());\n\t\t\turiBu...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_58
{ "fields": [ { "declarator": "service = new DefaultUserInfoService()", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate DefaultUserInfoService service = new DefaultUserInfoService();", "type": "DefaultUserInfoService", "var_name": "service" }, ...
{ "body": "@Test()\n\tpublic void loadByUsername_nullUser() {\n\n\t\tMockito.when(userInfoRepository.getByUsername(adminUsername)).thenReturn(null);\n\t\tUserInfo user = service.getByUsername(adminUsername);\n\n\t\tassertNull(user);\n\t}", "class_method_signature": "TestDefaultUserInfoService.loadByUsername_nullUse...
{ "fields": [ { "declarator": "userInfoRepository", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate UserInfoRepository userInfoRepository;", "type": "UserInfoRepository", "var_name": "userInfoRepository" }, { "declarator": "clientService",...
{ "body": "@Override\n\tpublic UserInfo getByUsername(String username) {\n\t\treturn userInfoRepository.getByUsername(username);\n\t}", "class_method_signature": "DefaultUserInfoService.getByUsername(String username)", "constructor": false, "full_signature": "@Override public UserInfo getByUsername(String usern...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_19
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "tokenRepository", ...
{ "body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void updateClient_blacklistedUri() {\n\n\t\tClientDetailsEntity oldClient = Mockito.mock(ClientDetailsEntity.class);\n\t\tClientDetailsEntity newClient = Mockito.mock(ClientDetailsEntity.class);\n\n\t\tString badSite = \"badsite.xxx\";\n\n\t\tMocki...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ClientDetailsEntityService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ClientDetailsEntityService.class);", "type": "Logger", ...
{ "body": "@Override\n\tpublic ClientDetailsEntity updateClient(ClientDetailsEntity oldClient, ClientDetailsEntity newClient) throws IllegalArgumentException {\n\t\tif (oldClient != null && newClient != null) {\n\n\t\t\tfor (String uri : newClient.getRegisteredRedirectUri()) {\n\t\t\t\tif (blacklistedSiteService.isBl...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_104
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n public void testImportGrants() throws IOException {\n Date creationDate1 = DateUtil.utcToDate(\"2014-09-10T22:49:44.090+0000\");\n Date accessDate1 = DateUtil.utcToDate(\"2014-09-10T23:49:44.090+0000\");\n \n WhitelistedSite mockWlSite1 = mock(WhitelistedSite.class);\...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_1.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_1.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_35
{ "fields": [ { "declarator": "DELTA = 100L", "modifier": "private static final", "original_string": "private static final long DELTA = 100L;", "type": "long", "var_name": "DELTA" }, { "declarator": "authentication", "modifier": "private", "original_string":...
{ "body": "@Test(expected = InvalidClientException.class)\n\tpublic void createAccessToken_nullClient() {\n\n\t\tMockito.when(clientDetailsService.loadClientByClientId(Matchers.anyString())).thenReturn(null);\n\n\t\tservice.createAccessToken(authentication);\n\t}", "class_method_signature": "TestDefaultOAuth2Provid...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n\tpublic OAuth2AccessTokenEntity createAccessToken(OAuth2Authentication authentication) throws AuthenticationException, InvalidClientException {\n\t\tif (authentication != null && authentication.getOAuth2Request() != null) {\n\t\t\t// look up our client\n\t\t\tOAuth2Request clientAuth = authenti...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_62
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n\tpublic void testImportBlacklistedSites() throws IOException {\n\t\tBlacklistedSite site1 = new BlacklistedSite();\n site1.setId(1L);\n site1.setUri(\"http://foo.com\");\n\n BlacklistedSite site2 = new BlacklistedSite();\n site2.setId(2L);\n site2.setUri(\"http://...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_0.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_0.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_1
{ "fields": [], "file": "OpenID-Connect-MITREid-Java-Spring-Server/openid-connect-common/src/test/java/org/mitre/oauth2/model/RegisteredClientTest.java", "identifier": "RegisteredClientTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testRegisteredClient() {\n\n\t\t// make sure all the pass-through getters and setters work\n\n\t\tRegisteredClient c = new RegisteredClient();\n\n\t\tc.setClientId(\"s6BhdRkqt3\");\n\t\tc.setClientSecret(\"ZJYCqe3GGRvdrudKyZS0XhGv_Z45DuKhCUk0gBR1vZk\");\n\t\tc.setClientSecretExpiresAt(...
{ "fields": [ { "declarator": "registrationAccessToken", "modifier": "private", "original_string": "private String registrationAccessToken;", "type": "String", "var_name": "registrationAccessToken" }, { "declarator": "registrationClientUri", "modifier": "private",...
{ "body": "public RegisteredClient() {\n\t\tthis.client = new ClientDetailsEntity();\n\t}", "class_method_signature": "RegisteredClient.RegisteredClient()", "constructor": true, "full_signature": "public RegisteredClient()", "identifier": "RegisteredClient", "invocations": [], "modifiers": "public", "p...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_74
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n\tpublic void testImportClients() throws IOException {\n\t\tClientDetailsEntity client1 = new ClientDetailsEntity();\n\t\tclient1.setId(1L);\n\t\tclient1.setAccessTokenValiditySeconds(3600);\n\t\tclient1.setClientId(\"client1\");\n\t\tclient1.setClientSecret(\"clientsecret1\");\n\t\tclient1.setRedir...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_2.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_2.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_23
{ "fields": [ { "declarator": "defaultDynScope1", "modifier": "private", "original_string": "private SystemScope defaultDynScope1;", "type": "SystemScope", "var_name": "defaultDynScope1" }, { "declarator": "defaultDynScope2", "modifier": "private", "original...
{ "body": "@Test\n\tpublic void getDefaults() {\n\n\t\tSet<SystemScope> defaults = Sets.newHashSet(defaultDynScope1, defaultDynScope2, defaultScope1, defaultScope2);\n\n\t\tassertThat(service.getDefaults(), equalTo(defaults));\n\t}", "class_method_signature": "TestDefaultSystemScopeService.getDefaults()", "constr...
{ "fields": [ { "declarator": "repository", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate SystemScopeRepository repository;", "type": "SystemScopeRepository", "var_name": "repository" }, { "declarator": "isDefault = new Predicate<SystemS...
{ "body": "@Override\n\tpublic Set<SystemScope> getDefaults() {\n\t\treturn Sets.filter(getAll(), isDefault);\n\t}", "class_method_signature": "DefaultSystemScopeService.getDefaults()", "constructor": false, "full_signature": "@Override public Set<SystemScope> getDefaults()", "identifier": "getDefaults", "i...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_22
{ "fields": [ { "declarator": "defaultDynScope1", "modifier": "private", "original_string": "private SystemScope defaultDynScope1;", "type": "SystemScope", "var_name": "defaultDynScope1" }, { "declarator": "defaultDynScope2", "modifier": "private", "original...
{ "body": "@Test\n\tpublic void getAll() {\n\n\t\tassertThat(service.getAll(), equalTo(allScopes));\n\t}", "class_method_signature": "TestDefaultSystemScopeService.getAll()", "constructor": false, "full_signature": "@Test public void getAll()", "identifier": "getAll", "invocations": [ "assertThat", ...
{ "fields": [ { "declarator": "repository", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate SystemScopeRepository repository;", "type": "SystemScopeRepository", "var_name": "repository" }, { "declarator": "isDefault = new Predicate<SystemS...
{ "body": "@Override\n\tpublic Set<SystemScope> getAll() {\n\t\treturn repository.getAll();\n\t}", "class_method_signature": "DefaultSystemScopeService.getAll()", "constructor": false, "full_signature": "@Override public Set<SystemScope> getAll()", "identifier": "getAll", "invocations": [ "getAll" ], ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_75
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n\tpublic void testExportBlacklistedSites() throws IOException {\t\n\t\tBlacklistedSite site1 = new BlacklistedSite();\n site1.setId(1L);\n site1.setUri(\"http://foo.com\");\n\n BlacklistedSite site2 = new BlacklistedSite();\n site2.setId(2L);\n site2.setUri(\"http:...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_2.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_2.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void exportData(JsonWriter writer) throws IOException {\n\n // version tag at the root\n writer.name(MITREID_CONNECT_1_2);\n\n writer.beginObject();\n\n // clients list\n writer.name(CLIENTS);\n writer.beginArray();\n writeClients(write...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_63
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n\tpublic void testImportWhitelistedSites() throws IOException {\n\t\tWhitelistedSite site1 = new WhitelistedSite();\n site1.setId(1L);\n site1.setClientId(\"foo\");\n\n WhitelistedSite site2 = new WhitelistedSite();\n site2.setId(2L);\n site2.setClientId(\"bar\");\...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_0.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_0.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_0
{ "fields": [ { "declarator": "plainText = \"The true sign of intelligence is not knowledge but imagination.\"", "modifier": "private", "original_string": "private String plainText = \"The true sign of intelligence is not knowledge but imagination.\";", "type": "String", "var_name": ...
{ "body": "@Test\n\tpublic void getAllPubKeys() throws ParseException { \n\n\t\tMap<String,JWK> keys2check = service_2.getAllPublicKeys();\n\t\tassertEquals(\n\t\t\tJSONObjectUtils.getString(RSAjwk.toPublicJWK().toJSONObject(), \"e\"),\n\t\t\tJSONObjectUtils.getString(keys2check.get(RSAkid).toJSONObject(), \"e\")\n\t...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultJwtEncryptionAndDecryptionService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultJwtEncryptionAndDecryptionService.class);", "type": "Logger", ...
{ "body": "@Override\n\tpublic Map<String, JWK> getAllPublicKeys() {\n\t\tMap<String, JWK> pubKeys = new HashMap<String, JWK>();\n\n\t\t// pull out all public keys\n\t\tfor (String keyId : keys.keySet()) {\n\t\t\tJWK key = keys.get(keyId);\n\t\t\tJWK pub = key.toPublicJWK();\n\t\t\tif (pub != null) {\n\t\t\t\tpubKeys...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_34
{ "fields": [ { "declarator": "DELTA = 100L", "modifier": "private static final", "original_string": "private static final long DELTA = 100L;", "type": "long", "var_name": "DELTA" }, { "declarator": "authentication", "modifier": "private", "original_string":...
{ "body": "@Test\n\tpublic void createAccessToken_nullAuth() {\n\n\t\tMockito.when(authentication.getOAuth2Request()).thenReturn(null);\n\n\t\ttry {\n\t\t\tservice.createAccessToken(null);\n\t\t\tfail(\"Authentication parameter is null. Excpected a AuthenticationCredentialsNotFoundException.\");\n\t\t} catch (Authent...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n\tpublic OAuth2AccessTokenEntity createAccessToken(OAuth2Authentication authentication) throws AuthenticationException, InvalidClientException {\n\t\tif (authentication != null && authentication.getOAuth2Request() != null) {\n\t\t\t// look up our client\n\t\t\tOAuth2Request clientAuth = authenti...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_105
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n public void testImportAuthenticationHolders() throws IOException {\n OAuth2Request req1 = new OAuth2Request(new HashMap<String, String>(), \"client1\", new ArrayList<GrantedAuthority>(),\n true, new HashSet<String>(), new HashSet<String>(), \"...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_1.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_1.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_18
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "tokenRepository", ...
{ "body": "@Test\n\tpublic void updateClient_nullClients() {\n\n\t\tClientDetailsEntity oldClient = Mockito.mock(ClientDetailsEntity.class);\n\t\tClientDetailsEntity newClient = Mockito.mock(ClientDetailsEntity.class);\n\n\t\ttry {\n\t\t\tservice.updateClient(oldClient, null);\n\t\t\tfail(\"New client is null. Expect...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ClientDetailsEntityService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ClientDetailsEntityService.class);", "type": "Logger", ...
{ "body": "@Override\n\tpublic ClientDetailsEntity updateClient(ClientDetailsEntity oldClient, ClientDetailsEntity newClient) throws IllegalArgumentException {\n\t\tif (oldClient != null && newClient != null) {\n\n\t\t\tfor (String uri : newClient.getRegisteredRedirectUri()) {\n\t\t\t\tif (blacklistedSiteService.isBl...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_59
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n public void testImportRefreshTokens() throws IOException, ParseException {\n String expiration1 = \"2014-09-10T22:49:44.090+0000\";\n Date expirationDate1 = DateUtil.utcToDate(expiration1);\n \n ClientDetailsEntity mockedClient1 = mock(ClientDetailsEntity.class);\n ...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_0.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_0.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_79
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n public void testExportGrants() throws IOException {\n Date creationDate1 = DateUtil.utcToDate(\"2014-09-10T22:49:44.090+0000\");\n Date accessDate1 = DateUtil.utcToDate(\"2014-09-10T23:49:44.090+0000\");\n \n WhitelistedSite mockWlSite1 = mock(WhitelistedSite.class);\...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_2.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_2.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void exportData(JsonWriter writer) throws IOException {\n\n // version tag at the root\n writer.name(MITREID_CONNECT_1_2);\n\n writer.beginObject();\n\n // clients list\n writer.name(CLIENTS);\n writer.beginArray();\n writeClients(write...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_80
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n public void testImportGrants() throws IOException {\n Date creationDate1 = DateUtil.utcToDate(\"2014-09-10T22:49:44.090+0000\");\n Date accessDate1 = DateUtil.utcToDate(\"2014-09-10T23:49:44.090+0000\");\n \n WhitelistedSite mockWlSite1 = mock(WhitelistedSite.class);\...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_2.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_2.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_38
{ "fields": [ { "declarator": "DELTA = 100L", "modifier": "private static final", "original_string": "private static final long DELTA = 100L;", "type": "long", "var_name": "DELTA" }, { "declarator": "authentication", "modifier": "private", "original_string":...
{ "body": "@Test\n\tpublic void createAccessToken_checkAttachedAuthentication() {\n\n\t\tAuthenticationHolderEntity authHolder = Mockito.mock(AuthenticationHolderEntity.class);\n\t\tMockito.when(authHolder.getAuthentication()).thenReturn(authentication);\n\n\t\tMockito.when(authenticationHolderRepository.save(Matcher...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n\tpublic OAuth2AccessTokenEntity createAccessToken(OAuth2Authentication authentication) throws AuthenticationException, InvalidClientException {\n\t\tif (authentication != null && authentication.getOAuth2Request() != null) {\n\t\t\t// look up our client\n\t\t\tOAuth2Request clientAuth = authenti...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_109
{ "fields": [ { "declarator": "serverConfig", "modifier": "private", "original_string": "private ServerConfiguration serverConfig;", "type": "ServerConfiguration", "var_name": "serverConfig" }, { "declarator": "clientConfig", "modifier": "private", "original...
{ "body": "@Test\n\tpublic void buildAuthRequestUrl() {\n\n\t\tString requestUri = urlBuilder.buildAuthRequestUrl(serverConfig, clientConfig, redirectUri, nonce, state, options);\n\n\t\t// parsing the result\n\t\tUriComponentsBuilder builder = null;\n\n\t\ttry {\n\t\t\tbuilder = UriComponentsBuilder.fromUri(new URI(r...
{ "fields": [ { "declarator": "signingAndValidationService", "modifier": "private", "original_string": "private JwtSigningAndValidationService signingAndValidationService;", "type": "JwtSigningAndValidationService", "var_name": "signingAndValidationService" } ], "file": "Open...
{ "body": "@Override\n\tpublic String buildAuthRequestUrl(ServerConfiguration serverConfig, RegisteredClient clientConfig, String redirectUri, String nonce, String state, Map<String, String> options) {\n\n\t\t// create our signed JWT for the request object\n\t\tJWTClaimsSet claims = new JWTClaimsSet();\n\n\t\t//set p...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_43
{ "fields": [ { "declarator": "DELTA = 100L", "modifier": "private static final", "original_string": "private static final long DELTA = 100L;", "type": "long", "var_name": "DELTA" }, { "declarator": "authentication", "modifier": "private", "original_string":...
{ "body": "@Test\n\tpublic void refreshAccessToken_requestingLessScope() {\n\n\t\tSet<String> lessScope = Sets.newHashSet(\"openid\", \"profile\");\n\n\t\ttokenRequest.setScope(lessScope);\n\n\t\tOAuth2AccessTokenEntity token = service.refreshAccessToken(refreshTokenValue, tokenRequest);\n\n\t\tassertThat(token.getSc...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n\tpublic OAuth2AccessTokenEntity refreshAccessToken(String refreshTokenValue, TokenRequest authRequest) throws AuthenticationException {\n\n\t\tOAuth2RefreshTokenEntity refreshToken = tokenRepository.getRefreshTokenByValue(refreshTokenValue);\n\n\t\tif (refreshToken == null) {\n\t\t\tthrow new I...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_14
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "tokenRepository", ...
{ "body": "@Test\n\tpublic void saveNewClient_noOfflineAccess() {\n\n\t\tClientDetailsEntity client = Mockito.mock(ClientDetailsEntity.class);\n\t\tMockito.when(client.getId()).thenReturn(null);\n\n\t\tMockito.when(client.isAllowRefresh()).thenReturn(false);\n\n\t\t// scopes returned by client entities are Strings\n\...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ClientDetailsEntityService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ClientDetailsEntityService.class);", "type": "Logger", ...
{ "body": "@Override\n\tpublic ClientDetailsEntity saveNewClient(ClientDetailsEntity client) {\n\t\tif (client.getId() != null) { // if it's not null, it's already been saved, this is an error\n\t\t\tthrow new IllegalArgumentException(\"Tried to save a new client with an existing ID: \" + client.getId());\n\t\t}\n\n\...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_55
{ "fields": [ { "declarator": "service = new DefaultUserInfoUserDetailsService()", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate DefaultUserInfoUserDetailsService service = new DefaultUserInfoUserDetailsService();", "type": "DefaultUserInfoUserDetailsSe...
{ "body": "@Test(expected = UsernameNotFoundException.class)\n\tpublic void loadByUsername_nullUser() {\n\n\t\tMockito.when(userInfoRepository.getByUsername(adminUsername)).thenReturn(null);\n\t\tservice.loadUserByUsername(adminUsername);\n\n\t}", "class_method_signature": "TestDefaultUserInfoUserDetailsService.loa...
{ "fields": [ { "declarator": "repository", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate UserInfoRepository repository;", "type": "UserInfoRepository", "var_name": "repository" }, { "declarator": "ROLE_USER = new SimpleGrantedAuthority(...
{ "body": "@Override\n\tpublic UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {\n\t\tUserInfo userInfo = repository.getByUsername(username);\n\n\t\tif (userInfo != null) {\n\n\t\t\t// TODO: make passwords configurable? part of object?\n\t\t\tString password = \"password\";\n\n\t\t\tL...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_102
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n\tpublic void testImportBlacklistedSites() throws IOException {\n\t\tBlacklistedSite site1 = new BlacklistedSite();\n site1.setId(1L);\n site1.setUri(\"http://foo.com\");\n\n BlacklistedSite site2 = new BlacklistedSite();\n site2.setId(2L);\n site2.setUri(\"http://...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_1.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_1.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_48
{ "fields": [ { "declarator": "DELTA = 100L", "modifier": "private static final", "original_string": "private static final long DELTA = 100L;", "type": "long", "var_name": "DELTA" }, { "declarator": "authentication", "modifier": "private", "original_string":...
{ "body": "@Test\n\tpublic void refreshAccessToken_expiration() {\n\n\t\tInteger accessTokenValiditySeconds = 3600;\n\n\t\tMockito.when(client.getAccessTokenValiditySeconds()).thenReturn(accessTokenValiditySeconds);\n\n\t\tlong start = System.currentTimeMillis();\n\t\tOAuth2AccessTokenEntity token = service.refreshAc...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n\tpublic OAuth2AccessTokenEntity refreshAccessToken(String refreshTokenValue, TokenRequest authRequest) throws AuthenticationException {\n\n\t\tOAuth2RefreshTokenEntity refreshToken = tokenRepository.getRefreshTokenByValue(refreshTokenValue);\n\n\t\tif (refreshToken == null) {\n\t\t\tthrow new I...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_33
{ "fields": [ { "declarator": "assembler = new DefaultIntrospectionResultAssembler()", "modifier": "private", "original_string": "private DefaultIntrospectionResultAssembler assembler = new DefaultIntrospectionResultAssembler();", "type": "DefaultIntrospectionResultAssembler", "var_n...
{ "body": "@Test\n public void shouldAssembleExpectedResultForRefreshTokenWithoutExpiry() {\n\n // given\n OAuth2RefreshTokenEntity refreshToken = refreshToken(null,\n authentication(\"name\", request(\"clientId\", scopes(\"foo\", \"bar\"))));\n\n UserInfo userInfo = userInfo(\...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(DefaultIntrospectionResultAssembler.class)", "modifier": "private static", "original_string": "private static Logger log = LoggerFactory.getLogger(DefaultIntrospectionResultAssembler.class);", "type": "Logger", "var_name": ...
{ "body": "@Override\n public Map<String, Object> assembleFrom(OAuth2AccessTokenEntity accessToken, UserInfo userInfo) {\n\n Map<String, Object> result = newLinkedHashMap();\n OAuth2Authentication authentication = accessToken.getAuthenticationHolder().getAuthentication();\n\n result.put(\"acti...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_64
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n public void testImportGrants() throws IOException {\n Date creationDate1 = DateUtil.utcToDate(\"2014-09-10T22:49:44.090+0000\");\n Date accessDate1 = DateUtil.utcToDate(\"2014-09-10T23:49:44.090+0000\");\n \n WhitelistedSite mockWlSite1 = mock(WhitelistedSite.class);\...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_0.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_0.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_7
{ "fields": [ { "declarator": "introspectionPermitter", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate DefaultIntrospectionAuthorizer introspectionPermitter;", "type": "DefaultIntrospectionAuthorizer", "var_name": "introspectionPermitter" }, ...
{ "body": "@Test\n\tpublic void shouldPermitIntrospectionToSameClientTheTokenWasIssuedTo() {\n\n\t\t// given\n\t\tString sameClient = \"same\";\n\n\t\t// when\n\t\tboolean permitted = introspectionPermitter.isIntrospectionPermitted(\n\t\t\t\tclientWithId(sameClient), clientWithId(sameClient),\n\t\t\t\tscope(\"scope\"...
{ "fields": [ { "declarator": "scopeService", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate SystemScopeService scopeService;", "type": "SystemScopeService", "var_name": "scopeService" } ], "file": "OpenID-Connect-MITREid-Java-Spring-Server/ope...
{ "body": "@Override\n\tpublic boolean isIntrospectionPermitted(ClientDetails authClient,\n\t\t\tClientDetails tokenClient, Set<String> tokenScope) {\n\t\t// permit introspection if it's the same client that the token was\n\t\t// issued to, or it at least has all the scopes the token was issued\n\t\t// with\n\t\tretu...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_72
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n public void testImportAccessTokens() throws IOException, ParseException {\n String expiration1 = \"2014-09-10T22:49:44.090+0000\";\n Date expirationDate1 = DateUtil.utcToDate(expiration1);\n \n ClientDetailsEntity mockedClient1 = mock(ClientDetailsEntity.class);\n ...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_2.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_2.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_25
{ "fields": [ { "declarator": "defaultDynScope1", "modifier": "private", "original_string": "private SystemScope defaultDynScope1;", "type": "SystemScope", "var_name": "defaultDynScope1" }, { "declarator": "defaultDynScope2", "modifier": "private", "original...
{ "body": "@Test\n\tpublic void fromStrings() {\n\n\t\t// check null condition\n\t\tassertThat(service.fromStrings(null), is(nullValue()));\n\n\t\tassertThat(service.fromStrings(allScopeStrings), equalTo(allScopes));\n\t}", "class_method_signature": "TestDefaultSystemScopeService.fromStrings()", "constructor": fa...
{ "fields": [ { "declarator": "repository", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate SystemScopeRepository repository;", "type": "SystemScopeRepository", "var_name": "repository" }, { "declarator": "isDefault = new Predicate<SystemS...
{ "body": "@Override\n\tpublic Set<SystemScope> fromStrings(Set<String> scope) {\n\t\tif (scope == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn new LinkedHashSet<SystemScope>(Collections2.filter(Collections2.transform(scope, stringToSystemScope), Predicates.notNull()));\n\t\t}\n\t}", "class_method_signat...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_13
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "tokenRepository", ...
{ "body": "@Test\n\tpublic void saveNewClient_yesOfflineAccess() {\n\n\t\tClientDetailsEntity client = Mockito.mock(ClientDetailsEntity.class);\n\t\tMockito.when(client.getId()).thenReturn(null);\n\n\t\tMockito.when(client.isAllowRefresh()).thenReturn(true);\n\n\t\t// scopes returned by client entities are Strings\n\...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ClientDetailsEntityService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ClientDetailsEntityService.class);", "type": "Logger", ...
{ "body": "@Override\n\tpublic ClientDetailsEntity saveNewClient(ClientDetailsEntity client) {\n\t\tif (client.getId() != null) { // if it's not null, it's already been saved, this is an error\n\t\t\tthrow new IllegalArgumentException(\"Tried to save a new client with an existing ID: \" + client.getId());\n\t\t}\n\n\...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_44
{ "fields": [ { "declarator": "DELTA = 100L", "modifier": "private static final", "original_string": "private static final long DELTA = 100L;", "type": "long", "var_name": "DELTA" }, { "declarator": "authentication", "modifier": "private", "original_string":...
{ "body": "@Test(expected = InvalidScopeException.class)\n\tpublic void refreshAccessToken_requestingMoreScope() {\n\n\t\tSet<String> moreScope = Sets.newHashSet(storedScope);\n\t\tmoreScope.add(\"address\");\n\t\tmoreScope.add(\"phone\");\n\n\t\ttokenRequest.setScope(moreScope);\n\n\t\tservice.refreshAccessToken(ref...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n\tpublic OAuth2AccessTokenEntity refreshAccessToken(String refreshTokenValue, TokenRequest authRequest) throws AuthenticationException {\n\n\t\tOAuth2RefreshTokenEntity refreshToken = tokenRepository.getRefreshTokenByValue(refreshTokenValue);\n\n\t\tif (refreshToken == null) {\n\t\t\tthrow new I...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_68
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test(expected = UnsupportedOperationException.class)\n public void testExportDisabled() throws IOException {\n \tJsonWriter writer = new JsonWriter(new StringWriter());\n \tdataService.exportData(writer);\n }", "class_method_signature": "TestMITREidDataService_1_0.testExportDisabled()", "c...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_0.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_0.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void exportData(JsonWriter writer) throws IOException {\n throw new UnsupportedOperationException(\"Can not export 1.0 format from this version.\");\n }", "class_method_signature": "MITREidDataService_1_0.exportData(JsonWriter writer)", "constructor": false, "full_sign...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_87
{ "fields": [ { "declarator": "userId1 = \"batman\"", "modifier": "private", "original_string": "private String userId1 = \"batman\";", "type": "String", "var_name": "userId1" }, { "declarator": "userId2 = \"alfred\"", "modifier": "private", "original_string...
{ "body": "@Test\n\tpublic void calculateSummaryStats() {\n\t\tMap<String, Integer> stats = service.getSummaryStats();\n\n\t\tassertThat(stats.get(\"approvalCount\"), is(4));\n\t\tassertThat(stats.get(\"userCount\"), is(2));\n\t\tassertThat(stats.get(\"clientCount\"), is(3));\n\t}", "class_method_signature": "TestD...
{ "fields": [ { "declarator": "approvedSiteService", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate ApprovedSiteService approvedSiteService;", "type": "ApprovedSiteService", "var_name": "approvedSiteService" }, { "declarator": "clientServ...
{ "body": "@Override\n\tpublic Map<String, Integer> getSummaryStats() {\n\t\treturn summaryCache.get();\n\t}", "class_method_signature": "DefaultStatsService.getSummaryStats()", "constructor": false, "full_signature": "@Override public Map<String, Integer> getSummaryStats()", "identifier": "getSummaryStats", ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_91
{ "fields": [ { "declarator": "repository", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate WhitelistedSiteRepository repository;", "type": "WhitelistedSiteRepository", "var_name": "repository" }, { "declarator": "service", "modifier": "@Injec...
{ "body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void saveNew_notNullId() {\n\n\t\tWhitelistedSite site = Mockito.mock(WhitelistedSite.class);\n\t\tMockito.when(site.getId()).thenReturn(12345L); // arbitrary long value\n\n\t\tservice.saveNew(site);\n\t}", "class_method_signature": "TestDefaultW...
{ "fields": [ { "declarator": "repository", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate WhitelistedSiteRepository repository;", "type": "WhitelistedSiteRepository", "var_name": "repository" } ], "file": "OpenID-Connect-MITREid-Java-Spring-Se...
{ "body": "@Override\n\tpublic WhitelistedSite saveNew(WhitelistedSite whitelistedSite) {\n\t\tif (whitelistedSite.getId() != null) {\n\t\t\tthrow new IllegalArgumentException(\"A new whitelisted site cannot be created with an id value already set: \" + whitelistedSite.getId());\n\t\t}\n\t\treturn repository.save(whi...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_29
{ "fields": [ { "declarator": "assembler = new DefaultIntrospectionResultAssembler()", "modifier": "private", "original_string": "private DefaultIntrospectionResultAssembler assembler = new DefaultIntrospectionResultAssembler();", "type": "DefaultIntrospectionResultAssembler", "var_n...
{ "body": "@Test\n public void shouldAssembleExpectedResultForAccessTokenWithoutUserInfo() throws ParseException {\n\n // given\n OAuth2AccessTokenEntity accessToken = accessToken(new Date(123 * 1000L), scopes(\"foo\", \"bar\"), \"Bearer\",\n authentication(\"name\", request(\"clientId...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(DefaultIntrospectionResultAssembler.class)", "modifier": "private static", "original_string": "private static Logger log = LoggerFactory.getLogger(DefaultIntrospectionResultAssembler.class);", "type": "Logger", "var_name": ...
{ "body": "@Override\n public Map<String, Object> assembleFrom(OAuth2AccessTokenEntity accessToken, UserInfo userInfo) {\n\n Map<String, Object> result = newLinkedHashMap();\n OAuth2Authentication authentication = accessToken.getAuthenticationHolder().getAuthentication();\n\n result.put(\"acti...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_28
{ "fields": [ { "declarator": "assembler = new DefaultIntrospectionResultAssembler()", "modifier": "private", "original_string": "private DefaultIntrospectionResultAssembler assembler = new DefaultIntrospectionResultAssembler();", "type": "DefaultIntrospectionResultAssembler", "var_n...
{ "body": "@Test\n public void shouldAssembleExpectedResultForAccessToken() throws ParseException {\n\n // given\n OAuth2AccessTokenEntity accessToken = accessToken(new Date(123 * 1000L), scopes(\"foo\", \"bar\"), \"Bearer\",\n authentication(\"name\", request(\"clientId\")));\n\n ...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(DefaultIntrospectionResultAssembler.class)", "modifier": "private static", "original_string": "private static Logger log = LoggerFactory.getLogger(DefaultIntrospectionResultAssembler.class);", "type": "Logger", "var_name": ...
{ "body": "@Override\n public Map<String, Object> assembleFrom(OAuth2AccessTokenEntity accessToken, UserInfo userInfo) {\n\n Map<String, Object> result = newLinkedHashMap();\n OAuth2Authentication authentication = accessToken.getAuthenticationHolder().getAuthentication();\n\n result.put(\"acti...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_90
{ "fields": [ { "declarator": "userId1 = \"batman\"", "modifier": "private", "original_string": "private String userId1 = \"batman\";", "type": "String", "var_name": "userId1" }, { "declarator": "userId2 = \"alfred\"", "modifier": "private", "original_string...
{ "body": "@Test\n\tpublic void countForClientId() {\n\n\t\tassertThat(service.getCountForClientId(1L), is(2));\n\t\tassertThat(service.getCountForClientId(2L), is(1));\n\t\tassertThat(service.getCountForClientId(3L), is(1));\n\t\tassertThat(service.getCountForClientId(4L), is(0));\n\t}", "class_method_signature": ...
{ "fields": [ { "declarator": "approvedSiteService", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate ApprovedSiteService approvedSiteService;", "type": "ApprovedSiteService", "var_name": "approvedSiteService" }, { "declarator": "clientServ...
{ "body": "@Override\n\tpublic Integer getCountForClientId(Long id) {\n\n\t\tMap<Long, Integer> counts = getByClientId();\n\t\treturn counts.get(id);\n\n\t}", "class_method_signature": "DefaultStatsService.getCountForClientId(Long id)", "constructor": false, "full_signature": "@Override public Integer getCountF...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_69
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n public void testExportRefreshTokens() throws IOException, ParseException {\n String expiration1 = \"2014-09-10T22:49:44.090+0000\";\n Date expirationDate1 = DateUtil.utcToDate(expiration1);\n \n ClientDetailsEntity mockedClient1 = mock(ClientDetailsEntity.class);\n ...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_2.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_2.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void exportData(JsonWriter writer) throws IOException {\n\n // version tag at the root\n writer.name(MITREID_CONNECT_1_2);\n\n writer.beginObject();\n\n // clients list\n writer.name(CLIENTS);\n writer.beginArray();\n writeClients(write...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_86
{ "fields": [ { "declarator": "userId1 = \"batman\"", "modifier": "private", "original_string": "private String userId1 = \"batman\";", "type": "String", "var_name": "userId1" }, { "declarator": "userId2 = \"alfred\"", "modifier": "private", "original_string...
{ "body": "@Test\n\tpublic void calculateSummaryStats_empty() {\n\n\t\tMockito.when(approvedSiteService.getAll()).thenReturn(new HashSet<ApprovedSite>());\n\n\t\tMap<String, Integer> stats = service.getSummaryStats();\n\n\t\tassertThat(stats.get(\"approvalCount\"), is(0));\n\t\tassertThat(stats.get(\"userCount\"), is...
{ "fields": [ { "declarator": "approvedSiteService", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate ApprovedSiteService approvedSiteService;", "type": "ApprovedSiteService", "var_name": "approvedSiteService" }, { "declarator": "clientServ...
{ "body": "@Override\n\tpublic Map<String, Integer> getSummaryStats() {\n\t\treturn summaryCache.get();\n\t}", "class_method_signature": "DefaultStatsService.getSummaryStats()", "constructor": false, "full_signature": "@Override public Map<String, Integer> getSummaryStats()", "identifier": "getSummaryStats", ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_45
{ "fields": [ { "declarator": "DELTA = 100L", "modifier": "private static final", "original_string": "private static final long DELTA = 100L;", "type": "long", "var_name": "DELTA" }, { "declarator": "authentication", "modifier": "private", "original_string":...
{ "body": "@Test(expected = InvalidScopeException.class)\n\tpublic void refreshAccessToken_requestingMixedScope() {\n\n\t\tSet<String> mixedScope = Sets.newHashSet(\"openid\", \"profile\", \"address\", \"phone\"); // no email or offline_access\n\n\t\ttokenRequest.setScope(mixedScope);\n\n\t\tservice.refreshAccessToke...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n\tpublic OAuth2AccessTokenEntity refreshAccessToken(String refreshTokenValue, TokenRequest authRequest) throws AuthenticationException {\n\n\t\tOAuth2RefreshTokenEntity refreshToken = tokenRepository.getRefreshTokenByValue(refreshTokenValue);\n\n\t\tif (refreshToken == null) {\n\t\t\tthrow new I...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_12
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "tokenRepository", ...
{ "body": "@Test\n\tpublic void saveNewClient_idWasAssigned() {\n\n\t\t// Set up a mock client.\n\t\tClientDetailsEntity client = Mockito.mock(ClientDetailsEntity.class);\n\t\tMockito.when(client.getId()).thenReturn(null);\n\n\t\tservice.saveNewClient(client);\n\n\t\tMockito.verify(client).setClientId(Matchers.anyStr...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ClientDetailsEntityService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ClientDetailsEntityService.class);", "type": "Logger", ...
{ "body": "@Override\n\tpublic ClientDetailsEntity saveNewClient(ClientDetailsEntity client) {\n\t\tif (client.getId() != null) { // if it's not null, it's already been saved, this is an error\n\t\t\tthrow new IllegalArgumentException(\"Tried to save a new client with an existing ID: \" + client.getId());\n\t\t}\n\n\...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_53
{ "fields": [ { "declarator": "service = new DefaultUserInfoUserDetailsService()", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate DefaultUserInfoUserDetailsService service = new DefaultUserInfoUserDetailsService();", "type": "DefaultUserInfoUserDetailsSe...
{ "body": "@Test\n\tpublic void loadByUsername_admin_success() {\n\n\t\tMockito.when(userInfoRepository.getByUsername(adminUsername)).thenReturn(userInfoAdmin);\n\t\tUserDetails user = service.loadUserByUsername(adminUsername);\n\t\tArrayList<GrantedAuthority> userAuthorities = Lists.newArrayList(user.getAuthorities(...
{ "fields": [ { "declarator": "repository", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate UserInfoRepository repository;", "type": "UserInfoRepository", "var_name": "repository" }, { "declarator": "ROLE_USER = new SimpleGrantedAuthority(...
{ "body": "@Override\n\tpublic UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {\n\t\tUserInfo userInfo = repository.getByUsername(username);\n\n\t\tif (userInfo != null) {\n\n\t\t\t// TODO: make passwords configurable? part of object?\n\t\t\tString password = \"password\";\n\n\t\t\tL...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_24
{ "fields": [ { "declarator": "defaultDynScope1", "modifier": "private", "original_string": "private SystemScope defaultDynScope1;", "type": "SystemScope", "var_name": "defaultDynScope1" }, { "declarator": "defaultDynScope2", "modifier": "private", "original...
{ "body": "@Test\n\tpublic void getDynReg() {\n\n\t\tSet<SystemScope> dynReg = Sets.newHashSet(defaultDynScope1, defaultDynScope2, dynScope1);\n\n\t\tassertThat(service.getDynReg(), equalTo(dynReg));\n\t}", "class_method_signature": "TestDefaultSystemScopeService.getDynReg()", "constructor": false, "full_signat...
{ "fields": [ { "declarator": "repository", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate SystemScopeRepository repository;", "type": "SystemScopeRepository", "var_name": "repository" }, { "declarator": "isDefault = new Predicate<SystemS...
{ "body": "@Override\n\tpublic Set<SystemScope> getDynReg() {\n\t\treturn Sets.filter(getAll(), isDynReg);\n\t}", "class_method_signature": "DefaultSystemScopeService.getDynReg()", "constructor": false, "full_signature": "@Override public Set<SystemScope> getDynReg()", "identifier": "getDynReg", "invocation...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_73
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n\tpublic void testExportClients() throws IOException {\n\t\tClientDetailsEntity client1 = new ClientDetailsEntity();\n\t\tclient1.setId(1L);\n\t\tclient1.setAccessTokenValiditySeconds(3600);\n\t\tclient1.setClientId(\"client1\");\n\t\tclient1.setClientSecret(\"clientsecret1\");\n\t\tclient1.setRedir...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_2.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_2.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void exportData(JsonWriter writer) throws IOException {\n\n // version tag at the root\n writer.name(MITREID_CONNECT_1_2);\n\n writer.beginObject();\n\n // clients list\n writer.name(CLIENTS);\n writer.beginArray();\n writeClients(write...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_65
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n public void testImportAuthenticationHolders() throws IOException {\n OAuth2Request req1 = new OAuth2Request(new HashMap<String, String>(), \"client1\", new ArrayList<GrantedAuthority>(),\n true, new HashSet<String>(), new HashSet<String>(), \"...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_0.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_0.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_6
{ "fields": [], "file": "OpenID-Connect-MITREid-Java-Spring-Server/openid-connect-common/src/test/java/org/mitre/openid/connect/ClientDetailsEntityJsonProcessorTest.java", "identifier": "ClientDetailsEntityJsonProcessorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testSerialize() {\n\t\tRegisteredClient c = new RegisteredClient();\n\n\t\tc.setClientId(\"s6BhdRkqt3\");\n\t\tc.setClientSecret(\"ZJYCqe3GGRvdrudKyZS0XhGv_Z45DuKhCUk0gBR1vZk\");\n\t\tc.setClientSecretExpiresAt(new Date(1577858400L * 1000L));\n\t\tc.setRegistrationAccessToken(\"this.is...
{ "fields": [ { "declarator": "parser = new JsonParser()", "modifier": "private static", "original_string": "private static JsonParser parser = new JsonParser();", "type": "JsonParser", "var_name": "parser" } ], "file": "OpenID-Connect-MITREid-Java-Spring-Server/openid-connec...
{ "body": "public static JsonObject serialize(RegisteredClient c) {\n\t\tJsonObject o = new JsonObject();\n\n\t\to.addProperty(\"client_id\", c.getClientId());\n\t\tif (c.getClientSecret() != null) {\n\t\t\to.addProperty(\"client_secret\", c.getClientSecret());\n\n\t\t\tif (c.getClientSecretExpiresAt() == null) {\n\t...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_32
{ "fields": [ { "declarator": "assembler = new DefaultIntrospectionResultAssembler()", "modifier": "private", "original_string": "private DefaultIntrospectionResultAssembler assembler = new DefaultIntrospectionResultAssembler();", "type": "DefaultIntrospectionResultAssembler", "var_n...
{ "body": "@Test\n public void shouldAssembleExpectedResultForRefreshTokenWithoutUserInfo() throws ParseException {\n\n // given\n OAuth2RefreshTokenEntity refreshToken = refreshToken(new Date(123 * 1000L),\n authentication(\"name\", request(\"clientId\", scopes(\"foo\", \"bar\"))));\...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(DefaultIntrospectionResultAssembler.class)", "modifier": "private static", "original_string": "private static Logger log = LoggerFactory.getLogger(DefaultIntrospectionResultAssembler.class);", "type": "Logger", "var_name": ...
{ "body": "@Override\n public Map<String, Object> assembleFrom(OAuth2AccessTokenEntity accessToken, UserInfo userInfo) {\n\n Map<String, Object> result = newLinkedHashMap();\n OAuth2Authentication authentication = accessToken.getAuthenticationHolder().getAuthentication();\n\n result.put(\"acti...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_49
{ "fields": [ { "declarator": "mockToken256", "modifier": "@Mock", "original_string": "@Mock\n\tOAuth2AccessTokenEntity mockToken256;", "type": "OAuth2AccessTokenEntity", "var_name": "mockToken256" }, { "declarator": "mockToken384", "modifier": "@Mock", "ori...
{ "body": "@Test\n\tpublic void getAccessTokenHash256() {\n\n\t\t/*\n\t\t * independently generate hash\n\t\t ascii of token = eyJhbGciOiJub25lIn0.eyJhbGciOiJIUzI1NiIsInN1YiI6ImV4YW1wbGVfdXNlciIsImlzcyI6Ind3dy5leGFtcGxlLmNvbSIsInR5cCI6IkpXVCJ9.\n\t\t base64url of hash = EP1gXNeESRH-n57baopfTQ\n\t\t */\n\t\tString tok...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(IdTokenHashUtils.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(IdTokenHashUtils.class);", "type": "Logger", "var_name": "logger" } ], "file": "O...
{ "body": "public static Base64URL getAccessTokenHash(JWSAlgorithm signingAlg, OAuth2AccessTokenEntity token) {\n\n\t\tbyte[] tokenBytes = token.getJwt().serialize().getBytes();\n\n\t\treturn getHash(signingAlg, tokenBytes);\n\n\t}", "class_method_signature": "IdTokenHashUtils.getAccessTokenHash(JWSAlgorithm signin...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_103
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n\tpublic void testImportWhitelistedSites() throws IOException {\n\t\tWhitelistedSite site1 = new WhitelistedSite();\n site1.setId(1L);\n site1.setClientId(\"foo\");\n\n WhitelistedSite site2 = new WhitelistedSite();\n site2.setId(2L);\n site2.setClientId(\"bar\");\...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_1.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_1.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_27
{ "fields": [ { "declarator": "defaultDynScope1", "modifier": "private", "original_string": "private SystemScope defaultDynScope1;", "type": "SystemScope", "var_name": "defaultDynScope1" }, { "declarator": "defaultDynScope2", "modifier": "private", "original...
{ "body": "@Test\n\tpublic void scopesMatch() {\n\n\t\tSet<String> expected = Sets.newHashSet(\"foo\", \"bar\", \"baz\");\n\t\tSet<String> actualGood = Sets.newHashSet(\"foo\", \"baz\", \"bar\");\n\t\tSet<String> actualGood2 = Sets.newHashSet(\"foo\", \"bar\");\n\t\tSet<String> actualBad = Sets.newHashSet(\"foo\", \"...
{ "fields": [ { "declarator": "repository", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate SystemScopeRepository repository;", "type": "SystemScopeRepository", "var_name": "repository" }, { "declarator": "isDefault = new Predicate<SystemS...
{ "body": "@Override\n\tpublic boolean scopesMatch(Set<String> expected, Set<String> actual) {\n\n\t\tSet<SystemScope> ex = fromStrings(expected);\n\t\tSet<SystemScope> act = fromStrings(actual);\n\n\t\tfor (SystemScope actScope : act) {\n\t\t\t// first check to see if there's an exact match\n\t\t\tif (!ex.contains(a...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_70
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n public void testImportRefreshTokens() throws IOException, ParseException {\n String expiration1 = \"2014-09-10T22:49:44.090+0000\";\n Date expirationDate1 = DateUtil.utcToDate(expiration1);\n \n ClientDetailsEntity mockedClient1 = mock(ClientDetailsEntity.class);\n ...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_2.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_2.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_89
{ "fields": [ { "declarator": "userId1 = \"batman\"", "modifier": "private", "original_string": "private String userId1 = \"batman\";", "type": "String", "var_name": "userId1" }, { "declarator": "userId2 = \"alfred\"", "modifier": "private", "original_string...
{ "body": "@Test\n\tpublic void calculateByClientId() {\n\n\t\tMap<Long, Integer> stats = service.getByClientId();\n\n\t\tassertThat(stats.get(1L), is(2));\n\t\tassertThat(stats.get(2L), is(1));\n\t\tassertThat(stats.get(3L), is(1));\n\t\tassertThat(stats.get(4L), is(0));\n\t}", "class_method_signature": "TestDefau...
{ "fields": [ { "declarator": "approvedSiteService", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate ApprovedSiteService approvedSiteService;", "type": "ApprovedSiteService", "var_name": "approvedSiteService" }, { "declarator": "clientServ...
{ "body": "@Override\n\tpublic Map<Long, Integer> getByClientId() {\n\t\treturn byClientIdCache.get();\n\t}", "class_method_signature": "DefaultStatsService.getByClientId()", "constructor": false, "full_signature": "@Override public Map<Long, Integer> getByClientId()", "identifier": "getByClientId", "invoca...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_66
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n\tpublic void testImportSystemScopes() throws IOException {\n\t\tSystemScope scope1 = new SystemScope();\n\t\tscope1.setId(1L);\n\t\tscope1.setValue(\"scope1\");\n\t\tscope1.setDescription(\"Scope 1\");\n\t\tscope1.setAllowDynReg(false);\n\t\tscope1.setDefaultScope(false);\n\t\tscope1.setIcon(\"glas...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_0.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_0.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_31
{ "fields": [ { "declarator": "assembler = new DefaultIntrospectionResultAssembler()", "modifier": "private", "original_string": "private DefaultIntrospectionResultAssembler assembler = new DefaultIntrospectionResultAssembler();", "type": "DefaultIntrospectionResultAssembler", "var_n...
{ "body": "@Test\n public void shouldAssembleExpectedResultForRefreshToken() throws ParseException {\n\n // given\n OAuth2RefreshTokenEntity refreshToken = refreshToken(new Date(123 * 1000L),\n authentication(\"name\", request(\"clientId\", scopes(\"foo\", \"bar\"))));\n\n User...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(DefaultIntrospectionResultAssembler.class)", "modifier": "private static", "original_string": "private static Logger log = LoggerFactory.getLogger(DefaultIntrospectionResultAssembler.class);", "type": "Logger", "var_name": ...
{ "body": "@Override\n public Map<String, Object> assembleFrom(OAuth2AccessTokenEntity accessToken, UserInfo userInfo) {\n\n Map<String, Object> result = newLinkedHashMap();\n OAuth2Authentication authentication = accessToken.getAuthenticationHolder().getAuthentication();\n\n result.put(\"acti...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_100
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n public void testImportAccessTokens() throws IOException, ParseException {\n String expiration1 = \"2014-09-10T22:49:44.090+0000\";\n Date expirationDate1 = DateUtil.utcToDate(expiration1);\n \n ClientDetailsEntity mockedClient1 = mock(ClientDetailsEntity.class);\n ...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_1.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_1.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_93
{ "fields": [ { "declarator": "repository", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate WhitelistedSiteRepository repository;", "type": "WhitelistedSiteRepository", "var_name": "repository" }, { "declarator": "service", "modifier": "@Injec...
{ "body": "@Test\n\tpublic void update_nullSites() {\n\n\t\tWhitelistedSite oldSite = Mockito.mock(WhitelistedSite.class);\n\t\tWhitelistedSite newSite = Mockito.mock(WhitelistedSite.class);\n\n\t\t// old client null\n\t\ttry {\n\t\t\tservice.update(null, newSite);\n\t\t\tfail(\"Old site input is null. Expected a Ill...
{ "fields": [ { "declarator": "repository", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate WhitelistedSiteRepository repository;", "type": "WhitelistedSiteRepository", "var_name": "repository" } ], "file": "OpenID-Connect-MITREid-Java-Spring-Se...
{ "body": "@Override\n\tpublic WhitelistedSite update(WhitelistedSite oldWhitelistedSite, WhitelistedSite whitelistedSite) {\n\t\tif (oldWhitelistedSite == null || whitelistedSite == null) {\n\t\t\tthrow new IllegalArgumentException(\"Neither the old or new sites may be null\");\n\t\t}\n\t\treturn repository.update(o...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_85
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n public void testFixRefreshTokenAuthHolderReferencesOnImport() throws IOException, ParseException {\n String expiration1 = \"2014-09-10T22:49:44.090+0000\";\n Date expirationDate1 = DateUtil.utcToDate(expiration1);\n \n ClientDetailsEntity mockedClient1 = mock(ClientDe...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_2.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_2.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_9
{ "fields": [ { "declarator": "introspectionPermitter", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate DefaultIntrospectionAuthorizer introspectionPermitter;", "type": "DefaultIntrospectionAuthorizer", "var_name": "introspectionPermitter" }, ...
{ "body": "@Test\n\tpublic void shouldNotPermitIntrospectionToDifferentClientIfScopesDontMatch() {\n\n\t\t// given\n\t\tString authClient = \"auth\";\n\t\tString tokenClient = \"token\";\n\t\tSet<String> authScope = scope(\"scope1\", \"scope2\");\n\t\tSet<String> tokenScope = scope(\"scope1\", \"scope2\", \"scope3\")...
{ "fields": [ { "declarator": "scopeService", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate SystemScopeService scopeService;", "type": "SystemScopeService", "var_name": "scopeService" } ], "file": "OpenID-Connect-MITREid-Java-Spring-Server/ope...
{ "body": "@Override\n\tpublic boolean isIntrospectionPermitted(ClientDetails authClient,\n\t\t\tClientDetails tokenClient, Set<String> tokenScope) {\n\t\t// permit introspection if it's the same client that the token was\n\t\t// issued to, or it at least has all the scopes the token was issued\n\t\t// with\n\t\tretu...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_46
{ "fields": [ { "declarator": "DELTA = 100L", "modifier": "private static final", "original_string": "private static final long DELTA = 100L;", "type": "long", "var_name": "DELTA" }, { "declarator": "authentication", "modifier": "private", "original_string":...
{ "body": "@Test\n\tpublic void refreshAccessToken_requestingEmptyScope() {\n\n\t\tSet<String> emptyScope = Sets.newHashSet();\n\n\t\ttokenRequest.setScope(emptyScope);\n\n\t\tOAuth2AccessTokenEntity token = service.refreshAccessToken(refreshTokenValue, tokenRequest);\n\n\t\tassertThat(token.getScope(), equalTo(store...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n\tpublic OAuth2AccessTokenEntity refreshAccessToken(String refreshTokenValue, TokenRequest authRequest) throws AuthenticationException {\n\n\t\tOAuth2RefreshTokenEntity refreshToken = tokenRepository.getRefreshTokenByValue(refreshTokenValue);\n\n\t\tif (refreshToken == null) {\n\t\t\tthrow new I...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_11
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "tokenRepository", ...
{ "body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void saveNewClient_blacklisted() {\n\n\t\tClientDetailsEntity client = Mockito.mock(ClientDetailsEntity.class);\n\t\tMockito.when(client.getId()).thenReturn(null);\n\n\t\tString badUri = \"badplace.xxx\";\n\n\t\tMockito.when(blacklistedSiteService....
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ClientDetailsEntityService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ClientDetailsEntityService.class);", "type": "Logger", ...
{ "body": "@Override\n\tpublic ClientDetailsEntity saveNewClient(ClientDetailsEntity client) {\n\t\tif (client.getId() != null) { // if it's not null, it's already been saved, this is an error\n\t\t\tthrow new IllegalArgumentException(\"Tried to save a new client with an existing ID: \" + client.getId());\n\t\t}\n\n\...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_50
{ "fields": [ { "declarator": "mockToken256", "modifier": "@Mock", "original_string": "@Mock\n\tOAuth2AccessTokenEntity mockToken256;", "type": "OAuth2AccessTokenEntity", "var_name": "mockToken256" }, { "declarator": "mockToken384", "modifier": "@Mock", "ori...
{ "body": "@Test\n\tpublic void getAccessTokenHash384() {\n\n\t\t/*\n\t\t * independently generate hash\n\t\t ascii of token = eyJhbGciOiJub25lIn0.eyJhbGciOiJFUzM4NCIsInN1YiI6ImFub3RoZXJfdXNlciIsImlzcyI6Ind3dy5hbm90aGVyLWV4YW1wbGUubmV0IiwidHlwIjoiSldUIn0.\n\t\t base64url of hash = BWfFK73PQI36M1rg9R6VjMyWOE0-XvBK\n\t...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(IdTokenHashUtils.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(IdTokenHashUtils.class);", "type": "Logger", "var_name": "logger" } ], "file": "O...
{ "body": "public static Base64URL getAccessTokenHash(JWSAlgorithm signingAlg, OAuth2AccessTokenEntity token) {\n\n\t\tbyte[] tokenBytes = token.getJwt().serialize().getBytes();\n\n\t\treturn getHash(signingAlg, tokenBytes);\n\n\t}", "class_method_signature": "IdTokenHashUtils.getAccessTokenHash(JWSAlgorithm signin...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_51
{ "fields": [ { "declarator": "mockToken256", "modifier": "@Mock", "original_string": "@Mock\n\tOAuth2AccessTokenEntity mockToken256;", "type": "OAuth2AccessTokenEntity", "var_name": "mockToken256" }, { "declarator": "mockToken384", "modifier": "@Mock", "ori...
{ "body": "@Test\n\tpublic void getAccessTokenHash512() {\n\n\t\t/*\n\t\t * independently generate hash\n\t\t ascii of token = eyJhbGciOiJub25lIn0.eyJhbGciOiJSUzUxMiIsInN1YiI6ImRpZmZlcmVudF91c2VyIiwiaXNzIjoid3d3LmRpZmZlcmVudC5jb20iLCJ0eXAiOiJKV1QifQ.\n\t\t base64url of hash = vGH3QMY-knpACkLgzdkTqu3C9jtvbf2Wk_RSu2vAx...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(IdTokenHashUtils.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(IdTokenHashUtils.class);", "type": "Logger", "var_name": "logger" } ], "file": "O...
{ "body": "public static Base64URL getAccessTokenHash(JWSAlgorithm signingAlg, OAuth2AccessTokenEntity token) {\n\n\t\tbyte[] tokenBytes = token.getJwt().serialize().getBytes();\n\n\t\treturn getHash(signingAlg, tokenBytes);\n\n\t}", "class_method_signature": "IdTokenHashUtils.getAccessTokenHash(JWSAlgorithm signin...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_10
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "tokenRepository", ...
{ "body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void saveNewClient_badId() {\n\n\t\t// Set up a mock client.\n\t\tClientDetailsEntity client = Mockito.mock(ClientDetailsEntity.class);\n\t\tMockito.when(client.getId()).thenReturn(12345L); // doesn't matter what id it returns\n\n\t\tservice.saveNe...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ClientDetailsEntityService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ClientDetailsEntityService.class);", "type": "Logger", ...
{ "body": "@Override\n\tpublic ClientDetailsEntity saveNewClient(ClientDetailsEntity client) {\n\t\tif (client.getId() != null) { // if it's not null, it's already been saved, this is an error\n\t\t\tthrow new IllegalArgumentException(\"Tried to save a new client with an existing ID: \" + client.getId());\n\t\t}\n\n\...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_47
{ "fields": [ { "declarator": "DELTA = 100L", "modifier": "private static final", "original_string": "private static final long DELTA = 100L;", "type": "long", "var_name": "DELTA" }, { "declarator": "authentication", "modifier": "private", "original_string":...
{ "body": "@Test\n\tpublic void refreshAccessToken_requestingNullScope() {\n\n\t\ttokenRequest.setScope(null);\n\n\t\tOAuth2AccessTokenEntity token = service.refreshAccessToken(refreshTokenValue, tokenRequest);\n\n\t\tassertThat(token.getScope(), equalTo(storedScope));\n\n\t}", "class_method_signature": "TestDefaul...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n\tpublic OAuth2AccessTokenEntity refreshAccessToken(String refreshTokenValue, TokenRequest authRequest) throws AuthenticationException {\n\n\t\tOAuth2RefreshTokenEntity refreshToken = tokenRepository.getRefreshTokenByValue(refreshTokenValue);\n\n\t\tif (refreshToken == null) {\n\t\t\tthrow new I...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_84
{ "fields": [ { "declarator": "clientRepository", "modifier": "@Mock\n private", "original_string": "@Mock\n private OAuth2ClientRepository clientRepository;", "type": "OAuth2ClientRepository", "var_name": "clientRepository" }, { "declarator": "approvedSiteReposit...
{ "body": "@Test\n\tpublic void testImportSystemScopes() throws IOException {\n\t\tSystemScope scope1 = new SystemScope();\n\t\tscope1.setId(1L);\n\t\tscope1.setValue(\"scope1\");\n\t\tscope1.setDescription(\"Scope 1\");\n\t\tscope1.setAllowDynReg(false);\n\t\tscope1.setDefaultScope(false);\n\t\tscope1.setIcon(\"glas...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MITREidDataService_1_2.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MITREidDataService_1_2.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void importData(JsonReader reader) throws IOException {\n\n logger.info(\"Reading configuration for 1.0\");\n\n // this *HAS* to start as an object\n reader.beginObject();\n\n while (reader.hasNext()) {\n JsonToken tok = reader.peek();\n ...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }
26862250_8
{ "fields": [ { "declarator": "introspectionPermitter", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate DefaultIntrospectionAuthorizer introspectionPermitter;", "type": "DefaultIntrospectionAuthorizer", "var_name": "introspectionPermitter" }, ...
{ "body": "@Test\n\tpublic void shouldPermitIntrospectionToDifferentClientIfScopesMatch() {\n\n\t\t// given\n\t\tString authClient = \"auth\";\n\t\tString tokenClient = \"token\";\n\t\tSet<String> authScope = scope(\"scope1\", \"scope2\", \"scope3\");\n\t\tSet<String> tokenScope = scope(\"scope1\", \"scope2\");\n\t\t...
{ "fields": [ { "declarator": "scopeService", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate SystemScopeService scopeService;", "type": "SystemScopeService", "var_name": "scopeService" } ], "file": "OpenID-Connect-MITREid-Java-Spring-Server/ope...
{ "body": "@Override\n\tpublic boolean isIntrospectionPermitted(ClientDetails authClient,\n\t\t\tClientDetails tokenClient, Set<String> tokenScope) {\n\t\t// permit introspection if it's the same client that the token was\n\t\t// issued to, or it at least has all the scopes the token was issued\n\t\t// with\n\t\tretu...
{ "created": null, "fork": null, "fork_count": 14, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 26862250, "size": 4597, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/france-connect/identity-providers-examples" }