Merge commit from fork
This commit is contained in:
@@ -78,16 +78,6 @@ const parseJSON = (json, req) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const PUBLIC_CHANNELS = [
|
|
||||||
'public',
|
|
||||||
'public:media',
|
|
||||||
'public:local',
|
|
||||||
'public:local:media',
|
|
||||||
'public:remote',
|
|
||||||
'public:remote:media',
|
|
||||||
'hashtag',
|
|
||||||
'hashtag:local',
|
|
||||||
];
|
|
||||||
|
|
||||||
// Used for priming the counters/gauges for the various metrics that are
|
// Used for priming the counters/gauges for the various metrics that are
|
||||||
// per-channel
|
// per-channel
|
||||||
@@ -97,7 +87,14 @@ const CHANNEL_NAMES = [
|
|||||||
'user:notification',
|
'user:notification',
|
||||||
'list',
|
'list',
|
||||||
'direct',
|
'direct',
|
||||||
...PUBLIC_CHANNELS
|
'public',
|
||||||
|
'public:media',
|
||||||
|
'public:local',
|
||||||
|
'public:local:media',
|
||||||
|
'public:remote',
|
||||||
|
'public:remote:media',
|
||||||
|
'hashtag',
|
||||||
|
'hashtag:local'
|
||||||
];
|
];
|
||||||
|
|
||||||
const startServer = async () => {
|
const startServer = async () => {
|
||||||
@@ -434,12 +431,6 @@ const startServer = async () => {
|
|||||||
const checkScopes = (req, logger, channelName) => new Promise((resolve, reject) => {
|
const checkScopes = (req, logger, channelName) => new Promise((resolve, reject) => {
|
||||||
logger.debug(`Checking OAuth scopes for ${channelName}`);
|
logger.debug(`Checking OAuth scopes for ${channelName}`);
|
||||||
|
|
||||||
// When accessing public channels, no scopes are needed
|
|
||||||
if (channelName && PUBLIC_CHANNELS.includes(channelName)) {
|
|
||||||
resolve();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The `read` scope has the highest priority, if the token has it
|
// The `read` scope has the highest priority, if the token has it
|
||||||
// then it can access all streams
|
// then it can access all streams
|
||||||
const requiredScopes = ['read'];
|
const requiredScopes = ['read'];
|
||||||
|
|||||||
Reference in New Issue
Block a user