Skip to content

Commit 28b574c

Browse files
committed
Update tests
1 parent 67f866a commit 28b574c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+275
-143
lines changed

app/package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"author": "Lakhan Samani",
1313
"license": "ISC",
1414
"dependencies": {
15-
"@authorizerdev/authorizer-react": "^1.2.0",
15+
"@authorizerdev/authorizer-react": "^1.3.1",
1616
"@types/react": "^17.0.15",
1717
"@types/react-dom": "^17.0.9",
1818
"esbuild": "^0.12.17",

app/src/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export default function App() {
3333
...window['__authorizer__'],
3434
...urlProps,
3535
};
36-
console.log({ globalState });
3736
return (
3837
<div
3938
style={{

app/yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
# yarn lockfile v1
33

44

5-
"@authorizerdev/authorizer-js@^2.0.0-beta.3":
6-
version "2.0.0-beta.3"
7-
resolved "https://registry.npmjs.org/@authorizerdev/authorizer-js/-/authorizer-js-2.0.0-beta.3.tgz"
8-
integrity sha512-cEzEVe7AewvOwOwoettiKRCq1e5Y33k9g8fJjqAoe3B/36iNN8wnZ5qgsPPZkqhv+Cvn6huj+YWtRimfVJ6d0w==
5+
"@authorizerdev/authorizer-js@^2.0.2":
6+
version "2.0.2"
7+
resolved "https://registry.npmjs.org/@authorizerdev/authorizer-js/-/authorizer-js-2.0.2.tgz"
8+
integrity sha512-YgCtpaBDGYGMUlINFsvGNJnBtbnFG2wo66xX2i6auop52oVmKimvLpzOx8306/YddCxWhg9FljyVMp88Mbnxyw==
99
dependencies:
1010
cross-fetch "^3.1.5"
1111

12-
"@authorizerdev/authorizer-react@^1.2.0":
13-
version "1.2.0"
14-
resolved "https://registry.npmjs.org/@authorizerdev/authorizer-react/-/authorizer-react-1.2.0.tgz"
15-
integrity sha512-MtunZgh30rzY9jSADVP1DRC4sOBC82zx/yhK8O/1ufOAi7vTDZwPjDHIMrG/xWPNUYTCeFPEKpZlKyB+TH/M1w==
12+
"@authorizerdev/authorizer-react@^1.3.1":
13+
version "1.3.1"
14+
resolved "https://registry.npmjs.org/@authorizerdev/authorizer-react/-/authorizer-react-1.3.1.tgz"
15+
integrity sha512-X7vQMr5jtZ28z+YZOt5ISB3lOYXNszpLpWw4S6VNs7TLAd5/ZP2kPaSdDbUgIvQFyYy51DHQeGygOu3G1n0Mdw==
1616
dependencies:
17-
"@authorizerdev/authorizer-js" "^2.0.0-beta.3"
17+
"@authorizerdev/authorizer-js" "^2.0.2"
1818
validator "^13.11.0"
1919

2020
"@babel/code-frame@^7.22.13":

dashboard/src/components/EnvComponents/Features.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const Features = ({ variables, setVariables }: any) => {
5353
</Flex>
5454
<Flex>
5555
<Flex w="100%" justifyContent="start" alignItems="center">
56-
<Text fontSize="sm">Basic Authentication:</Text>
56+
<Text fontSize="sm">Email Basic Authentication:</Text>
5757
</Flex>
5858
<Flex justifyContent="start">
5959
<InputField
@@ -64,6 +64,19 @@ const Features = ({ variables, setVariables }: any) => {
6464
/>
6565
</Flex>
6666
</Flex>
67+
<Flex>
68+
<Flex w="100%" justifyContent="start" alignItems="center">
69+
<Text fontSize="sm">Mobile Basic Authentication:</Text>
70+
</Flex>
71+
<Flex justifyContent="start">
72+
<InputField
73+
variables={variables}
74+
setVariables={setVariables}
75+
inputType={SwitchInputType.DISABLE_MOBILE_BASIC_AUTHENTICATION}
76+
hasReversedValue
77+
/>
78+
</Flex>
79+
</Flex>
6780
<Flex>
6881
<Flex w="100%" justifyContent="start" alignItems="center">
6982
<Text fontSize="sm">Sign Up:</Text>

dashboard/src/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export const SwitchInputType = {
8383
DISABLE_MAGIC_LINK_LOGIN: 'DISABLE_MAGIC_LINK_LOGIN',
8484
DISABLE_EMAIL_VERIFICATION: 'DISABLE_EMAIL_VERIFICATION',
8585
DISABLE_BASIC_AUTHENTICATION: 'DISABLE_BASIC_AUTHENTICATION',
86+
DISABLE_MOBILE_BASIC_AUTHENTICATION: 'DISABLE_MOBILE_BASIC_AUTHENTICATION',
8687
DISABLE_SIGN_UP: 'DISABLE_SIGN_UP',
8788
DISABLE_REDIS_FOR_ENV: 'DISABLE_REDIS_FOR_ENV',
8889
DISABLE_STRONG_PASSWORD: 'DISABLE_STRONG_PASSWORD',
@@ -167,6 +168,7 @@ export interface envVarTypes {
167168
DISABLE_MAGIC_LINK_LOGIN: boolean;
168169
DISABLE_EMAIL_VERIFICATION: boolean;
169170
DISABLE_BASIC_AUTHENTICATION: boolean;
171+
DISABLE_MOBILE_BASIC_AUTHENTICATION: boolean;
170172
DISABLE_SIGN_UP: boolean;
171173
DISABLE_STRONG_PASSWORD: boolean;
172174
OLD_ADMIN_SECRET: string;

dashboard/src/graphql/queries/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export const EnvVariablesQuery = `
6565
DISABLE_MAGIC_LINK_LOGIN
6666
DISABLE_EMAIL_VERIFICATION
6767
DISABLE_BASIC_AUTHENTICATION
68+
DISABLE_MOBILE_BASIC_AUTHENTICATION
6869
DISABLE_SIGN_UP
6970
DISABLE_STRONG_PASSWORD
7071
DISABLE_REDIS_FOR_ENV

dashboard/src/pages/Environment.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ const Environment = () => {
8686
DISABLE_MAGIC_LINK_LOGIN: false,
8787
DISABLE_EMAIL_VERIFICATION: false,
8888
DISABLE_BASIC_AUTHENTICATION: false,
89+
DISABLE_MOBILE_BASIC_AUTHENTICATION: false,
8990
DISABLE_SIGN_UP: false,
9091
DISABLE_STRONG_PASSWORD: false,
9192
OLD_ADMIN_SECRET: '',

server/db/providers/arangodb/authenticator.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (p *provider) AddAuthenticator(ctx context.Context, authenticators *models.
2828
authenticatorsCollection, _ := p.db.Collection(ctx, models.Collections.Authenticators)
2929
meta, err := authenticatorsCollection.CreateDocument(arangoDriver.WithOverwrite(ctx), authenticators)
3030
if err != nil {
31-
return authenticators, err
31+
return nil, err
3232
}
3333
authenticators.Key = meta.Key
3434
authenticators.ID = meta.ID.String()
@@ -42,7 +42,7 @@ func (p *provider) UpdateAuthenticator(ctx context.Context, authenticators *mode
4242
collection, _ := p.db.Collection(ctx, models.Collections.Authenticators)
4343
meta, err := collection.UpdateDocument(ctx, authenticators.Key, authenticators)
4444
if err != nil {
45-
return authenticators, err
45+
return nil, err
4646
}
4747

4848
authenticators.Key = meta.Key
@@ -59,7 +59,7 @@ func (p *provider) GetAuthenticatorDetailsByUserId(ctx context.Context, userId s
5959
}
6060
cursor, err := p.db.Query(ctx, query, bindVars)
6161
if err != nil {
62-
return authenticators, err
62+
return nil, err
6363
}
6464
defer cursor.Close()
6565
for {
@@ -71,7 +71,7 @@ func (p *provider) GetAuthenticatorDetailsByUserId(ctx context.Context, userId s
7171
}
7272
_, err := cursor.ReadDocument(ctx, &authenticators)
7373
if err != nil {
74-
return authenticators, err
74+
return nil, err
7575
}
7676
}
7777
return authenticators, nil

server/db/providers/arangodb/env.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func (p *provider) AddEnv(ctx context.Context, env *models.Env) (*models.Env, er
2323
configCollection, _ := p.db.Collection(ctx, models.Collections.Env)
2424
meta, err := configCollection.CreateDocument(arangoDriver.WithOverwrite(ctx), env)
2525
if err != nil {
26-
return env, err
26+
return nil, err
2727
}
2828
env.Key = meta.Key
2929
env.ID = meta.ID.String()
@@ -36,7 +36,7 @@ func (p *provider) UpdateEnv(ctx context.Context, env *models.Env) (*models.Env,
3636
collection, _ := p.db.Collection(ctx, models.Collections.Env)
3737
meta, err := collection.UpdateDocument(ctx, env.Key, env)
3838
if err != nil {
39-
return env, err
39+
return nil, err
4040
}
4141

4242
env.Key = meta.Key
@@ -50,7 +50,7 @@ func (p *provider) GetEnv(ctx context.Context) (*models.Env, error) {
5050
query := fmt.Sprintf("FOR d in %s RETURN d", models.Collections.Env)
5151
cursor, err := p.db.Query(ctx, query, nil)
5252
if err != nil {
53-
return env, err
53+
return nil, err
5454
}
5555
defer cursor.Close()
5656
for {
@@ -62,7 +62,7 @@ func (p *provider) GetEnv(ctx context.Context) (*models.Env, error) {
6262
}
6363
_, err := cursor.ReadDocument(ctx, &env)
6464
if err != nil {
65-
return env, err
65+
return nil, err
6666
}
6767
}
6868

0 commit comments

Comments
 (0)