Merge "Tokenized REST API POST handler"
This commit is contained in:
@@ -45,6 +45,7 @@ public class AuthConfig {
|
||||
private final String cookiePath;
|
||||
private final boolean cookieSecure;
|
||||
private final SignedToken emailReg;
|
||||
private final SignedToken restToken;
|
||||
|
||||
private final boolean allowGoogleAccountUpgrade;
|
||||
|
||||
@@ -75,6 +76,15 @@ public class AuthConfig {
|
||||
emailReg = null;
|
||||
}
|
||||
|
||||
key = cfg.getString("auth", null, "restTokenPrivateKey");
|
||||
if (key != null && !key.isEmpty()) {
|
||||
int age = (int) ConfigUtil.getTimeUnit(cfg,
|
||||
"auth", null, "maxRestTokenAge", 60, TimeUnit.SECONDS);
|
||||
restToken = new SignedToken(age, key);
|
||||
} else {
|
||||
restToken = null;
|
||||
}
|
||||
|
||||
if (authType == AuthType.OPENID) {
|
||||
allowGoogleAccountUpgrade =
|
||||
cfg.getBoolean("auth", "allowgoogleaccountupgrade", false);
|
||||
@@ -129,6 +139,10 @@ public class AuthConfig {
|
||||
return emailReg;
|
||||
}
|
||||
|
||||
public SignedToken getRestToken() {
|
||||
return restToken;
|
||||
}
|
||||
|
||||
public boolean isAllowGoogleAccountUpgrade() {
|
||||
return allowGoogleAccountUpgrade;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
/** A version of the database schema. */
|
||||
public abstract class SchemaVersion {
|
||||
/** The current schema version. */
|
||||
public static final Class<Schema_71> C = Schema_71.class;
|
||||
public static final Class<Schema_72> C = Schema_72.class;
|
||||
|
||||
public static class Module extends AbstractModule {
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// Copyright (C) 2012 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package com.google.gerrit.server.schema;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
|
||||
public class Schema_72 extends SchemaVersion {
|
||||
@Inject
|
||||
Schema_72(Provider<Schema_71> prior) {
|
||||
super(prior);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user