Move credential.h to presence dir

PiperOrigin-RevId: 461779197
This commit is contained in:
hais
2022-07-18 20:03:20 -07:00
committed by Copybara-Service
parent d41cd674c8
commit 9dec6143d1
7 changed files with 24 additions and 12 deletions
-1
View File
@@ -30,7 +30,6 @@ cc_library(
"bluetooth_utils.h",
"byte_array.h",
"callable.h",
"credential.h",
"exception.h",
"feature_flags.h",
"input_stream.h",
+1
View File
@@ -77,6 +77,7 @@ cc_library(
"//internal/platform:base",
"//internal/platform:cancellation_flag",
"//internal/platform:uuid",
"//third_party/nearby/presence:credential",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/strings",
@@ -20,13 +20,17 @@
#include <string>
#include <vector>
#include "internal/platform/credential.h"
#include "internal/platform/exception.h"
#include "third_party/nearby/presence/credential.h"
namespace location {
namespace nearby {
namespace api {
using ::nearby::presence::PrivateCredential;
using ::nearby::presence::PublicCredential;
using ::nearby::presence::TrustType;
enum class CredentialOperationStatus {
kFailed = 0,
kSucceeded = 1,
+8
View File
@@ -137,6 +137,14 @@ cc_library(
],
)
cc_library(
name = "credential",
hdrs = ["credential.h"],
visibility = [
"//third_party/nearby:__subpackages__",
],
)
cc_test(
name = "advertisement_factory_test",
size = "small",
@@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef THIRD_PARTY_NEARBY_INTERNAL_PLATFORM_CREDENTIAL_H_
#define THIRD_PARTY_NEARBY_INTERNAL_PLATFORM_CREDENTIAL_H_
#ifndef THIRD_PARTY_NEARBY_PRESENCE_CREDENTIAL_H_
#define THIRD_PARTY_NEARBY_PRESENCE_CREDENTIAL_H_
#include <set>
#include <string>
#include <vector>
namespace location {
namespace nearby {
namespace presence {
enum class TrustType {
kUnspecified = 0,
@@ -125,7 +125,7 @@ struct PublicCredential {
std::vector<uint8_t> metadata_encryption_key_tag;
};
} // namespace presence
} // namespace nearby
} // namespace location
#endif // THIRD_PARTY_NEARBY_INTERNAL_PLATFORM_CREDENTIAL_H_
#endif // THIRD_PARTY_NEARBY_PRESENCE_CREDENTIAL_H_
+1
View File
@@ -30,6 +30,7 @@ cc_library(
deps = [
"//internal/platform:base",
"//internal/platform:comm",
"//third_party/nearby/presence:credential",
"//third_party/nearby/presence/implementation/mediums",
],
)
+4 -5
View File
@@ -19,14 +19,14 @@
#include <string>
#include <vector>
#include "internal/platform/credential.h"
#include "internal/platform/credential_storage.h"
#include "third_party/nearby/presence/credential.h"
namespace nearby {
namespace presence {
struct GenerateCredentialsCallback {
std::function<void(std::vector<location::nearby::PublicCredential>)>
std::function<void(std::vector<PublicCredential>)>
credentials_generated_cb;
};
@@ -52,14 +52,13 @@ class CredentialManager {
// The users own public credentials wont be saved on local credential
// storage.
void GenerateCredentials(
location::nearby::DeviceMetadata device_metadata,
std::vector<location::nearby::TrustType> trust_types,
DeviceMetadata device_metadata, std::vector<TrustType> trust_types,
GenerateCredentialsCallback credentials_generated_cb);
// Update remote public credentials.
void UpdateRemotePublicCredentials(
std::string account_name,
std::vector<location::nearby::PublicCredential> remote_public_creds,
std::vector<PublicCredential> remote_public_creds,
UpdateRemotePublicCredentialsCallback credentials_updated_cb);
// Used to fetch private creds when broadcasting.