}
boost::algorithm::to_lower(tag_);
+
+ // ANY has a defined meaning for server selector and must not be used as
+ // a server tag.
+ if (tag_ == "any") {
+ isc_throw(BadValue, "'any' is reserved and must not be used as a server-tag");
+ }
}
bool
/// configuration is stored in the database. The label "all" is reserved
/// and it means "all servers". A configuration object in the database
/// associated with this server tag belongs to all servers. The server
-/// tag must not be empty and must not be longer than 256 characters
-/// (excluding leading and terminating whitespaces, which are trimmed).
+/// tag must not be empty, must not be longer than 256 characters
+/// (excluding leading and terminating whitespaces, which are trimmed)
+/// and must not be set to "any" which has a special meaning for the
+/// server selector.
class ServerTag {
public:
SCOPED_TRACE("too long tag, max is 256");
EXPECT_THROW(ServerTag(std::string(257, 'c')), BadValue);
}
+
+ {
+ SCOPED_TRACE("use reserved keyword any as a tag");
+ EXPECT_THROW(ServerTag("any"), BadValue);
+ }
}
}