--------------------------------------------------------------------------------
/AUTHORS:
--------------------------------------------------------------------------------
1 | # This is the official list of authors for copyright purposes.
2 | # This file is distinct from the CONTRIBUTORS files.
3 | # See the latter for an explanation.
4 | # Names should be added to this file as:
5 | # Name or Organization
6 | # The email address is not required for organizations.
7 | #
8 | # This list is maintained in lexicographic order.
9 |
10 | AgileBits, Inc.
11 | Dashlane, Inc.
12 | Google, Inc.
13 | Keeper Security, Inc.
14 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/drawable/back.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/drawable/done_disabled.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/demoproviders/trapdoor/README.md:
--------------------------------------------------------------------------------
1 | # Trapdoor - a minimal credential provider
2 |
3 | Trapdoor is much simpler credential provider than Barbican, with no storage and a very simple
4 | cryptographic operation to generate passwords for apps. It transforms a 6-digit pin and an
5 | app identifier into a 16 character password. This approach is fine for a demo, but is riddled
6 | with issues for a real world password manager - DO NOT copy this approach for any real world
7 | usage.
8 |
--------------------------------------------------------------------------------
/demoapps/simplest/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/drawable-v23/splash.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/demoapps/simplest/src/main/res/layout/activity_logged_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
--------------------------------------------------------------------------------
/api/proguard-rules.txt:
--------------------------------------------------------------------------------
1 | # it is safe to ignore the resources ids from OpenYOLO api. Without this flag we have issue with picker_title, provider_list
2 | -dontwarn org.openyolo.api.R$id
3 |
4 | # valid4j use reflection to inject Providers and Policy
5 | -keep class org.valid4j.** { *; }
6 |
7 | # it is safe to ignore okio warnings
8 | -dontwarn okio.**
9 |
10 | # Hamcrest reflection
11 | -keep class org.hamcrest.** { *; }
12 |
13 | # Used by com.google.protobuf.UnsafeUtil
14 | -dontwarn sun.misc.Unsafe
--------------------------------------------------------------------------------
/demoproviders/barbican/res/drawable/create.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/demoproviders/trapdoor/res/drawable/copy_icon.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
--------------------------------------------------------------------------------
/testapp/res/drawable/account_box_24dp.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
15 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/drawable/lock.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
--------------------------------------------------------------------------------
/testapp/proguard-rules.txt:
--------------------------------------------------------------------------------
1 | -dontwarn sun.misc.Unsafe
2 | -dontwarn javax.annotation.**
3 | -dontwarn java.lang.ClassValue
4 | -dontwarn com.google.j2objc.annotations.**
5 | -dontwarn com.google.errorprone.annotations.**
6 | -dontwarn com.google.appengine.**
7 | -dontwarn com.google.apphosting.**
8 | -dontwarn com.google.protobuf.Extension
9 | -dontwarn com.google.protobuf.ExtensionRegistry
10 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
11 |
12 | # ignore dynamic accesses in guava code
13 | -dontnote com.google.common.**
14 |
15 | # ignore dynamic accesses in javalite proto
16 | -dontnote com.google.protobuf.GeneratedMessageLite
--------------------------------------------------------------------------------
/demoproviders/barbican/res/drawable/unlock.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/api/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Credential provider picker
4 | Google Smart Lock
5 |
6 | Possibly unsafe
7 |
8 | Use account from:
9 | Save your account with:
10 | Use account details stored in:
11 | Delete credential from:
12 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | # Travis documentation for Android project builds:
2 | # https://docs.travis-ci.com/user/languages/android
3 |
4 | language: android
5 | android:
6 | components:
7 | - build-tools-26.0.2
8 | - android-26
9 | script:
10 | - ./gradlew check jacoco assemble
11 | - bash <(curl -s https://codecov.io/bash)
12 | before_cache:
13 | - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
14 | - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
15 | cache:
16 | directories:
17 | - $HOME/.gradle/caches/
18 | - $HOME/.gradle/wrapper/
19 | - $HOME/.m2
20 | licenses:
21 | - 'android-sdk-license-.+'
22 | - 'android-sdk-preview-license.+'
23 |
--------------------------------------------------------------------------------
/spi/javatests/java/org/openyolo/spi/Constants.java:
--------------------------------------------------------------------------------
1 | package org.openyolo.spi;
2 |
3 | import org.openyolo.protocol.AuthenticationDomain;
4 |
5 | /** Collection of test constants. */
6 | public final class Constants {
7 | private Constants() {}
8 |
9 | public static final class ValidApplication {
10 | private ValidApplication() {}
11 |
12 | public static String PACKAGE_NAME = "com.super.cool.app";
13 |
14 | private static String AUTHENTICATION_DOMAIN_STRING = "https://accounts.google.com";
15 | public static AuthenticationDomain AUTHENTICATION_DOMAIN =
16 | new AuthenticationDomain(AUTHENTICATION_DOMAIN_STRING);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/config/checkstyle/java.header.noregex:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
--------------------------------------------------------------------------------
/demoproviders/barbican/proguard-rules.txt:
--------------------------------------------------------------------------------
1 | -dontwarn sun.misc.Unsafe
2 | -dontwarn javax.annotation.**
3 | -dontwarn java.lang.ClassValue
4 | -dontwarn com.google.j2objc.annotations.**
5 | -dontwarn com.google.errorprone.annotations.**
6 | -dontwarn com.google.appengine.**
7 | -dontwarn com.google.apphosting.**
8 | -dontwarn com.google.protobuf.Extension
9 | -dontwarn com.google.protobuf.ExtensionRegistry
10 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
11 | -dontwarn com.google.protobuf.UnsafeUtil
12 |
13 | # ignore dynamic accesses in guava code
14 | -dontnote com.google.common.**
15 |
16 | # ignore dynamic accesses in javalite proto
17 | -dontnote com.google.protobuf.GeneratedMessageLite
--------------------------------------------------------------------------------
/demoproviders/trapdoor/proguard-rules.txt:
--------------------------------------------------------------------------------
1 | -dontwarn sun.misc.Unsafe
2 | -dontwarn javax.annotation.**
3 | -dontwarn java.lang.ClassValue
4 | -dontwarn com.google.j2objc.annotations.**
5 | -dontwarn com.google.errorprone.annotations.**
6 | -dontwarn com.google.appengine.**
7 | -dontwarn com.google.apphosting.**
8 | -dontwarn com.google.protobuf.Extension
9 | -dontwarn com.google.protobuf.ExtensionRegistry
10 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
11 | -dontwarn com.google.protobuf.UnsafeUtil
12 |
13 | # ignore dynamic accesses in guava code
14 | -dontnote com.google.common.**
15 |
16 | # ignore dynamic accesses in javalite proto
17 | -dontnote com.google.protobuf.GeneratedMessageLite
--------------------------------------------------------------------------------
/config/checkstyle/java.header:
--------------------------------------------------------------------------------
1 | ^/\*$
2 | ^ \* Copyright 20[0-9]{2} The OpenYOLO Authors\. All Rights Reserved\.$
3 | ^ \*$
4 | ^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\); you may not use this file except$
5 | ^ \* in compliance with the License\. You may obtain a copy of the License at$
6 | ^ \*$
7 | ^ \* http://www\.apache\.org/licenses/LICENSE-2\.0$
8 | ^ \*$
9 | ^ \* Unless required by applicable law or agreed to in writing, software distributed under the$
10 | ^ \* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either$
11 | ^ \* express or implied\. See the License for the specific language governing permissions and$
12 | ^ \* limitations under the License\.$
13 | ^ \*/$
--------------------------------------------------------------------------------
/demoproviders/trapdoor/res/drawable/app_icon.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
16 |
20 |
--------------------------------------------------------------------------------
/testapp/res/layout/id_token_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
13 |
14 |
18 |
19 |
--------------------------------------------------------------------------------
/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | # People who have agreed to one of the CLAs and can contribute patches.
2 | # The AUTHORS file lists the copyright holders; this file
3 | # lists people. For example, Google employees are listed here
4 | # but not in AUTHORS, because Google holds the copyright.
5 | #
6 | # Names should be added to this file as:
7 | # Name
8 | #
9 | # This list is maintained in the lexicographic order of the author's full name.
10 |
11 | David Larson
12 | David Samuelson
13 | Iain McGinniss
14 | Michael Verde
15 | Stan Kocken
16 | Stanojko Markovikj
17 | Shirley Gaw
18 |
--------------------------------------------------------------------------------
/demoapps/simplest/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | OpenYolo Simplest
3 | Demo of OpenYolo login/password authentication into a very simple application
4 | I have an account
5 | Create an account
6 | Username or Email
7 | Password
8 | Login
9 | Create the account
10 | You are logged in!
11 | Either the login or the password is incorrect
12 |
13 |
--------------------------------------------------------------------------------
/testapp/res/drawable/facebook_24dp.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
17 |
--------------------------------------------------------------------------------
/api/javatests/org/openyolo/api/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Tests for OpenYOLO API.
19 | */
20 | package org.openyolo.api;
21 |
--------------------------------------------------------------------------------
/bbq/java/com/google/bbq/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Reference implementation of the BBQ specification.
17 | */
18 | package com.google.bbq;
19 |
--------------------------------------------------------------------------------
/spi/javatests/java/org/openyolo/spi/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Tests for OpenYOLO SPI.
19 | */
20 | package org.openyolo.spi;
21 |
--------------------------------------------------------------------------------
/api/java/org/openyolo/api/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * API for apps to interact with credential managers on the user's device.
17 | */
18 | package org.openyolo.api;
19 |
--------------------------------------------------------------------------------
/api/java/org/openyolo/api/persistence/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Collection of interfaces related to persisting state.
17 | */
18 | package org.openyolo.api.persistence;
19 |
--------------------------------------------------------------------------------
/protocol/javatests/org/openyolo/protocol/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Tests for OpenYOLO Protocol core types.
19 | */
20 | package org.openyolo.protocol;
21 |
--------------------------------------------------------------------------------
/testapp/java/org/openyolo/testapp/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Example usage of the OpenYOLO API to retrieve and save credentials.
17 | */
18 | package org.openyolo.testapp;
19 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/drawable/email.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
15 |
--------------------------------------------------------------------------------
/spi/java/org/openyolo/spi/assetlinks/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Helper classes for working with Digital Asset Link statements.
17 | */
18 | package org.openyolo.spi.assetlinks;
19 |
--------------------------------------------------------------------------------
/api/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
11 |
15 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/protocol/javatests/org/openyolo/protocol/internal/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Tests for internal utilities and types.
19 | */
20 | package org.openyolo.protocol.internal;
21 |
--------------------------------------------------------------------------------
/demoproviders/barbican/java/org/openyolo/demoprovider/barbican/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Example implementation of the OpenYOLO SPI.
17 | */
18 | package org.openyolo.demoprovider.barbican;
19 |
--------------------------------------------------------------------------------
/spi/java/org/openyolo/spi/assetlinks/data/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Helper classes for deserializing Digital Asset Link statements.
17 | */
18 | package org.openyolo.spi.assetlinks.data;
19 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/drawable/person.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
--------------------------------------------------------------------------------
/spi/java/org/openyolo/spi/assetlinks/loader/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Helper classes for loading Digital Asset Link statements and checking relationships.
17 | */
18 | package org.openyolo.spi.assetlinks.loader;
19 |
--------------------------------------------------------------------------------
/spi/java/org/openyolo/spi/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Service provider interface, which credential managers should implement
17 | * to interact with apps that support OpenYOLO.
18 | */
19 | package org.openyolo.spi;
20 |
--------------------------------------------------------------------------------
/demoproviders/barbican/java/org/openyolo/demoprovider/barbican/storage/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Classes pertaining to the encrypted storage of credentials.
17 | */
18 | package org.openyolo.demoprovider.barbican.storage;
19 |
--------------------------------------------------------------------------------
/protocol/java/org/openyolo/protocol/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Data types and messages which are sent between the client and credential provider in the
17 | * OpenYOLO protocol.
18 | */
19 | package org.openyolo.protocol;
20 |
--------------------------------------------------------------------------------
/demoapps/passwordlogin/java/org/openyolo/demoapp/passwordlogin/userdata/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Classes and behavior related to users and user authentication.
17 | */
18 | package org.openyolo.demoapp.passwordlogin.userdata;
19 |
--------------------------------------------------------------------------------
/demoapps/passwordlogin/java/org/openyolo/demoapp/passwordlogin/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Demonstrates the usage of OpenYOLO to facilitate sign-in and sign-up using passwords.
17 | */
18 | package org.openyolo.demoapp.passwordlogin;
19 |
--------------------------------------------------------------------------------
/demoproviders/barbican/java/org/openyolo/demoprovider/barbican/provider/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Classes pertaining to the implementation of the provider end of the OpenYOLO protocol.
17 | */
18 | package org.openyolo.demoprovider.barbican.provider;
19 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/drawable/wipe_associations.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
11 |
--------------------------------------------------------------------------------
/testapp/java/org/openyolo/testapp/TestPageFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.testapp;
16 |
17 | import android.support.v4.app.Fragment;
18 |
19 | abstract class TestPageFragment extends Fragment {
20 |
21 | public abstract String getPageTitle();
22 | }
23 |
--------------------------------------------------------------------------------
/bbq/java/com/google/bbq/internal/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Data types and utility classes that are used internally by BBQ. _NOTE_: The contents of
17 | * this package are _not_ part of the public API, and may change at any time.
18 | */
19 | package com.google.bbq.internal;
20 |
--------------------------------------------------------------------------------
/protocol/java/org/openyolo/protocol/internal/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Data types and utility classes that are used by the OpenYOLO libraries. _NOTE_: The contents of
17 | * this package are _not_ part of the public API, and may change at any time.
18 | */
19 | package org.openyolo.protocol.internal;
20 |
--------------------------------------------------------------------------------
/api/java/org/openyolo/api/internal/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Collection of internal data types and utility classes that are used by the OpenYOLO libraries.
17 | * _NOTE_: The contents of this package are _not_ part of the public API, and may change at any
18 | * time.
19 | */
20 | package org.openyolo.api.internal;
21 |
--------------------------------------------------------------------------------
/api/java/org/openyolo/api/persistence/internal/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Collection of classes and interfaces related to persisting state used by the OpenYOLO libraries.
17 | * _NOTE_: The contents of this package are _not_ part of the public API, and may change at any
18 | * time.
19 | */
20 | package org.openyolo.api.persistence.internal;
21 |
--------------------------------------------------------------------------------
/protocol/java/org/openyolo/protocol/internal/ValueConverter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.protocol.internal;
16 |
17 | /**
18 | * Simple abstraction that converts values of type T into values of type U.
19 | */
20 | public interface ValueConverter {
21 | /**
22 | * Converts a single value.
23 | */
24 | U convert(T value);
25 | }
26 |
--------------------------------------------------------------------------------
/protocol/java/org/openyolo/protocol/internal/InternalConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.protocol.internal;
16 |
17 | /**
18 | * Internal constants used throughout the library.
19 | */
20 | public class InternalConstants {
21 |
22 | /**
23 | * A prime number for use in deriving hash codes.
24 | */
25 | public static final int HASH_PRIME = 92821;
26 | }
27 |
--------------------------------------------------------------------------------
/demoapps/passwordlogin/java/org/openyolo/demoapp/passwordlogin/MainNavigator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.demoapp.passwordlogin;
16 |
17 | /**
18 | * Hides the details of activity transitions from {@link MainViewModel}.
19 | */
20 | public interface MainNavigator {
21 |
22 | /**
23 | * Transitions to the login activity.
24 | */
25 | void goToLogin();
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/api/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
21 |
22 |
--------------------------------------------------------------------------------
/testapp/java/org/openyolo/testapp/GlideModule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.testapp;
16 |
17 | import com.bumptech.glide.module.AppGlideModule;
18 |
19 | /**
20 | * Required definition for use of the Glide generated API.
21 | * @see "http://bumptech.github.io/glide/doc/generatedapi.html"
22 | */
23 | @com.bumptech.glide.annotation.GlideModule
24 | public class GlideModule extends AppGlideModule {}
25 |
--------------------------------------------------------------------------------
/config/coverage.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'jacoco'
2 |
3 | jacoco {
4 | toolVersion = "0.7.1.201405082137"
5 | }
6 |
7 | task jacocoTestReport(type: JacocoReport, dependsOn: "testDebugUnitTest") {
8 | group = "Reporting"
9 | description = "Generate Jacoco coverage reports after running tests."
10 | reports {
11 | xml.enabled = true
12 | html.enabled = true
13 | }
14 |
15 | def ignoredFilter = ['**/R.class',
16 | '**/R$*.class',
17 | '**/BuildConfig.*',
18 | '**/Manifest*.*',
19 | 'android/**/*.*',
20 | '**/Curve*.*',
21 | '**/proto/*']
22 |
23 | // Class R is used, but usage will not be covered, so ignore this class from report
24 | classDirectories = fileTree(
25 | dir: 'build/intermediates/classes/debug',
26 | excludes: ignoredFilter
27 | )
28 | sourceDirectories = files('java')
29 | executionData = files('build/jacoco/testDebugUnitTest.exec')
30 | }
31 |
--------------------------------------------------------------------------------
/demoproviders/barbican/java/org/openyolo/demoprovider/barbican/GlideModule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.demoprovider.barbican;
16 |
17 | import com.bumptech.glide.module.AppGlideModule;
18 |
19 | /**
20 | * Required definition for use of the Glide generated API.
21 | * @see "http://bumptech.github.io/glide/doc/generatedapi.html"
22 | */
23 | @com.bumptech.glide.annotation.GlideModule
24 | public class GlideModule extends AppGlideModule {}
25 |
--------------------------------------------------------------------------------
/testapp/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
18 |
19 |
22 |
23 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/demoapps/passwordlogin/java/org/openyolo/demoapp/passwordlogin/GlideModule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.demoapp.passwordlogin;
16 |
17 | import com.bumptech.glide.module.AppGlideModule;
18 |
19 | /**
20 | * Required definition for use of the Glide generated API.
21 | * @see "http://bumptech.github.io/glide/doc/generatedapi.html"
22 | */
23 | @com.bumptech.glide.annotation.GlideModule
24 | public final class GlideModule extends AppGlideModule {}
25 |
--------------------------------------------------------------------------------
/spi/javatests/java/org/openyolo/spi/ShadowQueryResponseSender.java:
--------------------------------------------------------------------------------
1 | package org.openyolo.spi;
2 |
3 | import static org.mockito.Mockito.mock;
4 |
5 | import android.support.annotation.NonNull;
6 | import android.support.annotation.Nullable;
7 | import com.google.bbq.Protobufs.BroadcastQuery;
8 | import com.google.bbq.QueryResponseSender;
9 | import org.robolectric.annotation.Implementation;
10 | import org.robolectric.annotation.Implements;
11 |
12 | /**
13 | * Shadow for {@link QueryResponseSender}
14 | */
15 | @Implements(QueryResponseSender.class)
16 | public class ShadowQueryResponseSender {
17 | public ShadowQueryResponseSender() {}
18 |
19 | public static QueryResponseSender mockQueryResponseSender = mock(QueryResponseSender.class);
20 |
21 | public static void intializeForTest() {
22 | mockQueryResponseSender = mock(QueryResponseSender.class);
23 | }
24 |
25 | @Implementation
26 | public void sendResponse(@NonNull BroadcastQuery query, @Nullable byte[] responseMessage) {
27 | mockQueryResponseSender.sendResponse(query, responseMessage);
28 | }
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/spi/java/org/openyolo/spi/assetlinks/data/AssetStatement.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.spi.assetlinks.data;
16 |
17 | import java.util.List;
18 |
19 | /**
20 | * Parent type for asset statements, either web or android.
21 | */
22 | public interface AssetStatement {
23 |
24 | /**
25 | * Get the list of relations for the statement.
26 | *
27 | * @return List of relations.
28 | */
29 | List getRelations();
30 | }
31 |
--------------------------------------------------------------------------------
/spi/javatests/java/org/openyolo/spi/assetlinks/data/WebTargetTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.openyolo.spi.assetlinks.data;
18 |
19 | import org.junit.Test;
20 | import org.valid4j.errors.RequireViolation;
21 |
22 | /**
23 | * Tests for {@link WebTarget}
24 | */
25 | public class WebTargetTest {
26 | @Test (expected = RequireViolation.class)
27 | public void testNullSite() {
28 | new WebTarget.Builder()
29 | .build();
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/demoapps/simplest/src/main/java/org/openyolo/demoapp/simplest/LoggedInActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.openyolo.demoapp.simplest;
15 |
16 | import android.support.v7.app.AppCompatActivity;
17 | import android.os.Bundle;
18 |
19 | public class LoggedInActivity extends AppCompatActivity {
20 |
21 | @Override
22 | protected void onCreate(Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 | setContentView(R.layout.activity_logged_in);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/config/javadoc.gradle:
--------------------------------------------------------------------------------
1 | configurations {
2 | mdDoclet
3 | }
4 |
5 | dependencies {
6 | mdDoclet 'org.jdrupes.mdoclet:doclet:1.0.3'
7 | }
8 |
9 | task androidJavadoc(type: Javadoc) {
10 | source = android.sourceSets.main.java.srcDirs
11 | title = "AppAuth for Android"
12 | classpath += files(project.android.getBootClasspath())
13 | options {
14 | doclet "org.jdrupes.mdoclet.MDoclet"
15 | docletpath(*configurations.mdDoclet.files.asType(List))
16 | links "http://docs.oracle.com/javase/7/docs/api/"
17 | linksOffline "http://d.android.com/reference","${android.sdkDirectory}/docs/reference"
18 | }
19 | exclude '**/BuildConfig.java'
20 | exclude '**/R.java'
21 | }
22 |
23 | task javadocJar(type: Jar, dependsOn:androidJavadoc) {
24 | classifier = 'javadoc'
25 | from androidJavadoc.destinationDir
26 | }
27 |
28 | afterEvaluate {
29 | // fixes issue where javadoc can't find android symbols ref: http://stackoverflow.com/a/34572606
30 | androidJavadoc.classpath += files(android.libraryVariants.collect { variant ->
31 | variant.javaCompile.classpath.files
32 | })
33 | }
34 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/drawable/phone.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
--------------------------------------------------------------------------------
/demoapps/simplest/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
22 |
23 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/bbq/java/com/google/bbq/QueryCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package com.google.bbq;
16 |
17 | import java.util.List;
18 |
19 | /**
20 | * Interface for receiving a query response.
21 | */
22 | public interface QueryCallback {
23 |
24 | /**
25 | * Invoked when the specified query completes, with the collection of responses that were
26 | * received within the allowed time.
27 | *
28 | * @see {@link BroadcastQueryClient#queryFor}
29 | */
30 | void onResponse(long queryId, List responses);
31 | }
32 |
--------------------------------------------------------------------------------
/spi/javatests/java/org/openyolo/spi/ShadowAuthenticationDomain.java:
--------------------------------------------------------------------------------
1 | package org.openyolo.spi;
2 |
3 | import android.content.Context;
4 | import android.support.annotation.NonNull;
5 |
6 | import java.util.HashMap;
7 | import java.util.Map;
8 |
9 | import org.openyolo.protocol.AuthenticationDomain;
10 | import org.robolectric.annotation.Implementation;
11 | import org.robolectric.annotation.Implements;
12 |
13 | /**
14 | * Shadow for {@link AuthenticationDomain}.
15 | */
16 | @Implements(AuthenticationDomain.class)
17 | public class ShadowAuthenticationDomain {
18 |
19 | private static Map sAuthDomainLookup = new HashMap<>();
20 |
21 | public static void reset() {
22 | sAuthDomainLookup.clear();
23 | }
24 |
25 | public static void setAuthDomainForPackage(String packageName, AuthenticationDomain authDomain) {
26 | sAuthDomainLookup.put(packageName, authDomain);
27 | }
28 |
29 | @Implementation
30 | public static AuthenticationDomain fromPackageName(
31 | @NonNull Context context,
32 | @NonNull String packageName) {
33 | return sAuthDomainLookup.get(packageName);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/bbq/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | apply from:'../config/android-common.gradle'
4 | apply from:'../config/protobuf.gradle'
5 | apply from:'../config/third-party.gradle'
6 |
7 | project.ext {
8 | moduleDesc = 'Background Broadcast Query (BBQ) Protocol'
9 | }
10 |
11 | android {
12 | defaultConfig {
13 | project.archivesBaseName = 'bbq'
14 |
15 | buildConfigField('String', 'bbqVersionMajor', '' + rootProject.ext.versionMajor)
16 | buildConfigField('String', 'bbqVersionMinor', '' + rootProject.ext.versionMinor)
17 | buildConfigField('String', 'bbqVersionPatch', '' + rootProject.ext.versionPatch)
18 | }
19 | }
20 |
21 | dependencies {
22 | implementation "com.android.support:support-annotations:${rootProject.ext.supportLibVersion}"
23 | implementation "org.hamcrest:hamcrest-core:${rootProject.ext.hamcrestVersion}"
24 | implementation "org.valid4j:valid4j:${rootProject.ext.valid4jVersion}"
25 | apply from:'../config/testdeps.gradle', to:it
26 | }
27 |
28 | apply from: '../config/style.gradle'
29 | apply from: '../config/coverage.gradle'
30 | apply from: '../config/javadoc.gradle'
31 | apply from: '../config/bintray.gradle'
--------------------------------------------------------------------------------
/demoproviders/trapdoor/java/org/openyolo/demoprovider/trapdoor/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | /**
16 | * Trapdoor is much simpler credential provider than Barbican, with no storage and a very simple
17 | * cryptographic operation to generate passwords for apps. It transforms a 6-digit pin and an
18 | * app identifier into a 16 character password. This approach is fine for a demo, but is riddled
19 | * with issues for a real world password manager - DO NOT copy this approach for any real world
20 | * usage.
21 | */
22 | package org.openyolo.demoprovider.trapdoor;
23 |
--------------------------------------------------------------------------------
/demoproviders/barbican/java/org/openyolo/demoprovider/barbican/Application.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.demoprovider.barbican;
16 |
17 | import android.support.v7.app.AppCompatDelegate;
18 |
19 | /**
20 | * Application object; ensures that the support library is correctly configured for use of
21 | * vector drawables.
22 | */
23 | public class Application extends android.app.Application {
24 |
25 | @Override
26 | public void onCreate() {
27 | super.onCreate();
28 | AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/demoproviders/trapdoor/java/org/openyolo/demoprovider/trapdoor/Application.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.demoprovider.trapdoor;
16 |
17 | import android.support.v7.app.AppCompatDelegate;
18 |
19 | /**
20 | * Application object; ensures that the support library is correctly configured for use of
21 | * vector drawables.
22 | */
23 | public class Application extends android.app.Application {
24 |
25 | @Override
26 | public void onCreate() {
27 | super.onCreate();
28 | AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/testapp/res/drawable/dice_24dp.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
20 |
--------------------------------------------------------------------------------
/api/java/org/openyolo/api/persistence/AppSettings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.api.persistence;
16 |
17 | /**
18 | * Interface for the collection persisted settings. Settings should beper application per device.
19 | */
20 | public interface AppSettings {
21 |
22 | /**
23 | * Returns {@code true} if the current application has disabled automatically signing in.
24 | */
25 | boolean isAutoSignInDisabled();
26 |
27 | /**
28 | * Setter for {@link #isAutoSignInDisabled()}.
29 | */
30 | void setIsAutoSignInDisabled(boolean isDisabled);
31 | }
32 |
--------------------------------------------------------------------------------
/demoapps/passwordlogin/java/org/openyolo/demoapp/passwordlogin/userdata/UserDatabase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.demoapp.passwordlogin.userdata;
16 |
17 | import android.arch.persistence.room.Database;
18 | import android.arch.persistence.room.RoomDatabase;
19 |
20 | /**
21 | * A Room database for user data.
22 | */
23 | @Database(entities = {User.class}, version = 1, exportSchema = false)
24 | public abstract class UserDatabase extends RoomDatabase {
25 |
26 | /**
27 | * The user data access object.
28 | */
29 | public abstract UserDao userDao();
30 | }
31 |
--------------------------------------------------------------------------------
/testapp/res/drawable/google_24dp.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
16 |
20 |
24 |
26 |
--------------------------------------------------------------------------------
/protocol/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | apply from:'../config/android-common.gradle'
4 | apply from:'../config/protobuf.gradle'
5 |
6 | project.ext {
7 | moduleDesc = 'OpenYOLO for Android Protocol'
8 | }
9 |
10 | android {
11 | defaultConfig {
12 | project.archivesBaseName = 'openyolo-protocol'
13 | consumerProguardFiles 'proguard-rules.txt'
14 |
15 | buildConfigField('String', 'clientVersionMajor', rootProject.ext.versionMajor)
16 | buildConfigField('String', 'clientVersionMinor', rootProject.ext.versionMinor)
17 | buildConfigField('String', 'clientVersionPatch', rootProject.ext.versionPatch)
18 | }
19 | }
20 |
21 | dependencies {
22 | api 'com.google.protobuf:protobuf-lite:3.0.1'
23 | implementation "com.android.support:support-annotations:${rootProject.supportLibVersion}"
24 | implementation "org.hamcrest:hamcrest-core:${rootProject.ext.hamcrestVersion}"
25 | implementation "org.valid4j:valid4j:${rootProject.ext.valid4jVersion}"
26 | apply from:'../config/testdeps.gradle', to:it
27 | }
28 |
29 | apply from: '../config/style.gradle'
30 | apply from: '../config/coverage.gradle'
31 | apply from: '../config/javadoc.gradle'
32 | apply from: '../config/bintray.gradle'
33 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/layout/app_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
20 |
21 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/protocol/java/org/openyolo/protocol/internal/StringUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.protocol.internal;
16 |
17 | import android.support.annotation.Nullable;
18 |
19 | /**
20 | * String manipulation utilities.
21 | */
22 | public final class StringUtil {
23 |
24 | /**
25 | * Returns the provided string value if it is non-null and non-empty, otherwise returns null.
26 | */
27 | @Nullable
28 | public static String nullifyEmptyString(@Nullable String str) {
29 | if (str == null || str.isEmpty()) {
30 | return null;
31 | }
32 |
33 | return str;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/demoproviders/barbican/proto/credential-meta.proto:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | syntax = "proto2";
18 |
19 | package org.openyolo.demoprovider.barbican;
20 |
21 | option java_package = "org.openyolo.demoprovider.barbican";
22 | option java_outer_classname = "Protobufs";
23 |
24 | message CredentialMeta {
25 | required int32 cost = 1;
26 | required bytes salt = 2;
27 | repeated string neverSave = 3;
28 | repeated AccountHint hints = 4;
29 | }
30 |
31 | message AccountHint {
32 | optional string identifier = 1; // required
33 | optional string authMethod = 2;
34 | optional string name = 3;
35 | optional string pictureUri = 4;
36 | }
--------------------------------------------------------------------------------
/config/style.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'checkstyle'
2 |
3 | checkstyle {
4 | configFile file("${rootDir}/config/checkstyle/checkstyle.xml")
5 | configProperties = [
6 | 'checkstyle.java.header': file("${rootDir}/config/checkstyle/java.header").getAbsolutePath(),
7 | 'checkstyle.suppressions': file("${rootDir}/config/checkstyle/suppressions.xml").getAbsolutePath(),
8 | ]
9 | toolVersion = "7.4"
10 | }
11 |
12 | task checkAllSource(type: Checkstyle) {
13 | source 'java'
14 | include '**/*.java'
15 | classpath = project.configurations.compile
16 | }
17 |
18 | task failOnCheckstyleWarning {
19 | def checkstyleWarningsFile = 'build/reports/checkstyle/checkAllSource.xml'
20 | doLast {
21 | File warningsFile = file(checkstyleWarningsFile)
22 | if (warningsFile.exists() && warningsFile.text.contains("
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
25 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/spi/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply from:'../config/android-common.gradle'
3 |
4 | project.ext {
5 | moduleDesc = 'OpenYOLO for Android Service Provider Interface (SPI)'
6 | }
7 |
8 | android {
9 | defaultConfig {
10 | project.archivesBaseName = 'openyolo-spi'
11 | consumerProguardFiles 'proguard-rules.txt'
12 |
13 | buildConfigField('String', 'spiVersionMajor', rootProject.ext.versionMajor)
14 | buildConfigField('String', 'spiVersionMinor', rootProject.ext.versionMinor)
15 | buildConfigField('String', 'spiVersionPatch', rootProject.ext.versionPatch)
16 | }
17 | }
18 |
19 | dependencies {
20 | api project(':bbq')
21 | api project(':protocol')
22 |
23 | implementation "org.hamcrest:hamcrest-core:${rootProject.ext.hamcrestVersion}"
24 | implementation "org.valid4j:valid4j:${rootProject.ext.valid4jVersion}"
25 | implementation "com.android.support:support-annotations:${rootProject.supportLibVersion}"
26 | implementation "com.android.support:appcompat-v7:${rootProject.supportLibVersion}"
27 | apply from:'../config/testdeps.gradle', to:it
28 | }
29 |
30 | apply from: '../config/style.gradle'
31 | apply from: '../config/coverage.gradle'
32 | apply from: '../config/javadoc.gradle'
33 | apply from: '../config/bintray.gradle'
34 |
--------------------------------------------------------------------------------
/demoapps/passwordlogin/res/drawable/openyolo_logo.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
19 |
26 |
--------------------------------------------------------------------------------
/spi/java/org/openyolo/spi/assetlinks/data/Deserializer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.spi.assetlinks.data;
16 |
17 | import java.util.List;
18 | import org.json.JSONObject;
19 |
20 | /**
21 | * Interface for asset statement deserializers.
22 | *
23 | * @param Type of asset statement being created
24 | */
25 | public interface Deserializer {
26 | /**
27 | * Deserialize the provided JSON into a list of {@link AssetStatement}s.
28 | *
29 | * @param json Asset statements JSON
30 | * @return A list of {@link AssetStatement}s or an empty list if no valid asset statements
31 | * are found
32 | */
33 | List deserialize(JSONObject json);
34 | }
35 |
--------------------------------------------------------------------------------
/demoapps/simplest/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'checkstyle'
3 |
4 | android {
5 | compileSdkVersion rootProject.ext.compileSdkVersion
6 | buildToolsVersion rootProject.ext.buildToolsVersion
7 |
8 | defaultConfig {
9 | applicationId 'org.openyolo.demoapp.simplest'
10 | project.archivesBaseName = 'openyolo-demoapp-simplest'
11 | minSdkVersion rootProject.ext.minSdkVersion
12 | targetSdkVersion rootProject.ext.compileSdkVersion
13 | versionCode rootProject.ext.versionNum
14 | versionName rootProject.ext.versionName
15 | }
16 |
17 | lintOptions {
18 | warningsAsErrors true
19 | disable 'GradleDependency'
20 | }
21 |
22 | buildTypes {
23 | release {
24 | minifyEnabled true
25 | proguardFiles getDefaultProguardFile('proguard-android.txt')
26 | }
27 | }
28 | }
29 |
30 | dependencies {
31 | implementation project(':api')
32 |
33 | implementation "com.android.support:support-annotations:${rootProject.supportLibVersion}"
34 | implementation "com.android.support:appcompat-v7:${rootProject.supportLibVersion}"
35 | implementation "com.android.support:design:${rootProject.supportLibVersion}"
36 |
37 | apply from: "${rootDir}/config/testdeps.gradle", to: it
38 | }
39 |
40 | apply from: "${rootDir}/config/style.gradle"
--------------------------------------------------------------------------------
/protocol/java/org/openyolo/protocol/internal/NoopValueConverter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.protocol.internal;
16 |
17 | /**
18 | * Returns the provided value as-is. Useful for performing collection type conversion where
19 | * the values do not change.
20 | */
21 | public final class NoopValueConverter implements ValueConverter {
22 |
23 | private static final NoopValueConverter INSTANCE = new NoopValueConverter();
24 |
25 | /**
26 | * The singleton instance of {@link NoopValueConverter}.
27 | */
28 | public static NoopValueConverter getInstance() {
29 | return INSTANCE;
30 | }
31 |
32 | @Override
33 | public T convert(T value) {
34 | return value;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/layout/hint_picker_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
20 |
21 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/testapp/res/layout/main_layout.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
11 |
18 |
19 |
25 |
26 |
27 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/layout/apipairing_list_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
21 |
22 |
23 |
24 |
31 |
32 |
--------------------------------------------------------------------------------
/demoapps/simplest/src/main/java/org/openyolo/demoapp/simplest/MainActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.openyolo.demoapp.simplest;
15 |
16 | import android.content.Intent;
17 | import android.support.v7.app.AppCompatActivity;
18 | import android.os.Bundle;
19 | import android.view.View;
20 |
21 | public class MainActivity extends AppCompatActivity {
22 |
23 | @Override
24 | protected void onCreate(Bundle savedInstanceState) {
25 | super.onCreate(savedInstanceState);
26 | setContentView(R.layout.activity_main);
27 | }
28 |
29 | public void onClickSignIn(View view) {
30 | startActivity(new Intent(this, LoginActivity.class));
31 | }
32 |
33 | public void onClickSignUp(View view) {
34 | startActivity(new Intent(this, CreateAccountActivity.class));
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/protocol/javatests/org/openyolo/protocol/internal/ClientVersionUtilTest.java:
--------------------------------------------------------------------------------
1 | package org.openyolo.protocol.internal;
2 |
3 | import org.junit.Test;
4 | import org.junit.runner.RunWith;
5 | import org.robolectric.RobolectricTestRunner;
6 | import org.robolectric.annotation.Config;
7 |
8 | import static org.assertj.core.api.Java6Assertions.assertThat;
9 |
10 | @RunWith(RobolectricTestRunner.class)
11 | @Config(manifest = Config.NONE)
12 | public class ClientVersionUtilTest {
13 |
14 | @Test
15 | public void testParseVersionPart() {
16 | assertThat(ClientVersionUtil.parseVersionPart("0")).isEqualTo(0);
17 | assertThat(ClientVersionUtil.parseVersionPart("2")).isEqualTo(2);
18 | assertThat(ClientVersionUtil.parseVersionPart("1024")).isEqualTo(1024);
19 | }
20 |
21 | @Test
22 | public void testParseVersionPart_nullValue() {
23 | assertThat(ClientVersionUtil.parseVersionPart(null)).isEqualTo(0);
24 | }
25 |
26 | @Test
27 | public void testParseVersionPart_emptyValue() {
28 | assertThat(ClientVersionUtil.parseVersionPart("")).isEqualTo(0);
29 | }
30 |
31 | @Test
32 | public void testParseVersionPart_negativeValue() {
33 | assertThat(ClientVersionUtil.parseVersionPart("-1")).isEqualTo(0);
34 | }
35 |
36 | @Test
37 | public void testParseVersionPart_tooBigValue() {
38 | assertThat(ClientVersionUtil.parseVersionPart("10000000000")).isEqualTo(0);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/demoproviders/trapdoor/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
23 |
24 |
28 |
29 |
--------------------------------------------------------------------------------
/config/android-common.gradle:
--------------------------------------------------------------------------------
1 | android {
2 | compileSdkVersion rootProject.ext.compileSdkVersion
3 | buildToolsVersion rootProject.ext.buildToolsVersion
4 |
5 | defaultConfig {
6 | minSdkVersion rootProject.ext.minSdkVersion
7 | targetSdkVersion rootProject.ext.compileSdkVersion
8 | versionCode rootProject.ext.versionNum
9 | versionName rootProject.ext.versionName
10 | }
11 |
12 | compileOptions {
13 | sourceCompatibility = rootProject.ext.sourceJavaVersion
14 | targetCompatibility = rootProject.ext.targetJavaVersion
15 | }
16 |
17 | sourceSets {
18 | main.manifest.srcFile 'AndroidManifest.xml'
19 | main.java.srcDirs = ['java']
20 | main.aidl.srcDirs = ['java']
21 | main.res.srcDir 'res'
22 | main.assets.srcDir 'assets'
23 | main.resources.srcDir 'java'
24 |
25 | test.setRoot('javatests');
26 | test.java.srcDir('javatests');
27 | }
28 |
29 | lintOptions {
30 | warningsAsErrors true
31 | disable 'InvalidPackage', 'TrulyRandom', 'GradleDependency', 'ObsoleteLintCustomCheck'
32 | }
33 |
34 | packagingOptions {
35 | exclude 'META-INF/LICENSE.txt'
36 | exclude 'META-INF/NOTICE.txt'
37 | }
38 | }
39 |
40 | // produces a JAR containing sources
41 | task sourcesJar(type: Jar, dependsOn:'generateReleaseSources') {
42 | from android.sourceSets.main.java.srcDirs
43 | classifier = 'sources'
44 | }
45 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/layout/credential_picker_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
20 |
21 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/api/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply from:'../config/android-common.gradle'
3 | apply from:'../config/protobuf.gradle'
4 |
5 | project.ext {
6 | moduleDesc = 'OpenYOLO for Android Client API'
7 | }
8 |
9 | android {
10 | defaultConfig {
11 | vectorDrawables.useSupportLibrary = true
12 | consumerProguardFiles 'proguard-rules.txt'
13 | project.archivesBaseName = 'openyolo-api'
14 |
15 | buildConfigField('String', 'clientVersionMajor', rootProject.ext.versionMajor)
16 | buildConfigField('String', 'clientVersionMinor', rootProject.ext.versionMinor)
17 | buildConfigField('String', 'clientVersionPatch', rootProject.ext.versionPatch)
18 | }
19 | }
20 |
21 | dependencies {
22 | api project(":bbq")
23 | api project(":protocol")
24 | implementation "com.android.support:support-annotations:${rootProject.ext.supportLibVersion}"
25 | implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
26 | implementation "org.hamcrest:hamcrest-core:${rootProject.ext.hamcrestVersion}"
27 | implementation "org.valid4j:valid4j:${rootProject.ext.valid4jVersion}"
28 | apply from:'../config/testdeps.gradle', to:it
29 |
30 | testImplementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
31 | }
32 |
33 | apply from: '../config/style.gradle'
34 | apply from: '../config/coverage.gradle'
35 | apply from: '../config/javadoc.gradle'
36 | apply from: '../config/bintray.gradle'
37 |
--------------------------------------------------------------------------------
/protocol/java/org/openyolo/protocol/OpenYoloException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.protocol;
16 |
17 | /**
18 | * Parent exception type for all recoverable openyolo failures.
19 | */
20 | public class OpenYoloException extends Exception {
21 |
22 | /**
23 | * Describes the exception with a human-readable string, for debugging.
24 | */
25 | public OpenYoloException(String message) {
26 | super(message);
27 | }
28 |
29 | /**
30 | * Specifies the root cause of the exception.
31 | */
32 | public OpenYoloException(Throwable cause) {
33 | super(cause);
34 | }
35 |
36 | /**
37 | * Specifies the root cause of the exception, and a higher-level description for debugging.
38 | */
39 | public OpenYoloException(String message, Throwable cause) {
40 | super(message, cause);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/demoapps/passwordlogin/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Pwd Demo
4 | Email
5 | Password
6 | OpenYOLO Demo - Password Login
7 | Sign out
8 | OpenYOLO logo
9 | Enter your email address:
10 | Incorrect stored password in credential provider. Please re-enter your password:
11 | Welcome back! Please enter your password:
12 | Hey, you\'re new! Please choose a password for your account
13 | Oops, that didn\'t work. Maybe try again?
14 | You are signed in as:
15 | Invalid email address
16 | Wrong password, please try again
17 | User profile picture
18 | Looking for an existing account…
19 | Asking your credential manager for account details…
20 | [ no display name ]
21 |
22 |
--------------------------------------------------------------------------------
/demoproviders/trapdoor/res/layout/dialog_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
17 |
18 |
24 |
25 |
37 |
38 |
--------------------------------------------------------------------------------
/testapp/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
13 |
14 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/demoproviders/barbican/java/org/openyolo/demoprovider/barbican/LockActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.demoprovider.barbican;
16 |
17 | import android.app.Activity;
18 | import android.os.Bundle;
19 | import org.openyolo.demoprovider.barbican.storage.CredentialStorageClient;
20 |
21 | /**
22 | * Locks the credential store in response to an action from the persistent "unlocked" notification.
23 | */
24 | public class LockActivity extends Activity implements CredentialStorageClient.ConnectedCallback {
25 |
26 | @Override
27 | protected void onCreate(Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 | CredentialStorageClient.connect(this, this);
30 | }
31 |
32 | @Override
33 | public void onStorageConnected(CredentialStorageClient client) {
34 | client.lock();
35 | finish();
36 | client.disconnect(this);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/protocol/java/org/openyolo/protocol/MalformedDataException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.protocol;
16 |
17 | /**
18 | * Indicates that an OpenYOLO message is missing or could not parsed.
19 | */
20 | public class MalformedDataException extends OpenYoloException {
21 |
22 | /**
23 | * Describes the exception with a human-readable string, for debugging.
24 | */
25 | public MalformedDataException(String message) {
26 | super(message);
27 | }
28 |
29 | /**
30 | * Specifies the root cause of the exception.
31 | */
32 | public MalformedDataException(Throwable cause) {
33 | super(cause);
34 | }
35 |
36 | /**
37 | * Specifies the root cause of the exception, and a higher-level description for debugging.
38 | */
39 | public MalformedDataException(String message, Throwable rootCause) {
40 | super(message, rootCause);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/testapp/res/layout/other_test_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
27 |
28 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/api/java/org/openyolo/api/persistence/internal/SettingsFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.api.persistence.internal;
16 |
17 | /**
18 | * Factory for creating settings.
19 | */
20 | interface SettingsFactory {
21 |
22 | /**
23 | * Returns a new {@link BooleanSetting} based on the given key and default value.
24 | * @param key a unique identifier that acts as the primary key of the setting.
25 | * @param defaultValue the default value of the setting.
26 | */
27 | BooleanSetting makeBoolean(String key, boolean defaultValue);
28 |
29 | /**
30 | * A boolean setting.
31 | */
32 | interface BooleanSetting {
33 |
34 | /**
35 | * Returns the current value if one has been set, otherwise the default value.
36 | */
37 | boolean get();
38 |
39 | /**
40 | * Sets the current value of the setting to the given value.
41 | */
42 | void set(boolean value);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/api/javatests/org/openyolo/api/internal/ActivityResultTest.java:
--------------------------------------------------------------------------------
1 | package org.openyolo.api.internal;
2 |
3 | import android.content.Intent;
4 | import android.os.Parcel;
5 |
6 | import org.junit.Test;
7 | import org.junit.runner.RunWith;
8 | import org.openyolo.protocol.CredentialDeleteResult;
9 | import org.robolectric.RobolectricTestRunner;
10 | import org.robolectric.annotation.Config;
11 |
12 | import static org.assertj.core.api.Java6Assertions.assertThat;
13 |
14 | /**
15 | * Units tests for {@link ActivityResult}.
16 | */
17 | @RunWith(RobolectricTestRunner.class)
18 | @Config(manifest = Config.NONE)
19 | public class ActivityResultTest {
20 |
21 | @Test
22 | public void parcelAndUnparcel_withValidInput_returnsEquivalent() throws Exception {
23 | Parcel parcel = Parcel.obtain();
24 |
25 | int resultCode = CredentialDeleteResult.CODE_BAD_REQUEST;
26 | Intent intent = CredentialDeleteResult.BAD_REQUEST.toResultDataIntent();
27 |
28 | // Act
29 | ActivityResult givenActivityResult = ActivityResult.of(resultCode, intent);
30 | givenActivityResult.writeToParcel(parcel, 0 /* flags */);
31 |
32 | parcel.setDataPosition(0);
33 | ActivityResult outputActivityResult = ActivityResult.CREATOR.createFromParcel(parcel);
34 |
35 | // Assert
36 | assertThat(outputActivityResult.getResultCode()).isEqualTo(resultCode);
37 |
38 | CredentialDeleteResult credentialDeleteResult =
39 | CredentialDeleteResult.fromResultIntentData(outputActivityResult.getData());
40 | assertThat(credentialDeleteResult.getResultCode()).isEqualTo(resultCode);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/spi/javatests/java/org/openyolo/spi/assetlinks/data/AndroidTargetTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.openyolo.spi.assetlinks.data;
18 |
19 | import org.junit.Test;
20 | import org.valid4j.errors.RequireViolation;
21 |
22 | /**
23 | * Tests for {@link AndroidTarget}
24 | */
25 | public class AndroidTargetTest {
26 | private final String fingerprint =
27 | "D5:03:9F:44:48:4A:70:C9:0A:AC:1D:3A:A7:67:07:EE:B8:BF:52:03:62:87:0C:98:B0:C9" +
28 | ":E2:2A:8E:14:DF:A8";
29 |
30 | @Test(expected = RequireViolation.class)
31 | public void testNullPackageName() {
32 | new AndroidTarget.Builder()
33 | .sha256CertFingerprint(fingerprint)
34 | .build();
35 | }
36 |
37 | @Test(expected = RequireViolation.class)
38 | public void testNullFingerprint() {
39 | new AndroidTarget.Builder()
40 | .packageName("org.example")
41 | .build();
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/api/res/layout/provider_picker_layout.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
14 |
15 |
21 |
22 |
32 |
33 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/demoapps/passwordlogin/java/org/openyolo/demoapp/passwordlogin/LoginNavigator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.demoapp.passwordlogin;
16 |
17 | import android.content.Intent;
18 | import android.support.annotation.AnyThread;
19 |
20 | /**
21 | * Hides the details of activity transitions from {@link LoginViewModel}.
22 | */
23 | @AnyThread
24 | public interface LoginNavigator {
25 |
26 | /**
27 | * Requests the retrieval of a credential from an OpenYOLO provider using the supplied intent.
28 | */
29 | void startOpenYoloRetrieve(Intent retrieveIntent);
30 |
31 | /**
32 | * Requests the retrieval of a hint from an OpenYOLO provider using the supplied intent.
33 | */
34 | void startOpenYoloHint(Intent hintIntent);
35 |
36 | /**
37 | * Requests the storage of a credential to an OpenYOLO provider using the supplied intent.
38 | */
39 | void startSave(Intent saveIntent);
40 |
41 | /**
42 | * Transitions to the main activity.
43 | */
44 | void goToMain();
45 | }
46 |
--------------------------------------------------------------------------------
/testapp/res/layout/save_test_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
20 |
21 |
25 |
26 |
27 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/testapp/res/layout/delete_test_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
20 |
21 |
25 |
26 |
27 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/api/res/layout-v17/provider_picker_layout.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
14 |
15 |
21 |
22 |
33 |
34 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/spi/javatests/java/org/openyolo/spi/assetlinks/data/WebSiteAssetStatementTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.openyolo.spi.assetlinks.data;
18 |
19 | import java.util.Arrays;
20 | import org.junit.Test;
21 | import org.valid4j.errors.RequireViolation;
22 |
23 | /**
24 | * Test for {@link WebSiteAssetStatement}
25 | */
26 | public class WebSiteAssetStatementTest {
27 |
28 | @Test (expected = RequireViolation.class)
29 | public void testNullTarget() {
30 | new WebSiteAssetStatement.Builder()
31 | .relations(Arrays.asList(RelationType.GetLoginCreds))
32 | .build();
33 | }
34 |
35 | @Test (expected = RequireViolation.class)
36 | public void testNullRelations() {
37 | new WebSiteAssetStatement.Builder()
38 | .webTarget(createWebTarget())
39 | .build();
40 | }
41 |
42 | private WebTarget createWebTarget() {
43 | return new WebTarget.Builder()
44 | .site("org.example")
45 | .build();
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/demoproviders/trapdoor/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'checkstyle'
3 |
4 | apply from: "${rootDir}/config/android-common.gradle"
5 |
6 | android {
7 | defaultConfig {
8 | applicationId 'org.openyolo.demoprovider.trapdoor'
9 | project.archivesBaseName = 'openyolo-demoprovider-trapdoor'
10 | vectorDrawables.useSupportLibrary = true
11 | }
12 | buildTypes {
13 | release {
14 | minifyEnabled true
15 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
16 | }
17 | }
18 | }
19 |
20 | dependencies {
21 | implementation project(':spi')
22 | implementation "com.android.support:support-annotations:${rootProject.supportLibVersion}"
23 | implementation "com.android.support:support-vector-drawable:${rootProject.supportLibVersion}"
24 | implementation "com.android.support:appcompat-v7:${rootProject.supportLibVersion}"
25 | implementation "com.android.support:design:${rootProject.supportLibVersion}"
26 | implementation 'com.madgag.spongycastle:core:1.54.0.0'
27 |
28 | // stylish pin entry field
29 | implementation 'me.philio:pinentryview:1.0.6'
30 |
31 | implementation 'com.jakewharton:butterknife:8.5.1'
32 | implementation "com.github.bumptech.glide:glide:${rootProject.ext.glideVersion}"
33 |
34 | annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
35 | annotationProcessor "com.github.bumptech.glide:compiler:${rootProject.glideVersion}"
36 |
37 | apply from: "${rootDir}/config/testdeps.gradle", to:it
38 | testImplementation "com.android.support:support-annotations:${rootProject.supportLibVersion}"
39 | }
40 |
41 | apply from: "${rootDir}/config/style.gradle"
42 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/drawable/app_icon.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
20 |
23 |
26 |
29 |
32 |
37 |
40 |
43 |
--------------------------------------------------------------------------------
/bbq/proto/bbq.proto:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | syntax = "proto3";
18 |
19 | package com.google.bbq;
20 |
21 | option java_package = "com.google.bbq";
22 | option java_outer_classname = "Protobufs";
23 |
24 | message BroadcastQuery {
25 | // The BBQ client version.
26 | ClientVersion client_version = 1;
27 |
28 | // required
29 | string data_type = 2;
30 |
31 | // required
32 | string requesting_app = 3;
33 |
34 | // required
35 | sfixed64 request_id = 4;
36 |
37 | // required
38 | sfixed64 response_id = 5;
39 |
40 | bytes query_message = 6;
41 | map additional_props = 7;
42 | }
43 |
44 | message BroadcastQueryResponse {
45 | // required
46 | sfixed64 request_id = 1;
47 |
48 | // required
49 | sfixed64 response_id = 2;
50 |
51 | bytes response_message = 3;
52 | map additional_props = 4;
53 | }
54 |
55 | message ClientVersion {
56 | // required
57 | string vendor = 1;
58 |
59 | // required
60 | uint32 major = 2;
61 |
62 | // required
63 | uint32 minor = 3;
64 |
65 | // required
66 | uint32 patch = 4;
67 | }
--------------------------------------------------------------------------------
/protocol/javatests/org/openyolo/protocol/AdditionalPropertiesHelperTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.protocol;
16 |
17 | import static org.assertj.core.api.Java6Assertions.assertThat;
18 |
19 | import org.junit.Test;
20 | import org.junit.runner.RunWith;
21 | import org.robolectric.RobolectricTestRunner;
22 | import org.robolectric.annotation.Config;
23 |
24 | /**
25 | * Unit tests for {@link AuthenticationDomain}.
26 | */
27 | @RunWith(RobolectricTestRunner.class)
28 | @Config(manifest = Config.NONE)
29 | public final class AdditionalPropertiesHelperTest {
30 |
31 | @Test
32 | public void encodeStringValue_withNull() {
33 | assertThat(AdditionalPropertiesHelper.encodeStringValue(null)).isNull();
34 | }
35 |
36 | @Test
37 | public void decodeStringValue_withNull() {
38 | assertThat(AdditionalPropertiesHelper.decodeStringValue(null)).isNull();
39 | }
40 |
41 | @Test
42 | public void encodeAndDecode() {
43 | byte[] encoded = AdditionalPropertiesHelper.encodeStringValue("testing");
44 | assertThat(AdditionalPropertiesHelper.decodeStringValue(encoded)).isEqualTo("testing");
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/protocol/java/org/openyolo/protocol/AdditionalPropertiesContainer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.protocol;
16 |
17 | import android.support.annotation.NonNull;
18 | import android.support.annotation.Nullable;
19 | import java.util.Map;
20 |
21 | /**
22 | * Implemented by all model types that can hold additional, non-standard properties.
23 | */
24 | public interface AdditionalPropertiesContainer {
25 |
26 | /**
27 | * The set of additional, non-standard properties.
28 | */
29 | @NonNull
30 | Map getAdditionalProperties();
31 |
32 | /**
33 | * Returns the additional, non-standard property identified by the specified key. If this
34 | * additional property does not exist, then `null` is returned.
35 | */
36 | @Nullable
37 | byte[] getAdditionalProperty(String key);
38 |
39 | /**
40 | * Returns the additional, non-standard property identified by the specified key, where the
41 | * value is assumed to be a UTF-8 encoded string. If this additional property does not exist,
42 | * then `null` is returned.
43 | */
44 | @Nullable
45 | String getAdditionalPropertyAsString(String key);
46 | }
47 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/layout/auto_sign_in_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
17 |
22 |
23 |
30 |
31 |
37 |
38 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/spi/javatests/java/org/openyolo/spi/assetlinks/data/IncludeStatementTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.openyolo.spi.assetlinks.data;
18 |
19 | import static junit.framework.Assert.assertEquals;
20 | import static junit.framework.Assert.assertNotNull;
21 | import static junit.framework.Assert.assertTrue;
22 |
23 | import org.junit.Test;
24 | import org.valid4j.errors.RequireViolation;
25 |
26 | /**
27 | * Tests for {@link IncludeStatement}
28 | */
29 | public class IncludeStatementTest {
30 |
31 | @Test (expected = RequireViolation.class)
32 | public void testNullSite() {
33 | new IncludeStatement.Builder()
34 | .build();
35 | }
36 |
37 | @Test
38 | public void testIncludeSite() {
39 | final String url = "http://example.digitalassetlinks.org/.well-known/assetlinks.json";
40 | final IncludeStatement statement = new IncludeStatement.Builder()
41 | .url(url)
42 | .build();
43 | assertNotNull(statement);
44 | assertEquals(url, statement.getInclude());
45 | assertNotNull(statement.getRelations());
46 | assertTrue(statement.getRelations().isEmpty());
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/layout/credential_picker_item_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
14 |
21 |
22 |
31 |
32 |
37 |
38 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/spi/javatests/java/org/openyolo/spi/assetlinks/loader/TargetAssetStatementLoaderTest.java:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.openyolo.spi.assetlinks.loader;
20 |
21 | import android.content.Context;
22 | import java.util.Collections;
23 | import java.util.List;
24 | import org.junit.Test;
25 | import org.junit.runner.RunWith;
26 | import org.mockito.Mock;
27 | import org.openyolo.spi.assetlinks.data.AssetStatement;
28 | import org.robolectric.RobolectricTestRunner;
29 | import org.robolectric.annotation.Config;
30 | import org.valid4j.errors.RequireViolation;
31 |
32 | /**
33 | * Tests for {@link TargetAssetStatementLoader}.
34 | */
35 | @RunWith(RobolectricTestRunner.class)
36 | @Config(manifest = Config.NONE)
37 | public class TargetAssetStatementLoaderTest {
38 |
39 | @Mock
40 | Context mockContext;
41 |
42 | private final List assetStatements = Collections.emptyList();
43 |
44 | @Test (expected = RequireViolation.class)
45 | public void testNullContext() {
46 | new TargetAssetStatementLoader(null, assetStatements);
47 | }
48 |
49 | @Test (expected = RequireViolation.class)
50 | public void testNullAssetStatements() {
51 | new TargetAssetStatementLoader(mockContext, null);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/layout/credential_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
15 |
23 |
24 |
33 |
34 |
39 |
40 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/spi/javatests/java/org/openyolo/spi/assetlinks/data/WebAssetStatementDeserializerTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.openyolo.spi.assetlinks.data;
18 |
19 | import static junit.framework.Assert.assertNotNull;
20 | import static junit.framework.Assert.assertTrue;
21 |
22 | import java.util.List;
23 | import org.json.JSONObject;
24 | import org.junit.Test;
25 | import org.junit.runner.RunWith;
26 | import org.robolectric.RobolectricTestRunner;
27 | import org.robolectric.annotation.Config;
28 | import org.valid4j.errors.RequireViolation;
29 |
30 | /**
31 | * Tests for {@link WebAssetStatementDeserializer}.
32 | */
33 | @RunWith(RobolectricTestRunner.class)
34 | @Config(manifest = Config.NONE)
35 | public class WebAssetStatementDeserializerTest {
36 |
37 | @Test(expected = RequireViolation.class)
38 | public void testNullJson() {
39 | new WebAssetStatementDeserializer().deserialize(null);
40 | }
41 |
42 | @Test
43 | public void testNoTarget() {
44 | JSONObject json = new JSONObject();
45 | final List assetStatements = new WebAssetStatementDeserializer()
46 | .deserialize(json);
47 | assertNotNull(assetStatements);
48 | assertTrue(assetStatements.isEmpty());
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/spi/javatests/java/org/openyolo/spi/assetlinks/data/IncludeAssetStatementDeserializerTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.openyolo.spi.assetlinks.data;
18 |
19 | import static junit.framework.Assert.assertNotNull;
20 | import static junit.framework.Assert.assertTrue;
21 |
22 | import java.util.List;
23 | import org.json.JSONObject;
24 | import org.junit.Test;
25 | import org.junit.runner.RunWith;
26 | import org.robolectric.RobolectricTestRunner;
27 | import org.robolectric.annotation.Config;
28 | import org.valid4j.errors.RequireViolation;
29 |
30 | /**
31 | * Tests for {@link IncludeAssetStatementDeserializer}.
32 | */
33 | @RunWith(RobolectricTestRunner.class)
34 | @Config(manifest = Config.NONE)
35 | public class IncludeAssetStatementDeserializerTest {
36 |
37 | @Test(expected = RequireViolation.class)
38 | public void testNullJson() {
39 | new IncludeAssetStatementDeserializer().deserialize(null);
40 | }
41 |
42 | @Test
43 | public void testNoTarget() {
44 | JSONObject json = new JSONObject();
45 | final List assetStatements = new IncludeAssetStatementDeserializer()
46 | .deserialize(json);
47 | assertNotNull(assetStatements);
48 | assertTrue(assetStatements.isEmpty());
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/layout/credential_list_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
21 |
22 |
23 |
24 |
31 |
32 |
43 |
44 |
--------------------------------------------------------------------------------
/spi/javatests/java/org/openyolo/spi/assetlinks/data/AndroidAssetStatementDeserializerTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.openyolo.spi.assetlinks.data;
18 |
19 | import static junit.framework.Assert.assertNotNull;
20 | import static junit.framework.Assert.assertTrue;
21 |
22 | import java.util.List;
23 | import org.json.JSONObject;
24 | import org.junit.Test;
25 | import org.junit.runner.RunWith;
26 | import org.robolectric.RobolectricTestRunner;
27 | import org.robolectric.annotation.Config;
28 | import org.valid4j.errors.RequireViolation;
29 |
30 | /**
31 | * Tests for {@link AndroidAssetStatementDeserializer}.
32 | */
33 | @RunWith(RobolectricTestRunner.class)
34 | @Config(manifest = Config.NONE)
35 | public class AndroidAssetStatementDeserializerTest {
36 |
37 | @Test(expected = RequireViolation.class)
38 | public void testNullJson() {
39 | new AndroidAssetStatementDeserializer().deserialize(null);
40 | }
41 |
42 | @Test
43 | public void testNoTarget() {
44 | JSONObject json = new JSONObject();
45 | final List assetStatements = new AndroidAssetStatementDeserializer()
46 | .deserialize(json);
47 | assertNotNull(assetStatements);
48 | assertTrue(assetStatements.isEmpty());
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/demoproviders/barbican/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'checkstyle'
3 |
4 | apply from: "${rootDir}/config/android-common.gradle"
5 | apply from: "${rootDir}/config/protobuf.gradle"
6 |
7 | android {
8 | defaultConfig {
9 | applicationId 'org.openyolo.demoprovider.barbican'
10 | project.archivesBaseName = 'openyolo-demoprovider-barbican'
11 | vectorDrawables.useSupportLibrary = true
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled true
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | implementation project(':spi')
23 | implementation "com.android.support:support-annotations:${rootProject.ext.supportLibVersion}"
24 | implementation "com.android.support:support-vector-drawable:${rootProject.ext.supportLibVersion}"
25 | implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
26 | implementation "com.android.support:design:${rootProject.ext.supportLibVersion}"
27 | implementation "com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}"
28 | implementation 'com.madgag.spongycastle:core:1.54.0.0'
29 | implementation "com.google.guava:guava:${rootProject.ext.guavaVersion}"
30 |
31 | implementation 'com.jakewharton:butterknife:8.5.1'
32 | implementation "com.github.bumptech.glide:glide:${rootProject.ext.glideVersion}"
33 |
34 | annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
35 | annotationProcessor "com.github.bumptech.glide:compiler:${rootProject.glideVersion}"
36 |
37 | apply from: "${rootDir}/config/testdeps.gradle", to:it
38 | testImplementation "com.android.support:support-annotations:${rootProject.supportLibVersion}"
39 | testImplementation 'com.google.guava:guava:22.0-rc1-android'
40 | }
41 |
42 | apply from: "${rootDir}/config/style.gradle"
43 |
--------------------------------------------------------------------------------
/demoproviders/trapdoor/java/org/openyolo/demoprovider/trapdoor/UserDataStore.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.demoprovider.trapdoor;
16 |
17 | import android.content.Context;
18 | import android.content.SharedPreferences;
19 |
20 | /**
21 | * Utility class to access and manipulate user data that is pertinent to password generation.
22 | */
23 | public class UserDataStore {
24 |
25 | private static final String SHARED_PREF_NAME = "userData";
26 |
27 | private static final String KEY_USER_NAME = "userName";
28 |
29 | private static final String DEFAULT_USER_NAME = "jdoe";
30 |
31 | /**
32 | * Changes the stored user name to the provided value.
33 | */
34 | public static void setUserName(Context context, String userName) {
35 | SharedPreferences prefs =
36 | context.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
37 | prefs.edit().putString(KEY_USER_NAME, userName).apply();
38 | }
39 |
40 | /**
41 | * Retrieves the stored user name for credentials.
42 | */
43 | public static String getUserName(Context context) {
44 | SharedPreferences prefs =
45 | context.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
46 | return prefs.getString(KEY_USER_NAME, DEFAULT_USER_NAME);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/api/java/org/openyolo/api/internal/FinishWithResultActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.api.internal;
16 |
17 | import android.app.Activity;
18 | import android.content.Context;
19 | import android.content.Intent;
20 | import android.os.Bundle;
21 | import android.support.annotation.Nullable;
22 |
23 | /**
24 | * An invisible Activity which immediately finishes with the given {@link ActivityResult}.
25 | */
26 | public final class FinishWithResultActivity extends Activity {
27 |
28 | private static final String KEY_RESULT = "ActivityResult";
29 |
30 | /**
31 | * Returns an Intent for {@link FinishWithResultActivity} for the given {@link ActivityResult}.
32 | */
33 | public static Intent createIntent(Context context, ActivityResult result) {
34 | return new Intent()
35 | .setClass(context, FinishWithResultActivity.class)
36 | .putExtra(KEY_RESULT, result);
37 | }
38 |
39 |
40 | @Override
41 | protected void onCreate(@Nullable Bundle savedInstanceState) {
42 | super.onCreate(savedInstanceState);
43 |
44 | ActivityResult result = getIntent().getParcelableExtra(KEY_RESULT);
45 | if (null != result) {
46 | setResult(result.getResultCode(), result.getData());
47 | }
48 |
49 | finish();
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/spi/javatests/java/org/openyolo/spi/assetlinks/data/AndroidAssetStatementTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.openyolo.spi.assetlinks.data;
18 |
19 | import java.util.Arrays;
20 | import org.junit.Test;
21 | import org.valid4j.errors.RequireViolation;
22 |
23 | /**
24 | * Tests for {@link AndroidAssetStatement).
25 | */
26 | public class AndroidAssetStatementTest {
27 | private final String fingerprint =
28 | "D5:03:9F:44:48:4A:70:C9:0A:AC:1D:3A:A7:67:07:EE:B8:BF:52:03:62:87:0C:98:B0:C9" +
29 | ":E2:2A:8E:14:DF:A8";
30 |
31 | @Test (expected = RequireViolation.class)
32 | public void testNullRelations() {
33 | new AndroidAssetStatement.Builder()
34 | .target(createAndroidTarget())
35 | .build();
36 | }
37 |
38 | @Test (expected = RequireViolation.class)
39 | public void testNullTarget() {
40 | new AndroidAssetStatement.Builder()
41 | .relations(Arrays.asList(RelationType.GetLoginCreds))
42 | .build();
43 | }
44 |
45 | private AndroidTarget createAndroidTarget() {
46 | return new AndroidTarget.Builder()
47 | .packageName("org.example")
48 | .sha256CertFingerprint(fingerprint)
49 | .build();
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/spi/java/org/openyolo/spi/assetlinks/data/NamespaceType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.spi.assetlinks.data;
16 |
17 | import android.support.annotation.Nullable;
18 |
19 | /**
20 | * Used to represent the different types of namespaces in a Digital Asset Links.
21 | */
22 | public enum NamespaceType {
23 |
24 | /**
25 | * Web asset namespace.
26 | */
27 | Web("web"),
28 |
29 | /**
30 | * Android asset namespace.
31 | */
32 | AndroidApp("android_app");
33 |
34 | private final String mDescription;
35 |
36 | NamespaceType(String desc) {
37 | this.mDescription = desc;
38 | }
39 |
40 | public String getDescription() {
41 | return mDescription;
42 | }
43 |
44 | /**
45 | * Get the {@link NamespaceType} with the matching description or
46 | * null.
47 | *
48 | * @param desc The {@link NamespaceType} mDescription.
49 | * @return The {@link NamespaceType} with the matching
50 | * {@link #getDescription()} } or null if a match isn't found.
51 | */
52 | @Nullable
53 | public static NamespaceType getNamespaceType(String desc) {
54 | for (NamespaceType nsType : values()) {
55 | if (nsType.mDescription.equals(desc)) {
56 | return nsType;
57 | }
58 | }
59 | return null;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/demoapps/passwordlogin/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
17 |
18 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
35 |
36 |
37 |
38 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/demoapps/passwordlogin/java/org/openyolo/demoapp/passwordlogin/userdata/UserDao.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.demoapp.passwordlogin.userdata;
16 |
17 | import android.arch.persistence.room.Dao;
18 | import android.arch.persistence.room.Delete;
19 | import android.arch.persistence.room.Insert;
20 | import android.arch.persistence.room.OnConflictStrategy;
21 | import android.arch.persistence.room.Query;
22 | import android.arch.persistence.room.Update;
23 | import android.support.annotation.NonNull;
24 | import android.support.annotation.Nullable;
25 |
26 | /**
27 | * A Room data access object for basic data manipulation operations on users.
28 | */
29 | @Dao
30 | public interface UserDao {
31 |
32 | /**
33 | * Creates a new user in the database.
34 | */
35 | @Insert(onConflict = OnConflictStrategy.FAIL)
36 | void createUser(@NonNull User user);
37 |
38 | /**
39 | * Updates an existing user entry in the database.
40 | */
41 | @Update
42 | void updateUser(@NonNull User user);
43 |
44 | /**
45 | * Deletes a user from the database.
46 | */
47 | @Delete
48 | void deleteUser(@NonNull User user);
49 |
50 | /**
51 | * Finds a user by their email address.
52 | */
53 | @Nullable
54 | @Query("SELECT * FROM users WHERE email = :email")
55 | User getUserByEmail(@NonNull String email);
56 | }
57 |
--------------------------------------------------------------------------------
/protocol/java/org/openyolo/protocol/AdditionalPropertiesBuilder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.protocol;
16 |
17 | import android.support.annotation.NonNull;
18 | import android.support.annotation.Nullable;
19 | import java.util.Map;
20 |
21 | /**
22 | * The contract that builders must adhere to if they build model types that include
23 | * additional properties.
24 | */
25 | public interface AdditionalPropertiesBuilder<
26 | ModelT extends AdditionalPropertiesContainer,
27 | BuilderT extends AdditionalPropertiesBuilder> {
28 |
29 | /**
30 | * Specifies any additional, non-standard properties associated with the credential.
31 | */
32 | @NonNull
33 | BuilderT setAdditionalProperties(@Nullable Map additionalProps);
34 |
35 | /**
36 | * Specifies an additional, non-standard property to include in the credential.
37 | */
38 | @NonNull
39 | BuilderT setAdditionalProperty(@NonNull String key, @Nullable byte[] value);
40 |
41 | /**
42 | * Specifies an additional, non-standard property with a string value to include in the
43 | * credential.
44 | */
45 | @NonNull
46 | BuilderT setAdditionalPropertyAsString(@NonNull String key, @Nullable String value);
47 |
48 | /**
49 | * Creates an instance of the model type.
50 | */
51 | @NonNull
52 | ModelT build();
53 | }
54 |
--------------------------------------------------------------------------------
/api/java/org/openyolo/api/persistence/internal/AppSettingsImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.api.persistence.internal;
16 |
17 | import android.content.Context;
18 |
19 | import org.openyolo.api.persistence.AppSettings;
20 |
21 | /**
22 | * The default implementation of {@link AppSettings}.
23 | */
24 | public final class AppSettingsImpl implements AppSettings {
25 |
26 | private static final String SETTING_NAME_SPACE = "AppSettings";
27 | private static final String KEY_IS_AUTO_SIGN_IN_DISABLED = "is_auto_sign_in_disabled";
28 |
29 | private final SettingsFactory.BooleanSetting mIsAutoSignInDisabled;
30 |
31 | /**
32 | * Returns a new instance of {@link AppSettingsImpl}.
33 | */
34 | public static AppSettings getInstance(Context context) {
35 | return new AppSettingsImpl(SettingsFactoryImpl.getInstance(context, SETTING_NAME_SPACE));
36 | }
37 |
38 | private AppSettingsImpl(SettingsFactory settingsFactory) {
39 | mIsAutoSignInDisabled =
40 | settingsFactory.makeBoolean(KEY_IS_AUTO_SIGN_IN_DISABLED, false /* defaultValue */);
41 | }
42 |
43 | @Override
44 | public boolean isAutoSignInDisabled() {
45 | return mIsAutoSignInDisabled.get();
46 | }
47 |
48 | @Override
49 | public void setIsAutoSignInDisabled(boolean isDisabled) {
50 | mIsAutoSignInDisabled.set(isDisabled);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/protocol/java/org/openyolo/protocol/internal/ByteStringConverters.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.protocol.internal;
16 |
17 | import com.google.protobuf.ByteString;
18 |
19 | /**
20 | * Instances of {@link ValueConverter} related to {@link com.google.protobuf.ByteString}
21 | * instances.
22 | */
23 | public final class ByteStringConverters {
24 |
25 | /**
26 | * Extracts byte arrays from {@link ByteString} instances.
27 | */
28 | public static final ValueConverter BYTE_STRING_TO_BYTE_ARRAY
29 | = new ByteStringToByteArrayConverter();
30 |
31 | /**
32 | * Copies byte arrays into {@link ByteString} instances.
33 | */
34 | public static final ValueConverter BYTE_ARRAY_TO_BYTE_STRING
35 | = new ByteArrayToByteStringConverter();
36 |
37 | private static final class ByteStringToByteArrayConverter
38 | implements ValueConverter {
39 | @Override
40 | public byte[] convert(ByteString value) {
41 | return value.toByteArray();
42 | }
43 | }
44 |
45 | private static final class ByteArrayToByteStringConverter
46 | implements ValueConverter {
47 | @Override
48 | public ByteString convert(byte[] value) {
49 | return ByteString.copyFrom(value);
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/protocol/java/org/openyolo/protocol/internal/UriConverters.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.protocol.internal;
16 |
17 | import static org.hamcrest.CoreMatchers.notNullValue;
18 | import static org.valid4j.Assertive.require;
19 |
20 | import android.net.Uri;
21 |
22 | /**
23 | * Utility methods for parsing and validating URIs used in OpenYOLO.
24 | */
25 | public final class UriConverters {
26 |
27 | /**
28 | * Converts strings to Uri instances.
29 | */
30 | public static final ValueConverter CONVERTER_STRING_TO_URI =
31 | new ValueConverter() {
32 | @Override
33 | public Uri convert(String value) {
34 | require(value, notNullValue());
35 | return Uri.parse(value);
36 | }
37 | };
38 |
39 | /**
40 | * Converts Uri instacnes to strings.
41 | */
42 | public static final ValueConverter CONVERTER_URI_TO_STRING =
43 | new ValueConverter() {
44 | @Override
45 | public String convert(Uri value) {
46 | require(value, notNullValue());
47 | return value.toString();
48 | }
49 | };
50 |
51 | private UriConverters() {
52 | throw new IllegalStateException("not intended to be constructed");
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/demoapps/passwordlogin/java/org/openyolo/demoapp/passwordlogin/userdata/UserDataSource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the
10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11 | * express or implied. See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.openyolo.demoapp.passwordlogin.userdata;
16 |
17 | import android.support.annotation.NonNull;
18 | import android.support.annotation.Nullable;
19 |
20 | /**
21 | * A service which can authenticate users, and remember who the current user is.
22 | */
23 | public interface UserDataSource {
24 |
25 | /**
26 | * The currently authenticated user, if any.
27 | */
28 | @Nullable
29 | User getCurrentUser();
30 |
31 | /**
32 | * Whether an account exists for the specified email address.
33 | */
34 | boolean isExistingAccount(@NonNull String email);
35 |
36 | /**
37 | * Attempts to create and persist a new user account account with the specified properties;
38 | * returns true if a new account is created.
39 | */
40 | boolean createPasswordAccount(
41 | @NonNull String email,
42 | @NonNull String name,
43 | @NonNull String profilePictureUri,
44 | @NonNull String password);
45 |
46 | /**
47 | * Attempts to authenticate an existing user with the provided credentials; returns true if
48 | * authentication succeeds.
49 | */
50 | boolean authWithPassword(@NonNull String email, @NonNull String password);
51 |
52 | /**
53 | * De-authenticates the current user.
54 | */
55 | void signOut();
56 | }
57 |
--------------------------------------------------------------------------------
/testapp/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'checkstyle'
3 |
4 | apply from:'../config/android-common.gradle'
5 |
6 | android {
7 | defaultConfig {
8 | applicationId "org.openyolo.testapp"
9 | project.archivesBaseName = "openyolo-testapp"
10 | vectorDrawables.useSupportLibrary = true
11 | }
12 |
13 | signingConfigs {
14 | debugAndRelease {
15 | storeFile file("${projectDir}/testapp.keystore")
16 | storePassword "testapp"
17 | keyAlias "testapp"
18 | keyPassword "testapp"
19 | }
20 | }
21 |
22 | buildTypes {
23 | debug {
24 | signingConfig signingConfigs.debugAndRelease
25 | }
26 | release {
27 | minifyEnabled true
28 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
29 | signingConfig signingConfigs.debugAndRelease
30 | }
31 | }
32 | }
33 |
34 | dependencies {
35 | implementation project(':api')
36 | implementation project(':protocol')
37 | implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
38 | implementation "com.android.support:support-vector-drawable:${rootProject.ext.supportLibVersion}"
39 | implementation "com.android.support:design:${rootProject.ext.supportLibVersion}"
40 | implementation "com.android.support:support-vector-drawable:${rootProject.ext.supportLibVersion}"
41 | implementation "com.github.bumptech.glide:glide:${rootProject.ext.glideVersion}"
42 | implementation "com.google.guava:guava:${rootProject.ext.guavaVersion}"
43 | implementation 'com.jakewharton:butterknife:8.5.1'
44 | implementation "org.hamcrest:hamcrest-core:${rootProject.ext.hamcrestVersion}"
45 | implementation "org.valid4j:valid4j:${rootProject.ext.valid4jVersion}"
46 |
47 | annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
48 | annotationProcessor "com.github.bumptech.glide:compiler:${rootProject.glideVersion}"
49 | }
50 |
51 | apply from:'../config/style.gradle'
52 |
--------------------------------------------------------------------------------
/spi/javatests/java/org/openyolo/spi/assetlinks/data/NamespaceTypeTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | *
16 | */
17 |
18 | package org.openyolo.spi.assetlinks.data;
19 |
20 | import static junit.framework.Assert.assertNotNull;
21 | import static junit.framework.Assert.assertNull;
22 | import static junit.framework.Assert.assertTrue;
23 |
24 | import org.junit.Test;
25 |
26 | /**
27 | * Tests for {@link NamespaceType}.
28 | */
29 | public class NamespaceTypeTest {
30 | @Test
31 | public void androidAppTest() {
32 | final NamespaceType namespaceType = NamespaceType.getNamespaceType
33 | ("android_app");
34 | assertNotNull(namespaceType);
35 | assertTrue(namespaceType == NamespaceType.AndroidApp);
36 | }
37 |
38 | @Test
39 | public void webTest() {
40 | final NamespaceType namespaceType = NamespaceType.getNamespaceType
41 | ("web");
42 | assertNotNull(namespaceType);
43 | assertTrue(namespaceType == NamespaceType.Web);
44 | }
45 |
46 | @Test
47 | public void invalidRelationType() {
48 | final NamespaceType namespaceType = NamespaceType.getNamespaceType
49 | ("foo");
50 | assertNull(namespaceType);
51 | }
52 |
53 | @Test
54 | public void nullInput() {
55 | final NamespaceType namespaceType = NamespaceType.getNamespaceType
56 | (null);
57 | assertNull(namespaceType);
58 | }
59 | }
--------------------------------------------------------------------------------
/demoapps/passwordlogin/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'checkstyle'
3 |
4 | apply from: "${rootDir}/config/android-common.gradle"
5 |
6 | android {
7 | defaultConfig {
8 | applicationId 'org.openyolo.demoapp.passwordonly'
9 | project.archivesBaseName = 'openyolo-demoapp-passwordonly'
10 | vectorDrawables.useSupportLibrary = true
11 | }
12 |
13 | dataBinding {
14 | enabled = true
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled true
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
21 | }
22 | }
23 | compileOptions {
24 | targetCompatibility JavaVersion.VERSION_1_8
25 | sourceCompatibility JavaVersion.VERSION_1_8
26 | }
27 | }
28 |
29 | dependencies {
30 | implementation project(':api')
31 | implementation "android.arch.lifecycle:runtime:${rootProject.archRuntimeVersion}"
32 | implementation "android.arch.lifecycle:extensions:${rootProject.archVersion}"
33 | implementation "android.arch.persistence.room:runtime:${rootProject.archVersion}"
34 | implementation "com.android.support:support-annotations:${rootProject.supportLibVersion}"
35 | implementation "com.android.support:support-vector-drawable:${rootProject.supportLibVersion}"
36 | implementation "com.android.support:appcompat-v7:${rootProject.supportLibVersion}"
37 | implementation "com.android.support:design:${rootProject.supportLibVersion}"
38 |
39 | implementation "com.github.bumptech.glide:glide:${rootProject.glideVersion}"
40 |
41 | annotationProcessor "android.arch.lifecycle:compiler:${rootProject.archVersion}"
42 | annotationProcessor "android.arch.persistence.room:compiler:${rootProject.archVersion}"
43 | annotationProcessor "com.github.bumptech.glide:compiler:${rootProject.glideVersion}"
44 |
45 | apply from: "${rootDir}/config/testdeps.gradle", to:it
46 | testImplementation "com.android.support:support-annotations:${rootProject.supportLibVersion}"
47 | }
48 |
49 | apply from: "${rootDir}/config/style.gradle"
50 |
--------------------------------------------------------------------------------
/demoproviders/barbican/res/layout/delete_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
21 |
22 |
28 |
29 |
35 |
36 |
42 |
43 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/spi/javatests/java/org/openyolo/spi/assetlinks/data/RelationTypeTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | *
16 | */
17 |
18 | package org.openyolo.spi.assetlinks.data;
19 |
20 | import static junit.framework.Assert.assertNotNull;
21 | import static junit.framework.Assert.assertNull;
22 | import static junit.framework.Assert.assertTrue;
23 |
24 | import org.junit.Test;
25 |
26 | public class RelationTypeTest {
27 | @Test
28 | public void loginCredsTest() {
29 | final RelationType relationType = RelationType.getRelationType
30 | ("delegate_permission/common.get_login_creds");
31 | assertNotNull(relationType);
32 | assertTrue(relationType == RelationType.GetLoginCreds);
33 | }
34 |
35 | @Test
36 | public void handleUrlsTest() {
37 | final RelationType relationType = RelationType.getRelationType
38 | ("delegate_permission/common.handle_all_urls");
39 | assertNotNull(relationType);
40 | assertTrue(relationType == RelationType.HandleAllUrls);
41 | }
42 |
43 | @Test
44 | public void invalidRelationType() {
45 | final RelationType relationType = RelationType.getRelationType
46 | ("something invalid");
47 | assertNull(relationType);
48 | }
49 |
50 | @Test
51 | public void nullInput() {
52 | final RelationType relationType = RelationType.getRelationType
53 | (null);
54 | assertNull(relationType);
55 | }
56 | }
--------------------------------------------------------------------------------
/demoapps/simplest/src/main/res/layout/activity_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
20 |
21 |
27 |
28 |
29 |
34 |
35 |
41 |
42 |
43 |
49 |
50 |
51 |
--------------------------------------------------------------------------------