deployment-secrets.json migration causes amplify[hostedUIProviderCreds] must have values error on amplify push

After upgrading cli to 4.34.0, the cli forces to move secrets from team-provider-info.json to deployment-secrets.json on amplify push
After selecting Yes, it seem like the migration is successful and push works just fine. However, the deployment-secrets.json is never created and on the future pushes, I get the following error:
amplify[hostedUIProviderCreds] must have values

It is due to deletion of the hostedUIProviderCreds from the team-provider-info.

@pedramp20 I am trying to reproduce this issue, what changes did you make before the second push?

With the last version on env update
(venv) PS C:\Users\sinap\repo\lookea\influencers-dashboard> amplify status
? Amplify has been upgraded to handle secrets more securely by migrating some values in team-provider-info.json to deployment-secrets.json
You can create a back up of the team-provider-info.json file before proceeding. Yes
Error updating Cognito resource
File at path: 'C:\Users\sinap\repo\lookea\influencers-dashboard\amplify\backend\amplify-meta.json' does not exist
Error: File at path: 'C:\Users\sinap\repo\lookea\influencers-dashboard\amplify\backend\amplify-meta.json' does not exist
at Function.JSONUtilities.readJson (C:\Users\sinap\scoop\persist\nodejs\bin\node_modules@aws-amplify\cli\node_modules\amplify-cli-core\src\jsonUtilities.ts:25:15)
at StateManager.getData (C:\Users\sinap\scoop\persist\nodejs\bin\node_modules@aws-amplify\cli\node_modules\amplify-cli-core\src\state-manager\stateManager.ts:207:32)
at StateManager.getMeta (C:\Users\sinap\scoop\persist\nodejs\bin\node_modules@aws-amplify\cli\node_modules\amplify-cli-core\src\state-manager\stateManager.ts:24:23)
at AmplifyToolkit.updateamplifyMetaAfterResourceAdd [as _updateamplifyMetaAfterResourceAdd] (C:\Users\sinap\scoop\persist\nodejs\bin\node_modules@aws-amplify\cli\src\extensions\amplify-helpers\update-amplify-meta.ts:78:36)
at Object.externalAuthEnable (C:\Users\sinap\scoop\persist\nodejs\bin\node_modules@aws-amplify\cli\node_modules\amplify-category-auth\src\index.js:137:21)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at Object.exports.migrateTeamProviderInfo (C:\Users\sinap\scoop\persist\nodejs\bin\node_modules@aws-amplify\cli\src\utils\team-provider-migrate.ts:26:7)
at Object.run (C:\Users\sinap\scoop\persist\nodejs\bin\node_modules@aws-amplify\cli\src\index.ts:82:11)
I have noticed alsa that in cognito it is removing information from hostedUIProviderCreds
index e17e1e5..5a40678 100644
--- a/amplify/team-provider-info.json
+++ b/amplify/team-provider-info.json
@@ -13,10 +13,9 @@
},
"categories": {
"auth": {

   "cognito937499ef": {

     "hostedUIProviderCreds": "[{\"ProviderName\":\"Facebook\",\"client_id\":\"XXXXXX\",\"client_secret\":\"XXXXXX\"},{\"ProviderName\":\"Google\",\"client_id\":\"XXXX-XXX.apps.googleusercontent.com\",\"client_secret\":\"XXXX\"}]"

   },

   "userPoolGroups": {}

   "cognito937499ef": {},

   "userPoolGroups": {},

   "cognito7904e5ed": {}
 },

Hello guys,
Encountering the same error in my project.
Parameters: [hostedUIProviderCreds] must have values. Encountered the problem after the CLI update. Is this related to the update?

Same here. I downgraded Amplify CLI to 4.29.0 and keeps happening, so I'm not sure it's related to the latest update.

Same here. I downgraded Amplify CLI to 4.29.0 and keeps happening, so I'm not sure it's related to the latest update.
Do you still encounter the error after downgrade?

Yes, I do.
My amplify.yml script is:
  - backend:
      phases:
        build:
          commands:
            - chmod +x amplifypush.sh
            - ./amplifypush.sh -e dev

the amplifypush.sh file:
#!/usr/bin/env bash
set -e
IFS='|'
help_output () {
    echo "usage: amplify-push <--environment|-e <name>> <--simple|-s>"
    echo "  --environment  The name of the Amplify environment to use"
    echo "  --simple  Optional simple flag auto-includes stack info from env cache"
    exit 1
}

init_env () {
    ENV=$1
    AMPLIFY=$2
    PROVIDERS=$3
    CODEGEN=$4
    AWSCONFIG=$5
    CATEGORIES=$6
    echo "# Start initializing Amplify environment: ${ENV}"
    if [[ -z ${STACKINFO} ]];
    then
        echo "# Initializing new Amplify environment: ${ENV} (amplify init)"
        amplify init --amplify ${AMPLIFY} --providers ${PROVIDERS} --codegen ${CODEGEN} --categories ${CATEGORIES} --yes;
        echo "# Environment ${ENV} details:"
        amplify env get --name ${ENV}
    else
        echo "STACKINFO="${STACKINFO}
        echo "# Importing Amplify environment: ${ENV} (amplify env import)"
        amplify env import --name ${ENV} --config "${STACKINFO}" --awsInfo ${AWSCONFIG} --categories ${CATEGORIES} --yes;
        echo "# Initializing existing Amplify environment: ${ENV} (amplify init)"
        amplify init --amplify ${AMPLIFY} --providers ${PROVIDERS} --codegen ${CODEGEN} --yes;
        echo "# Environment ${ENV} details:"
        amplify env get --name ${ENV}
    fi
    echo "# Done initializing Amplify environment: ${ENV}"
}

ENV=""
IS_SIMPLE=false
POSITIONAL=()
while [[ $# -gt 0 ]]
do
    key="$1"
    case ${key} in
        -e|--environment)
            ENV=$2
            shift
            ;;
        -r|--region)
            REGION=$2
            shift
            ;;
        -s|--simple)
            IS_SIMPLE=true
            shift
            ;;
        *)
            POSITIONAL+=("$1")
            shift
            ;;
    esac
done

set -- "${POSITIONAL[@]}"

# if no provided environment name, use default env variable, then user override
if [[ ${ENV} = "" ]];
then
    ENV=${AWS_BRANCH}
fi
if [[ ${USER_BRANCH} != "" ]];
then
    ENV=${USER_BRANCH}
fi

# Check valid environment name
if [[ -z ${ENV} || "${ENV}" =~ [^a-zA-Z0-9\-]+ ]] ; then help_output ; fi

AWSCONFIG="{\
\"configLevel\":\"project\",\
\"useProfile\":true,\
\"profileName\":\"default\"\
}"

AMPLIFY="{\
\"envName\":\"${ENV}\"\
}"

PROVIDERS="{\
\"awscloudformation\":${AWSCONFIG}\
}"

CODEGEN="{\
\"generateCode\":false,\
\"generateDocs\":false\
}"

AUTHCONFIG="{\
\"googleAppIdUserPool\":\"${GOOGLE_CLIENT_ID}\",\
\"googleAppSecretUserPool\":\"${GOOGLE_CLIENT_SECRET}\"\
}"

CATEGORIES="{\
\"auth\":$AUTHCONFIG\
}"

# Handle old or new config file based on simple flag
if [[ ${IS_SIMPLE} ]];
then
    echo "# Getting Amplify CLI Cloud-Formation stack info from environment cache"
    export STACKINFO="$(envCache --get stackInfo)"
    init_env ${ENV} ${AMPLIFY} ${PROVIDERS} ${CODEGEN} ${AWSCONFIG} ${CATEGORIES}
    echo "# Store Amplify CLI Cloud-Formation stack info in environment cache"
    STACKINFO="$(amplify env get --json --name ${ENV})"
    envCache --set stackInfo ${STACKINFO}
    echo "STACKINFO="${STACKINFO}
else
    # old config file, above steps performed outside of this script
    init_env ${ENV} ${AMPLIFY} ${PROVIDERS} ${CODEGEN} ${AWSCONFIG} ${CATEGORIES}
fi

I got this code from https://github.com/aws-amplify/amplify-console/issues/206

Hi guys,
Tried using southeast with root account. encountering the same error after doing an update.

I think https://github.com/aws-amplify/amplify-cli/pull/5733 introduced this change, and was approved by at least one contributor to the project.
It looks like the migration code has been tested here: https://github.com/aws-amplify/amplify-cli/blob/d18f795560f0e671f63f1dcbe38931c951794619/packages/amplify-cli/src/tests/team-provider-migrate.test.ts#L143-L144
If I understand the test correctly it appears to assert that some code was called but does nothing to verify the behaviour (i.e. that a file is created on disk, that the contents of the file are correct, that a subsequent invocation of amplify push succeeds).
The description in the PR mentions a ~/,aws/amplify/deployment-secrets.json, which I'm guessing is a typo and should be ~/.aws/amplify/deployment-secrets.json? Mine contains this:
{
  "appSecrets": []
}

I've found the following type that specifies the expected format of the new JSON file:
https://github.com/aws-amplify/amplify-cli/blob/ad7b028330bcee64d5124be7f27a8494dc8e9400/packages/amplify-cli-core/src/index.ts#L59-L65
Given the severity of this issue (any affected customer will be unable to push changes to any Amplify backend) I'd like to humbly request a post-mortem on how this problem found its way to customers, and how the Amplify team plan to avoid causing this sort of disruption in future.
I hope some of the info above is helpful. If there's anything else I can do to help triage and resolve please holla. :mega:

@wcomicho The file should be under~/.aws/amplify/deployment-secrets.json

I am also having this issue. I upgraded to 4.35.0 and am receiving this error when trying to amplify push:
[hostedUIProviderCreds] must have values
The deployment-secrets.json file gets created but only has this in it:
{
  "appSecrets": []
}

Ok, so I was able to get this to work. It seems like version 4.34.0 removed the hostedUIProviderCreds: [] in the team-provider-info.json but didn't successfully add it to deployment-secrets.json.
I updated the categories section in team-provider-info.json with:
"auth": {
   "[api_name]": {
     "hostedUIProviderCreds": "[]"
   },
   "userPoolGroups": {}
 },

The next time I ran amplify push it asked me to migrate to deployment-secrets.json and if I wanted to backup team-provider-info.json. I said yes and it successfully updated deployment-secrets.json:
{
  "appSecrets": [
    {
      "rootStackId": "[stack_id]",
      "environments": {
        "dev": {
          "auth": {
            "[api_name]": {
              "hostedUIProviderCreds": "[]"
            }
          }
        }
      }
    }
  ]
}

The hostedUIProviderCreds gets managed in deployment secrets and then gets discarded after a successful push. I am curious whether there is a failure on the CLI end where this file isn't being written.
@askurat did the file have the hostedUIProviderCreds before the push?

@ammarkarachi I do not remember if the CLI threw an error at me or not. After I upgraded to version 4.34.0 I do remember it asking me if I wanted to backup team-provider-info.json. I recall typing yes but don't remember if it errored on me or not. I was able to push after that upgrade.
When I updated to version 4.35.0 this morning and tried to do a push, it gave me the [hostedUIProviderCreds] must have values error. I then checked my team-provider-info.json on another branch, pre-upgrade, and noticed under the categories -> auth section, I had:
"[api_name]": {
   "hostedUIProviderCreds": "[]"
 },

So I added that back into my team-provider-info.json file, re-ran amplify push, and the CLI then asked me to migrate to deployment-secrets.json again. After it migrated I checked the deployment-secrets.json file and the hostedUIProviderCreds were added. Upon a successful push, hostedUIProviderCreds were removed but every push since has worked.
I hope all that made sense.
I'm guessing forcing the migration again must correct something in the CLI?

This is a really rough one, I though it was just me so I tweeted about it then forgot about it https://twitter.com/CodingCatDev/status/1330596528889745410
There has to be a better way of making this and the team-provider-info.json details work more easily.
Especially in regards to the auth redirects. Those need to be moved from amplify-meta.json to team-provider-info.json. We are opening a door here (all be it not a huge one) as you are allowing other domains access in your production environments if you add them to this list.

Tried putting an entry in the deployment-secrets.json:
{
"rootStackId": "[my stack id here]",
"environments": {
"dev": {
"auth": {
"my auth input": {
"hostedUIProviderCreds": "[my google config]"
}
}
}
}
}
but now I am getting error message in cloudformation: The following resource(s) failed to create: [testDynamoDB]. The following resource(s) failed to update: [authtest2020].

@askurat's fix worked for me too. I restored my team-provider-info.json from a btrfs snapshot, ran amplify push, and was prompted to migrate. Answering yes to the prompt resulted in my ~/.aws/amplify/deployment-secrets.json being updated to contain my hostedUIProviderCreds.

I'm having the same problem as others here with Amplify CLI v4.35.0.
When I try to run amplify push, it asked me to back up to deployment-secrets.json (selecting "no" by the way, cancels the push process, so you must backup in order to continue... this (a) really needs a rephrased question for clarity, and (b) needs documentation as I searched everywhere for deployment-secrets in my project (thought it would be a file to .gitignore or something), only to find out in this thread that it's in my local AWS config...).
So I selected "yes", and it removed the hostedUIProviderCreds object in the team-provider-info.json.  It then threw an error
UPDATE_FAILED      auth<AUTH_NAME> AWS::CloudFormation::Stack Tue Nov 24 2020 21:14:46 GMT-0500 (Eastern Standard Time) Parameters: [hostedUIProviderCreds] do not exist in the template
And since I didn't know what was going on, I tried a bunch of different things to no avail, including running amplify update auth to re-add the FB / Google IDs in.  This actually added the following into my team-provider-info.json:
"categories": { 			"auth": { 				"<AUTH_NAME_": { 					"facebookAppId": "<FB_ID>", 					"googleClientId": "<GOOGLE_ID>" 				} 			},
After checking this thread, I have the hostedUIProviderCreds in deployment-secrets.json, but I'm still encountering the same [hostedUIProviderCreds] do not exist in the template error.
If I remove the facebookAppId and googleClientId entires, I get a new error:
UPDATE_FAILED               authtraintheoryweb843b1bda          AWS::CloudFormation::Stack Wed Nov 25 2020 11:28:45 GMT-0500 (Eastern Standard Time) Parameters: [facebookAppId, googleClientId] do not exist in the template
I tried @askurat 's fix as well, but it still gives me the same [hostedUIProviderCreds] do not exist in the template error.
So I'm a bit stuck.  I'll try a few more things and then I'll likely have to revert back to an old CLI version for the time-being.

@ngnathan US-EAST-1 Region is having a ton of issues at the moment. This may be causing some of your problems: AWS Status

I thought i was going crazy and kept checking the status. I really dig the new personal health dashboard.

@ngnathan US-EAST-1 Region is having a ton of issues at the moment. This may be causing some of your problems: AWS Status

Yeah I just saw this as well... I just tried (in a separate env) removing FB/Google (so that I can try adding it again).  And I think the us-east-1 issues are causing my CLI to be stuck on updating the IdentityPool during my amplify push lol.
Anyway, I'm not sure how recent this outage is, but I was dealing with the same problems all of yesterday too.

@ngnathan Can you check if the file ~/.aws/amplify/deployment-secrets.json has the hostedproviderUICreds

@ngnathan Can you check if the file ~/.aws/amplify/deployment-secrets.json has the hostedproviderUICreds

Yes, it did back when I tried it yesterday, which is why it was weird when it said [hostedUIProviderCreds] do not exist in the template, because it was definitely in the deployment-secrets.json.  There were a few other environments that I had previously removed too, so I just cleaned it up, but I haven't been able to try again due to the us-east-1 issues.  So I'll wait to try again.

I finally got it working on a test environment.  Had to remove social auth completely, run amplify push and then add it back in through amplify update auth, and run amplify push again.  The only weird thing is that

My deployment-secrets.json is just an empty "appSecrets" array
The team-provider-info.json has changed to just using the FB Client ID and Google Client ID now (which I guess works since the secrets are just pulled through environment variables configured in Amplify console.)
My Cognito domain name for that environment was actually erased when that happened, so I had to manually add it back in through console (even though it's configured properly in my amplify-meta.json file.

I'll see if this happens again later, when I push these changes to another environment.

@wcomicho The file should be under~/.aws/amplify/deployment-secrets.json

Got it. Thanks

to solve this, I performed the following steps:

confirm empty array for appSecrets in  ~/.aws/amplify/deployment-secrets.json
re-added "hostedUIProviderCreds": "[]" to team-provider-info.json
amplify push answer y when prompted for backup creation
verify item is added to array in ~/.aws/amplify/deployment-secrets.json

Same story, after upgrading the CLI, more "secure" option just doesn't work at all. Had to roll back to 4.24.1

Same story, after upgrading the CLI, more "secure" option just doesn't work at all. Had to roll back to 4.24.1

@fkirill, same here... keep on putting back the config in team-provider-info before I use the command amplify push

Getting the same issue trying to perform a very simple schema update.

Rolling back version is not helpful

Same issue here. On top of that my Cognito schema (which contains custom fields) gets overwritten.

Ok, so I was able to get this to work. It seems like version 4.34.0 removed the hostedUIProviderCreds: [] in the team-provider-info.json but didn't successfully add it to deployment-secrets.json.
I updated the categories section in team-provider-info.json with:
"auth": {
   "[api_name]": {
     "hostedUIProviderCreds": "[]"
   },
   "userPoolGroups": {}
 },

The next time I ran amplify push it asked me to migrate to deployment-secrets.json and if I wanted to backup team-provider-info.json. I said yes and it successfully updated deployment-secrets.json:
{
  "appSecrets": [
    {
      "rootStackId": "[stack_id]",
      "environments": {
        "dev": {
          "auth": {
            "[api_name]": {
              "hostedUIProviderCreds": "[]"
            }
          }
        }
      }
    }
  ]
}

And this overrides some information on Auth Cloud Formation template, like UsernameConfiguration or AccountRecoverySetting 👎 so any time that I need to push, I have to do this step plus modify the template and push again.

This still doesn't work for me the hosted ui provider cred doesn't seem to be the only problem, after replying to migration
PS C:\Users\sinap\repo\lookea\influencers-dashboard> amplify push
? Amplify has been upgraded to handle secrets more securely by migrating some values in team-provider-info.json to deployment-secrets.json
You can create a back up of the team-provider-info.json file before proceeding. Yes
Error updating Cognito resource
File at path: 'C:\Users\sinap\repo\lookea\influencers-dashboard\amplify\backend\amplify-meta.json' does not exist
Error: File at path: 'C:\Users\sinap\repo\lookea\influencers-dashboard\amplify\backend\amplify-meta.json' does not exist

reverted back to 4.32.1 after much debugging

I have the same issue.

@evertson90 we release a new beta can you test it with the new version and let me know

I installed version 4.40.0-beta.0 and tried the following:

amplify status:
? Amplify has been upgraded to handle secrets more securely by migrating some values in team-provider-info.json to deployment-secrets.json You can create a back up of the team-provider-info.json file before proceeding. Yes Successfully updated auth resource locally.

Then I did amplify update auth, "Update OAuth social providers", selected Facebook and Google and added the ID and secrets. What happens is it removes the "hostedUIProviderCreds" from categories.auth.cognito in my team-provider-info.json.
Reverting to 4.32.1 fixes the problem for now. The beta does not fix the problem yet unfortunately.

@evertson90 Those values are being written to ~/.aws/amplify/deployment-secrets.json and the values are being served from there

ok here is what fixed this for me... but the jury is still out because it's been a long few hours of debugging this issue

Re-add hostedUIProviderCreds to the team-provider.json file (hopefully you backed this up before)
Open the cloudformation file under the auth resource and add a default under hostedUIProviderCreds... e.g.

  hostedUIProviderCreds:
    Type: String
    Default: "hostedUIProviderCreds"

Delete the #current-cloud-backend folder found under the amplify folder
run `amplify env checkout '
run amplify push -y (this should ask you to add your federated credentials again)...if not, then this probably wont work for you and you can abort now... if you are feeling lucky keep going
Answer 'y` to the secrets migration
Cross your fingers

The deployment-secrets.json file should be created
I hope this fixes it for others.

@dwamianm Can you confirm the if the Auth CFN is being updated after the migration?

@ammarkarachi it adds the following to the Outputs section of the CFN file

  AppClientSecret:
    Value: !GetAtt UserPoolClientInputs.appSecret

...however, as previously pointed out, it removes any customizations made to the CFN templates... but that may be for another bug report

@dwamianm The credentials should be temporarily stored in the file deployment-secrests.json and the next push should server up an empty hostedUIProviderCres marked as '[]'

@ammarkarachi ... that is not the case for me. The deployment-secrets.json file looks like this even after several pushes

{
  "appSecrets": [
    {
      "rootStackId": "",
      "environments": {
        "dev": {
          "auth": {
            "authResourceName": {
              "hostedUIProviderCreds": "[{\stuff in here"}]"
            }
          }
        }
      }
    }
  ]
}

Can you share your latest generated CFN file you can redact the info you think is sensitive

@ammarkarachi absolutley.. here you go

AWSTemplateFormatVersion: 2010-09-09

Parameters:
  env:
    Type: String
  authRoleArn:
    Type: String
  unauthRoleArn:
    Type: String

  functionjournelyv2AuthCustomMessageArn:
    Type: String
    Default: functionjournelyv2AuthCustomMessageArn

  functionjournelyv2AuthCustomMessageName:
    Type: String
    Default: functionjournelyv2AuthCustomMessageName

  functionjournelyv2AuthPreSignupArn:
    Type: String
    Default: functionjournelyv2AuthPreSignupArn

  functionjournelyv2AuthPreSignupName:
    Type: String
    Default: functionjournelyv2AuthPreSignupName

  identityPoolName:
    Type: String

  allowUnauthenticatedIdentities:
    Type: String

  resourceNameTruncated:
    Type: String

  userPoolName:
    Type: String

  autoVerifiedAttributes:
    Type: CommaDelimitedList

  mfaConfiguration:
    Type: String

  mfaTypes:
    Type: CommaDelimitedList

  smsAuthenticationMessage:
    Type: String

  smsVerificationMessage:
    Type: String

  emailVerificationSubject:
    Type: String

  emailVerificationMessage:
    Type: String

  defaultPasswordPolicy:
    Type: String

  passwordPolicyMinLength:
    Type: Number

  passwordPolicyCharacters:
    Type: CommaDelimitedList

  requiredAttributes:
    Type: CommaDelimitedList

  userpoolClientGenerateSecret:
    Type: String

  userpoolClientRefreshTokenValidity:
    Type: Number

  userpoolClientWriteAttributes:
    Type: CommaDelimitedList

  userpoolClientReadAttributes:
    Type: CommaDelimitedList

  userpoolClientLambdaRole:
    Type: String

  userpoolClientSetAttributes:
    Type: String

  resourceName:
    Type: String

  authSelections:
    Type: String

  useDefault:
    Type: String

  usernameAttributes:
    Type: CommaDelimitedList

  triggers:
    Type: String

  userPoolGroupList:
    Type: CommaDelimitedList

  parentStack:
    Type: String

  permissions:
    Type: CommaDelimitedList

  dependsOn:
    Type: CommaDelimitedList

  userPoolGroups:
    Type: String

  adminQueries:
    Type: String

  hostedUI:
    Type: String

  verificationBucketName:
    Type: String

  hostedUIDomainName:
    Type: String

  authProvidersUserPool:
    Type: CommaDelimitedList

  hostedUIProviderMeta:
    Type: String

  oAuthMetadata:
    Type: String

  hostedUIProviderCreds:
    Type: String
    Default: "hostedUIProviderCreds"

Conditions:
  ShouldNotCreateEnvResources: !Equals [ !Ref env, NONE ]

Resources:

  CustomMessageConfirmationBucket:
    Type: AWS::S3::Bucket
    DeletionPolicy: "Retain"
    Properties:
      BucketName:  !If [ShouldNotCreateEnvResources, !Ref verificationBucketName, !Join ['',[!Ref verificationBucketName, '-', !Ref env]]]
      AccessControl: "Private"
      WebsiteConfiguration:
        IndexDocument: "index.html"
        ErrorDocument: "index.html"
      CorsConfiguration:
        CorsRules:
          -
            AllowedHeaders:
              - "Authorization"
              - "Content-Length"
            AllowedMethods:
              - "GET"
            AllowedOrigins:
              - "*"
            MaxAge: 3000

  # BEGIN SNS ROLE RESOURCE
  SNSRole:
  # Created to allow the UserPool SMS Config to publish via the Simple Notification Service during MFA Process
    Type: AWS::IAM::Role
    Properties:
      RoleName: !If [ShouldNotCreateEnvResources, 'journea6e2faad_sns-role', !Join ['',[ 'sns', 'undefined', !Select [3, !Split ['-', !Ref 'AWS::StackName']], '-', !Ref env]]]
      AssumeRolePolicyDocument:
        Version: "2012-10-17"
        Statement:
          - Sid: ""
            Effect: "Allow"
            Principal:
              Service: "cognito-idp.amazonaws.com"
            Action:
              - "sts:AssumeRole"
            Condition:
              StringEquals:
                sts:ExternalId: journea6e2faad_role_external_id
      Policies:
        -
          PolicyName: journea6e2faad-sns-policy
          PolicyDocument:
            Version: "2012-10-17"
            Statement:
              -
                Effect: "Allow"
                Action:
                  - "sns:Publish"
                Resource: "*"
  # BEGIN USER POOL RESOURCES
  UserPool:
  # Created upon user selection
  # Depends on SNS Role for Arn if MFA is enabled
    Type: AWS::Cognito::UserPool
    UpdateReplacePolicy: Retain
    Properties:
      UserPoolName: !If [ShouldNotCreateEnvResources, !Ref userPoolName, !Join ['',[!Ref userPoolName, '-', !Ref env]]]
      UsernameConfiguration:
        CaseSensitive: false
      Schema:

        -
          Name: email
          Required: true
          Mutable: true

        -
          Name: name
          Required: true
          Mutable: true

      LambdaConfig:

          CustomMessage: !Ref functionjournelyv2AuthCustomMessageArn

          PreSignUp: !Ref functionjournelyv2AuthPreSignupArn

      AutoVerifiedAttributes: !Ref autoVerifiedAttributes

      EmailVerificationMessage: !Ref emailVerificationMessage
      EmailVerificationSubject: !Ref emailVerificationSubject

      Policies:
        PasswordPolicy:
          MinimumLength: !Ref passwordPolicyMinLength
          RequireLowercase: false
          RequireNumbers: false
          RequireSymbols: false
          RequireUppercase: false

      UsernameAttributes: !Ref usernameAttributes

      MfaConfiguration: !Ref mfaConfiguration
      SmsVerificationMessage: !Ref smsVerificationMessage
      SmsConfiguration:
        SnsCallerArn: !GetAtt SNSRole.Arn
        ExternalId: journea6e2faad_role_external_id

  UserPoolCustomMessageLambdaInvokePermission:
    Type: "AWS::Lambda::Permission"
    DependsOn: UserPool
    Properties:
      Action: "lambda:invokeFunction"
      Principal: "cognito-idp.amazonaws.com"
      FunctionName: !Ref functionjournelyv2AuthCustomMessageName
      SourceArn: !GetAtt UserPool.Arn

  UserPoolPreSignupLambdaInvokePermission:
    Type: "AWS::Lambda::Permission"
    DependsOn: UserPool
    Properties:
      Action: "lambda:invokeFunction"
      Principal: "cognito-idp.amazonaws.com"
      FunctionName: !Ref functionjournelyv2AuthPreSignupName
      SourceArn: !GetAtt UserPool.Arn

  # Updating lambda role with permissions to Cognito

  UserPoolClientWeb:
  # Created provide application access to user pool
  # Depends on UserPool for ID reference
    Type: "AWS::Cognito::UserPoolClient"
    Properties:
      ClientName: journea6e2faad_app_clientWeb

      RefreshTokenValidity: !Ref userpoolClientRefreshTokenValidity
      UserPoolId: !Ref UserPool
    DependsOn: UserPool
  UserPoolClient:
  # Created provide application access to user pool
  # Depends on UserPool for ID reference
    Type: "AWS::Cognito::UserPoolClient"
    Properties:
      ClientName: journea6e2faad_app_client

      GenerateSecret: !Ref userpoolClientGenerateSecret
      RefreshTokenValidity: !Ref userpoolClientRefreshTokenValidity
      UserPoolId: !Ref UserPool
    DependsOn: UserPool
  # BEGIN USER POOL LAMBDA RESOURCES
  UserPoolClientRole:
  # Created to execute Lambda which gets userpool app client config values
    Type: 'AWS::IAM::Role'
    Properties:
      RoleName: !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',['upClientLambdaRole', 'undefined', !Select [3, !Split ['-', !Ref 'AWS::StackName']], '-', !Ref env]]]
      AssumeRolePolicyDocument:
        Version: '2012-10-17'
        Statement:
          - Effect: Allow
            Principal:
              Service:
                - lambda.amazonaws.com
            Action:
              - 'sts:AssumeRole'
    DependsOn: UserPoolClient
  UserPoolClientLambda:
  # Lambda which gets userpool app client config values
  # Depends on UserPool for id
  # Depends on UserPoolClientRole for role ARN
    Type: 'AWS::Lambda::Function'
    Properties:
      Code:
        ZipFile: !Join
          - |+
          - - 'const response = require(''cfn-response'');'
            - 'const aws = require(''aws-sdk'');'
            - 'const identity = new aws.CognitoIdentityServiceProvider();'
            - 'exports.handler = (event, context, callback) => {'
            - ' if (event.RequestType == ''Delete'') { '
            - '   response.send(event, context, response.SUCCESS, {})'
            - ' }'
            - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {'
            - '   const params = {'
            - '     ClientId: event.ResourceProperties.clientId,'
            - '     UserPoolId: event.ResourceProperties.userpoolId'
            - '   };'
            - '   identity.describeUserPoolClient(params).promise()'
            - '     .then((res) => {'
            - '       response.send(event, context, response.SUCCESS, {''appSecret'': res.UserPoolClient.ClientSecret});'
            - '     })'
            - '     .catch((err) => {'
            - '       response.send(event, context, response.FAILED, {err});'
            - '     });'
            - ' }'
            - '};'
      Handler: index.handler
      Runtime: nodejs10.x
      Timeout: '300'
      Role: !GetAtt
        - UserPoolClientRole
        - Arn
    DependsOn: UserPoolClientRole
  UserPoolClientLambdaPolicy:
  # Sets userpool policy for the role that executes the Userpool Client Lambda
  # Depends on UserPool for Arn
  # Marked as depending on UserPoolClientRole for easier to understand CFN sequencing
    Type: 'AWS::IAM::Policy'
    Properties:
      PolicyName: journea6e2faad_userpoolclient_lambda_iam_policy
      Roles:
        - !Ref UserPoolClientRole
      PolicyDocument:
        Version: '2012-10-17'
        Statement:
          - Effect: Allow
            Action:
              - 'cognito-idp:DescribeUserPoolClient'
            Resource: !GetAtt UserPool.Arn
    DependsOn: UserPoolClientLambda
  UserPoolClientLogPolicy:
  # Sets log policy for the role that executes the Userpool Client Lambda
  # Depends on UserPool for Arn
  # Marked as depending on UserPoolClientLambdaPolicy for easier to understand CFN sequencing
    Type: 'AWS::IAM::Policy'
    Properties:
      PolicyName: journea6e2faad_userpoolclient_lambda_log_policy
      Roles:
        - !Ref UserPoolClientRole
      PolicyDocument:
        Version: 2012-10-17
        Statement:
          - Effect: Allow
            Action:
              - 'logs:CreateLogGroup'
              - 'logs:CreateLogStream'
              - 'logs:PutLogEvents'
            Resource: !Sub
              - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*
              - { region: !Ref "AWS::Region",  account: !Ref "AWS::AccountId", lambda: !Ref UserPoolClientLambda}
    DependsOn: UserPoolClientLambdaPolicy
  UserPoolClientInputs:
  # Values passed to Userpool client Lambda
  # Depends on UserPool for Id
  # Depends on UserPoolClient for Id
  # Marked as depending on UserPoolClientLambdaPolicy for easier to understand CFN sequencing
    Type: 'Custom::LambdaCallout'
    Properties:
      ServiceToken: !GetAtt UserPoolClientLambda.Arn
      clientId: !Ref UserPoolClient
      userpoolId: !Ref UserPool
    DependsOn: UserPoolClientLogPolicy

  HostedUICustomResource:
    Type: 'AWS::Lambda::Function'
    Properties:
      Code:
        ZipFile: !Join
          - |+
          - - 'const response = require(''cfn-response'');'
            - 'const aws = require(''aws-sdk'');'
            - 'const identity = new aws.CognitoIdentityServiceProvider();'
            - 'exports.handler = (event, context, callback) => {'
            - ' const userPoolId = event.ResourceProperties.userPoolId;'
            - ' const inputDomainName = event.ResourceProperties.hostedUIDomainName;'
            - ' let deleteUserPoolDomain = (domainName) => {'
            - '   let params = { Domain: domainName, UserPoolId: userPoolId };'
            - '   return identity.deleteUserPoolDomain(params).promise();'
            - ' };'
            - ' if (event.RequestType == ''Delete'') {'
            - '   deleteUserPoolDomain(inputDomainName)'
            - '   .then(() => {response.send(event, context, response.SUCCESS, {})})'
            - '   .catch((err) => { console.log(err); response.send(event, context, response.FAILED, {err}) });'
            - ' }'
            - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {'
            - '  let checkDomainAvailability = (domainName) => {'
            - '  let params = { Domain: domainName };'
            - '  return identity.describeUserPoolDomain(params).promise().then((res) => {'
            - '   if (res.DomainDescription && res.DomainDescription.UserPool) {'
            - '    return false;'
            - '   }'
            - '   return true;'
            - '   }).catch((err) => { return false; });'
            - ' };'
            - ' let createUserPoolDomain = (domainName) => {'
            - '  let params = { Domain: domainName, UserPoolId: userPoolId };'
            - '   return identity.createUserPoolDomain(params).promise();'
            - ' };'
            - ' identity.describeUserPool({UserPoolId: userPoolId }).promise().then((result) => {'
            - '  if (inputDomainName) {'
            - '   if (result.UserPool.Domain === inputDomainName) {'
            - '    return;'
            - '    } else {'
            - '       if (!result.UserPool.Domain) {'
            - '         return checkDomainAvailability(inputDomainName).then((isDomainAvailable) => {'
            - '           if (isDomainAvailable) {'
            - '             return createUserPoolDomain(inputDomainName);'
            - '           } else {'
            - '               throw new Error(''Domain not available'');'
            - '           }'
            - '         });'
            - '       } else {'
            - '           return checkDomainAvailability(inputDomainName).then((isDomainAvailable) => {'
            - '             if (isDomainAvailable) {'
            - '               return deleteUserPoolDomain(result.UserPool.Domain).then(() => createUserPoolDomain(inputDomainName));'
            - '             } else {'
            - '                 throw new Error(''Domain not available'');'
            - '             }'
            - '           });'
            - '       }'
            - '     }'
            - '   } else {'
            - '       if (result.UserPool.Domain) {'
            - '         return deleteUserPoolDomain(result.UserPool.Domain);'
            - '       }'
            - '   }'
            - ' }).then(() => {response.send(event, context, response.SUCCESS, {})}).catch((err) => {'
            - ' console.log(err);  response.send(event, context, response.FAILED, {err});'
            - ' });'
            - '}}'

      Handler: index.handler
      Runtime: nodejs10.x
      Timeout: '300'
      Role: !GetAtt
        - UserPoolClientRole
        - Arn
    DependsOn: UserPoolClientRole

  HostedUICustomResourcePolicy:
    Type: 'AWS::IAM::Policy'
    Properties:
      PolicyName: !Join ['-',[!Ref UserPool, 'hostedUI']]
      Roles:
        - !Ref UserPoolClientRole
      PolicyDocument:
        Version: '2012-10-17'
        Statement:
          - Effect: Allow
            Action:
              - 'cognito-idp:CreateUserPoolDomain'
              - 'cognito-idp:DescribeUserPool'
              - 'cognito-idp:DeleteUserPoolDomain'
            Resource: !GetAtt UserPool.Arn
          - Effect: Allow
            Action:
              - 'cognito-idp:DescribeUserPoolDomain'
            Resource: '*'
    DependsOn: HostedUICustomResource
  HostedUICustomResourceLogPolicy:
    Type: 'AWS::IAM::Policy'
    Properties:
      PolicyName: !Join ['-',[!Ref UserPool, 'hostedUILogPolicy']]
      Roles:
        - !Ref UserPoolClientRole
      PolicyDocument:
        Version: 2012-10-17
        Statement:
          - Effect: Allow
            Action:
              - 'logs:CreateLogGroup'
              - 'logs:CreateLogStream'
              - 'logs:PutLogEvents'
            Resource: !Sub
              - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*
              - { region: !Ref "AWS::Region",  account: !Ref "AWS::AccountId", lambda: !Ref HostedUICustomResource}
    DependsOn: HostedUICustomResourcePolicy
  HostedUICustomResourceInputs:
    Type: 'Custom::LambdaCallout'
    Properties:
      ServiceToken: !GetAtt HostedUICustomResource.Arn
      userPoolId: !Ref UserPool
      hostedUIDomainName: !If [ShouldNotCreateEnvResources, !Ref hostedUIDomainName, !Join ['-',[!Ref hostedUIDomainName, !Ref env]]]
    DependsOn: HostedUICustomResourceLogPolicy

  HostedUIProvidersCustomResource:
    Type: 'AWS::Lambda::Function'
    Properties:
      Code:
        ZipFile: !Join
          - |+
          - - 'const response = require(''cfn-response'');'
            - 'const aws = require(''aws-sdk'');'
            - 'const identity = new aws.CognitoIdentityServiceProvider();'
            - 'exports.handler = (event, context, callback) => {'
            - 'try{'
            - ' const userPoolId = event.ResourceProperties.userPoolId;'
            - ' let hostedUIProviderMeta = JSON.parse(event.ResourceProperties.hostedUIProviderMeta);'
            - ' let hostedUIProviderCreds = JSON.parse(event.ResourceProperties.hostedUIProviderCreds);'
            - ' if(hostedUIProviderCreds.length === 0) {'
            - '  response.send(event, context, response.SUCCESS, {});'
            - ' }'
            - ' if (event.RequestType == ''Delete'') {'
            - '  response.send(event, context, response.SUCCESS, {});'
            - ' }'
            - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {'
            - '  let getRequestParams = (providerName) => {'
            - '   let providerMetaIndex = hostedUIProviderMeta.findIndex((provider) => provider.ProviderName === providerName);'
            - '   let providerMeta =  hostedUIProviderMeta[providerMetaIndex];'
            - '   let providerCredsIndex = hostedUIProviderCreds.findIndex((provider) => provider.ProviderName === providerName);'
            - '   let providerCreds = hostedUIProviderCreds[providerCredsIndex];'
            - '   let requestParams = {'
            - '    ProviderDetails: {'
            - '     ''client_id'': providerCreds.client_id,'
            - '     ''client_secret'': providerCreds.client_secret,'
            - '     ''authorize_scopes'': providerMeta.authorize_scopes'
            - '    },'
            - '    ProviderName: providerMeta.ProviderName,'
            - '    UserPoolId: userPoolId,'
            - '    AttributeMapping: providerMeta.AttributeMapping'
            - '   };'
            - '   return requestParams;'
            - '  };'
            - '  let createIdentityProvider = (providerName) => {'
            - '   let requestParams = getRequestParams(providerName);'
            - '   requestParams.ProviderType = requestParams.ProviderName;'
            - '   return identity.createIdentityProvider(requestParams).promise();'
            - '  };'
            - '  let updateIdentityProvider = (providerName) => {'
            - '   let requestParams = getRequestParams(providerName);'
            - '   return identity.updateIdentityProvider(requestParams).promise();'
            - '  };'
            - '  let deleteIdentityProvider = (providerName) => {'
            - '   let params = {ProviderName: providerName, UserPoolId: userPoolId};'
            - '   return identity.deleteIdentityProvider(params).promise();'
            - '  };'
            - '  let providerPromises = [];'
            - '  identity.listIdentityProviders({UserPoolId: userPoolId, MaxResults: 60}).promise()'
            - '  .then((result) => {'
            - '   let providerList = result.Providers.map(provider => provider.ProviderName);'
            - '   let providerListInParameters = hostedUIProviderMeta.map(provider => provider.ProviderName);'
            - '   hostedUIProviderMeta.forEach((providerMetadata) => {'
            - '    if(providerList.indexOf(providerMetadata.ProviderName) > -1) {'
            - '     providerPromises.push(updateIdentityProvider(providerMetadata.ProviderName));'
            - '    } else {'
            - '     providerPromises.push(createIdentityProvider(providerMetadata.ProviderName));'
            - '    }'
            - '  });'
            - '  providerList.forEach((provider) => {'
            - '   if(providerListInParameters.indexOf(provider) < 0) {'
            - '    providerPromises.push(deleteIdentityProvider(provider));'
            - '   }'
            - '  });'
            - '  return Promise.all(providerPromises);'
            - ' }).then(() => {response.send(event, context, response.SUCCESS, {})}).catch((err) => {'
            - '   console.log(err.stack); response.send(event, context, response.FAILED, {err})'
            - ' });'
            - ' } '
            - ' } catch(err) { console.log(err.stack); response.send(event, context, response.FAILED, {err});};'
            - '} '

      Handler: index.handler
      Runtime: nodejs10.x
      Timeout: '300'
      Role: !GetAtt
        - UserPoolClientRole
        - Arn
    DependsOn: UserPoolClientRole

  HostedUIProvidersCustomResourcePolicy:
    Type: 'AWS::IAM::Policy'
    Properties:
      PolicyName: !Join ['-',[!Ref UserPool, 'hostedUIProvider']]
      Roles:
        - !Ref UserPoolClientRole
      PolicyDocument:
        Version: '2012-10-17'
        Statement:
          - Effect: Allow
            Action:
              - 'cognito-idp:CreateIdentityProvider'
              - 'cognito-idp:UpdateIdentityProvider'
              - 'cognito-idp:ListIdentityProviders'
              - 'cognito-idp:DeleteIdentityProvider'
            Resource: !GetAtt UserPool.Arn
    DependsOn: HostedUIProvidersCustomResource

  HostedUIProvidersCustomResourceLogPolicy:
    Type: 'AWS::IAM::Policy'
    Properties:
      PolicyName: !Join ['-',[!Ref UserPool, 'hostedUIProviderLogPolicy']]
      Roles:
        - !Ref UserPoolClientRole
      PolicyDocument:
        Version: 2012-10-17
        Statement:
          - Effect: Allow
            Action:
              - 'logs:CreateLogGroup'
              - 'logs:CreateLogStream'
              - 'logs:PutLogEvents'
            Resource: !Sub
              - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*
              - { region: !Ref "AWS::Region",  account: !Ref "AWS::AccountId", lambda: !Ref HostedUIProvidersCustomResource}
    DependsOn: HostedUIProvidersCustomResourcePolicy

  HostedUIProvidersCustomResourceInputs:
    Type: 'Custom::LambdaCallout'
    Properties:
      ServiceToken: !GetAtt HostedUIProvidersCustomResource.Arn
      userPoolId: !Ref UserPool
      hostedUIProviderMeta: !Ref hostedUIProviderMeta
      hostedUIProviderCreds: !Ref hostedUIProviderCreds
    DependsOn: HostedUIProvidersCustomResourceLogPolicy

  OAuthCustomResource:
    Type: 'AWS::Lambda::Function'
    Properties:
      Code:
        ZipFile: !Join
          - |+
          - - 'const response = require(''cfn-response'');'
            - 'const aws = require(''aws-sdk'');'
            - 'const identity = new aws.CognitoIdentityServiceProvider();'
            - 'exports.handler = (event, context, callback) => {'
            - 'try{'
            - ' const userPoolId = event.ResourceProperties.userPoolId;'
            - ' let webClientId = event.ResourceProperties.webClientId;'
            - ' let nativeClientId = event.ResourceProperties.nativeClientId;'
            - ' let hostedUIProviderMeta = JSON.parse(event.ResourceProperties.hostedUIProviderMeta);'
            - ' let oAuthMetadata = JSON.parse(event.ResourceProperties.oAuthMetadata);'
            - ' let providerList = hostedUIProviderMeta.map(provider => provider.ProviderName);'
            - ' providerList.push(''COGNITO'');'
            - ' if (event.RequestType == ''Delete'') {'
            - '  response.send(event, context, response.SUCCESS, {});'
            - ' }'
            - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {'
            - '  let params = {'
            - '   UserPoolId: userPoolId,'
            - '   AllowedOAuthFlows: oAuthMetadata.AllowedOAuthFlows,'
            - '   AllowedOAuthFlowsUserPoolClient: true,'
            - '   AllowedOAuthScopes: oAuthMetadata.AllowedOAuthScopes,'
            - '   CallbackURLs: oAuthMetadata.CallbackURLs,'
            - '   LogoutURLs: oAuthMetadata.LogoutURLs,'
            - '   SupportedIdentityProviders: providerList'
            - '  };'
            - '  let updateUserPoolClientPromises = [];'
            - '  params.ClientId = webClientId;'
            - '  updateUserPoolClientPromises.push(identity.updateUserPoolClient(params).promise());'
            - '  params.ClientId = nativeClientId;'
            - '  updateUserPoolClientPromises.push(identity.updateUserPoolClient(params).promise());'
            - '  Promise.all(updateUserPoolClientPromises)'
            - '  .then(() => {response.send(event, context, response.SUCCESS, {})}).catch((err) => {'
            - '    console.log(err.stack); response.send(event, context, response.FAILED, {err});'
            - '  });'
            - ' }'
            - '} catch(err) { console.log(err.stack); response.send(event, context, response.FAILED, {err});};'
            - '}'

      Handler: index.handler
      Runtime: nodejs10.x
      Timeout: '300'
      Role: !GetAtt
        - UserPoolClientRole
        - Arn
    DependsOn: HostedUIProvidersCustomResourceInputs

  OAuthCustomResourcePolicy:
    Type: 'AWS::IAM::Policy'
    Properties:
      PolicyName: !Join ['-',[!Ref UserPool, 'OAuth']]
      Roles:
        - !Ref UserPoolClientRole
      PolicyDocument:
        Version: '2012-10-17'
        Statement:
          - Effect: Allow
            Action:
              - 'cognito-idp:UpdateUserPoolClient'
            Resource: !GetAtt UserPool.Arn
    DependsOn: OAuthCustomResource

  OAuthCustomResourceLogPolicy:
    Type: 'AWS::IAM::Policy'
    Properties:
      PolicyName: !Join ['-',[!Ref UserPool, 'OAuthLogPolicy']]
      Roles:
        - !Ref UserPoolClientRole
      PolicyDocument:
        Version: 2012-10-17
        Statement:
          - Effect: Allow
            Action:
              - 'logs:CreateLogGroup'
              - 'logs:CreateLogStream'
              - 'logs:PutLogEvents'
            Resource: !Sub
              - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*
              - { region: !Ref "AWS::Region",  account: !Ref "AWS::AccountId", lambda: !Ref OAuthCustomResource}
    DependsOn: OAuthCustomResourcePolicy

  OAuthCustomResourceInputs:
    Type: 'Custom::LambdaCallout'
    Properties:
      ServiceToken: !GetAtt OAuthCustomResource.Arn
      userPoolId: !Ref UserPool
      hostedUIProviderMeta: !Ref hostedUIProviderMeta
      oAuthMetadata: !Ref oAuthMetadata
      webClientId: !Ref 'UserPoolClientWeb'
      nativeClientId: !Ref 'UserPoolClient'
    DependsOn: OAuthCustomResourceLogPolicy

  # BEGIN IDENTITY POOL RESOURCES

  IdentityPool:
  # Always created
    Type: AWS::Cognito::IdentityPool
    Properties:
      IdentityPoolName: !If [ShouldNotCreateEnvResources, 'journelyv2Auth_identitypool_967bea7b', !Join ['',['journelyv2Auth_identitypool_967bea7b', '__', !Ref env]]]

      CognitoIdentityProviders:
        - ClientId:  !Ref UserPoolClient
          ProviderName: !Sub
            - cognito-idp.${region}.amazonaws.com/${client}
            - { region: !Ref "AWS::Region",  client: !Ref UserPool}
        - ClientId:  !Ref UserPoolClientWeb
          ProviderName: !Sub
            - cognito-idp.${region}.amazonaws.com/${client}
            - { region: !Ref "AWS::Region",  client: !Ref UserPool}

      AllowUnauthenticatedIdentities: !Ref allowUnauthenticatedIdentities

    DependsOn: UserPoolClientInputs

  IdentityPoolRoleMap:
  # Created to map Auth and Unauth roles to the identity pool
  # Depends on Identity Pool for ID ref
    Type: AWS::Cognito::IdentityPoolRoleAttachment
    Properties:
      IdentityPoolId: !Ref IdentityPool
      Roles:
          unauthenticated: !Ref unauthRoleArn
          authenticated: !Ref authRoleArn
    DependsOn: IdentityPool

Outputs :

  IdentityPoolId:
    Value: !Ref 'IdentityPool'
    Description:  Id for the identity pool
  IdentityPoolName:
    Value: !GetAtt IdentityPool.Name

  HostedUIDomain:
    Value: !If [ShouldNotCreateEnvResources, !Ref hostedUIDomainName, !Join ['-',[!Ref hostedUIDomainName, !Ref env]]]

  OAuthMetadata:
    Value: !Ref oAuthMetadata

  UserPoolId:
    Value: !Ref 'UserPool'
    Description:  Id for the user pool
  UserPoolName:
    Value: !Ref userPoolName
  AppClientIDWeb:
    Value: !Ref 'UserPoolClientWeb'
    Description: The user pool app client id for web
  AppClientID:
    Value: !Ref 'UserPoolClient'
    Description: The user pool app client id
  AppClientSecret:
    Value: !GetAtt UserPoolClientInputs.appSecret

@ammarkarachi ...My push happiness was short lived. I am not unable to push with the following message

Failed to delete resource. See the details in CloudWatch Log Stream: 2020/12/15/[$LATEST]fe9f95bab9b84cff81db847ddce2fa72

and this in the cloudwatch logs

2020-12-15T22:03:36.452Z	23d5e182-7094-4de1-b0a9-45ab65c7fb91	INFO	SyntaxError: Unexpected token h in JSON at position 0    at JSON.parse ()    at Runtime.exports.handler (/var/task/index.js:1:360)    at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)

@ammarkarachi ... 4.40.0 looks like it fixed the issue for me.

Let me know if anyone else is still facing any issues with latest version. If this is still ongoing we would like to have this squared out

Let me know if anyone else is still facing any issues with latest version. If this is still ongoing we would like to have this squared out

4.41.2 - my hosteduiprovidercred="[]" but every couple of pushes deployment-secrets.json loses the current environment and I get the "must have values" error...adding the hosteduiprovidercred="[]"  back into the team-provider-info.json and pushing re-runs the upgrade and puts the correct environment settings back in deployment-secrets.json (along with other pre-existing environments)...but after a few pushes it disappears again....

4.41.2 - my hosteduiprovidercred="[]" but every couple of pushes deployment-secrets.json loses the current environment and I get the "must have values" error...adding the hosteduiprovidercred="[]"  back into the team-provider-info.json and pushing re-runs the upgrade and puts the correct environment settings back in deployment-secrets.json (along with other pre-existing environments)...but after a few pushes it disappears again....

@GeorgeBellTMH There's a minor fix in #6485 to add additional guard rails which should potentially solve your problem. We'll make it  part of our upcoming releases.

@GeorgeBellTMH There's a minor fix in #6485 to add additional guard rails which should potentially solve your problem. We'll make it  part of our upcoming releases.

I was experiencing UPDATE_FAILED issues relate to HostedUIProvidersCustomResourceInputs when running amplify push. They started happening after I acceded to the Amplify has been upgraded to handle secrets more securely by migrating some values in team-provider-info.json to deployment-secrets.json prompt. Looking through the CloudWatch logs, the error message recorded was SyntaxError: Unexpected end of JSON input... which was pretty vague as it did not contain any other context information. After reading through other's comments I checked ~/.aws/amplify/deployment-secrets.json, and noticed that there were multiple "hostedUIProviderCreds": "[]" entries, but there was one as follow "hostedUIProviderCreds": [], where the hostedUIProviderCreds value was an actual empty array instead of a string of an empty array. After I updated it to match the others with "[]" amplify push completed successfully. I still have not investigate how or why that empty array without the quotes got there. Just posting this here in case others run into the same issue.

I was experiencing UPDATE_FAILED issues relate to HostedUIProvidersCustomResourceInputs when running amplify push. They started happening after I acceded to the Amplify has been upgraded to handle secrets more securely by migrating some values in team-provider-info.json to deployment-secrets.json prompt. Looking through the CloudWatch logs, the error message recorded was SyntaxError: Unexpected end of JSON input... which was pretty vague as it did not contain any other context information. After reading through other's comments I checked ~/.aws/amplify/deployment-secrets.json, and noticed that there were multiple "hostedUIProviderCreds": "[]" entries, but there was one as follow "hostedUIProviderCreds": [], where the hostedUIProviderCreds value was an actual empty array instead of a string of an empty array. After I updated it to match the others with "[]" amplify push completed successfully. I still have not investigate how or why that empty array without the quotes got there. Just posting this here in case others run into the same issue.

Huge pain on this one, fix for me on this was on the current version of amplify amplify --version 4.45.2
Create manually by-hand a file called deployment-secrets.json inside the root of your amplify directory. The automated migration script did not work for me no matter what I did.
Add a file similar to this:
{
    "appSecrets": [
      {
        "rootStackId": "dev",
        "environments": {
          "dev": {
            "auth": {
              "[stackid]": {
                "hostedUIProviderCreds": "[<the_string_with_facebook_and_google_secrets>]"
              }
            }
          }
        }
      }
    ]
  }

For me the migration and nothing from the cli was working to generate this file. After digging for a couple hours I got the format, name/numbers right etc.


POC: Make BSP modular and support dynamic extensions

Introduce a BspExtension trait, which holds a class name and it's potential ivy dependencies.
Split up the various BSP server extensions and instantiate them independently. They are now concrete classes with either a default contructor or one accepting the new MillBuildServerBase parameter.
The BspModule now has a new bspExtensions method, which declares what BSP extension should be used to support the module. The extension is loaded via reflection. JavaModule and ScalaModule now explicitly declare their extensions. That means, if no ScalaModule is part of the project, we also should not load the extension.

Fix https://github.com/com-lihaoyi/mill/issues/2598

Related discussion: https://github.com/build-server-protocol/build-server-protocol/discussions/651


Bugs

Is there a way to also include bugs when they are being track along with tasks?

if you select "Bugs are managed with tasks." then the bugs will be shown along with tasks on the drop plan.


[Bug]: The connection to Google Play services was lost due to service disconnection

Please check the following before submitting a new issue.

[X] I have searched the existing issues.
[X] I have carefully read the documentation and verified I have added the required platform specific configuration.

Please select affected platform(s)

[X] Android
[ ] iOS
[ ] Linux
[ ] macOS
[ ] Web
[ ] Windows

Steps to reproduce
When I call function Geolocator.isLocationServiceEnabled() and check log. Sometimes this error occur.
Expected results
Why does this error occur? And I want to support to fix this error?
Thanks
Actual results
Error occur in log
Code sample
Code sample
static Future<Position?> getMyLocation({required DataStoreApp dataStore}) async {
    bool serviceEnabled;
    LocationPermission permission;

    // Test if location services are enabled
    serviceEnabled = await Geolocator.isLocationServiceEnabled();
    if (!serviceEnabled) {
      'Location services are disabled.'.log();
      return null;
    }

    // Check if the app has permission to access location
    permission = await Geolocator.checkPermission();
    if (permission == LocationPermission.denied) {
      'Location permissions are denied'.log();
      return null;
    }

    if (permission == LocationPermission.deniedForever) {
      'Location permissions are permanently denied, we cannot request permissions.'.log();
      return null;
    }

    return await Geolocator.getCurrentPosition().then((Position? position) {
     'getCurrentPosition: success'.log();
      return position;
    }).onError((error, stackTrace) {
      if(error is TimeoutException) {
        return null;
      }
    });
  }

Screenshots or video

Screenshots or video demonstration

Version
10.1.0
Flutter Doctor output
Doctor output
!] Flutter (Channel stable, 3.13.9, on macOS 14.0 23A344 darwin-x64, locale en-VN)
    • Flutter version 3.13.9 on channel stable at /Users/anhvo/Documents/flutter_course/flutter_3.13.9-stable
    ! The flutter binary is not on your path. Consider adding /Users/anhvo/Documents/flutter_course/flutter_3.13.9-stable/bin to your path.
    ! The dart binary is not on your path. Consider adding /Users/anhvo/Documents/flutter_course/flutter_3.13.9-stable/bin to your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d211f42860 (8 months ago), 2023-10-25 13:42:25 -0700
    • Engine revision 0545f8705d
    • Dart version 3.1.5
    • DevTools version 2.25.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/anhvo/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/anhvo/Library/Android/sdk
    • Java binary at: /Applications/Android Studio 2.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio 2.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] IntelliJ IDEA Community Edition (version 2024.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.84.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.76.0

[✓] Connected device (4 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554                            • android-x64    • Android 12 (API 31) (emulator)
    • Ip 88 (mobile)               • 43784a242ea62d031ab4736267b32fdbaab1cdbe • ios            • iOS 16.6.1 20G81
    • macOS (desktop)              • macos                                    • darwin-x64     • macOS 14.0 23A344 darwin-x64
    • Chrome (web)                 • chrome                                   • web-javascript • Google Chrome 125.0.6422.142

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Any update for this ? I have same crash in crashlytics

Any update on this?


Substitutions stop work for names when online translator returned only name

Found situation when substitutions stop working when some line added in generated or custom txt.
After some time found this line.
Here this line when names of all chars which was added in substitutions stoped translating:
{{A}}ー、入るわよー={{A}}
The line was added from online G translator.
Checked all names and found source:
ソフィー、入るわよ
Gtranslator will return only Sophie .
If in substitutions txt was added several names then they all will stop translating if alone (single word).
ターニャ=Tanya
ルイス=Lewis
ソフィ=Sophie

After {{A}}ー、入るわよー={{A}} will be added in generated or custom txt all names above when alone will stop translating, ターニャ will stop be translated to Tanya, ルイス will stop translate to Lewis and all other names which will be there.
Checked several times after found the line all single names in popup or in dialog stoped translating and all is become normal if remove the line or replace it by correct where in translation not only {{A}} .

Could you please provide a concrete example with expected behaviour / actual behaviour. I am having trouble following exactly what is going wrong.
Alternatively you can tell me which game it is happening in and provide a save file.

Checked in two games and in both apppeared same bug.
For reproduce just use any game where inTranslation\en\Text\_Substitutions.txt added names of main characters. Then create in same folder forlder for example bug.txt file and add there {{A}}ー、入るわよー={{A}} line or instead add it in _AutoGeneratedTranslations.txt.
After it in game check dialogs of characters which names is in _Substitutions.txt.
Substitution is working for lines like {{A}}、諦めるのはまだ早いわよ={{A}}, it's still too early to give up but they not working when in source string only name like ターニャ=Tanya and dialogs often displaying like this:
ターニャ - first name alone
ルイス、諦めるのはまだ早いわよ - and after dialog
Dialog will be translated correct but name will not be translated and be in japanese.
It can be fixed if remove bugged line {{A}}ー、入るわよー={{A}} or add any text to substitution mark {{A}} or remove substitutions from txt. Bug happens when {{A}} alone in translation but in source {{A}}ー、入るわよー  not alone. Bug will no apperar with {{A}}ー、入るわよー={{A}}, I'll enter or with {{A}}={{A}} .

Thanks. Hopefully I will have a chance to take a look at this sometime next week.

By the way, found another situation when text can be translated because using variable. Noticed it in game and found this line in generated txt:
“<param%3DrewardItemName>”を手に入れた=I got “<param%3DrewardItemName>"
On place of <param%3DrewardItemName> displaying item name and when displaying it replacing and apparently it replacing after XUA parsing it.

Can I assume this second issue is the same as the one described here #56 ?

<param%3DrewardItemName> is ingame string variable on which place is displaing random quest reward item name.  And it is displaying in japanese when other part translated and in result it displaing like I got "メガソード" and it means it is replacing after XUA parsed it.
Maibe it looks simular like 56 if <param%3DrewardItemName> is substitution and “<param%3DrewardItemName>”を手に入れた is templated text and I got “<param%3DrewardItemName>" is untemplated text in output.

On issue 1: Please confirm if this fixes the issue.
XUnity.AutoTranslator-ReiPatcher-4.7.1.zip
On issue 2: After reading the issue more carefully it is definitely not the same issue as #56
Rather it looks like it is some special text handling of the Utage VN engine, especially as the original text name doesn't even appear.

There is working BepinEx 5 version but I temporary will move Bepinex files then and will test with ReiPatcher version.

Checked in couple games and it seems names now is translating even when bugged line in txt.

The latest version (4.8.0) should have the fix applied. Please feel free to open a new issue in relation to the "parameter"-issue where you can provide some more details on the issue and how/where/what game to reproduce it in.


If Show Icon set to Status Bar, Closing eqmac should just close the window, not the whole app.

as title says, just a behaviour issue.

Just click the minimise button next to the close button and it will minimise

Yes, i'm aware of this behavior, but UX wise, minimizing feels like the app stays on the dock when we don't want to.

How would you go about quitting eqMac process if we use the "X" in the top left to minimise instead of quitting?

I agree with @glekner.
Thanks in advance for your great work!

Moving discussion here: #230


translation for faq-structure completed

LGTM
Thanks.
I'm looking forward for other pages for translation if you wish.

LGTM

Thanks.
I'm looking forward for other pages for translation if you wish.

@jestemAria Feel free to open more PRs


Gulp

I'm not sure if we need jekyll, or whatever.  Since we're using travis to build stuff for github pages, it seems to be less useful.
This changes stuff to a pretty minimal/sketchy gulp setup - so it's just slightly more than static html.
I've also plonked in the event text with the same font thing.  And there's an svg now.

:+1: to Gulp over Grunt, and :+1: to simplification.
:-1: to the font, that's horrendous!
I intentionally used Bootstrap to lower the barrier to entry for contributors. We do want/need more content. Is it a good idea to make it more onerous to add more content/structure?
:+1: for the favicon, much cleaner.

I intentionally used Bootstrap to lower the barrier to entry for contributors. We do want/need more content. Is it a good idea to make it more onerous to add more content/structure?

(Making wild assumptions that the intentions are "easy to contribute" vs "we're dragging all of bootstrap around for a small site")
Maybe there could be a middle ground here. If we're wanting to use Bootstrap while keeping the code clean would it be worth using the bower and uncss gulp tasks to bring in the less version of bootstrap and remove anything we aren't using in the build?

Hi @tomlane, that would work well – I'm not averse to a zero-library approach per-se, but we need to get the site up this asap (preferably this week), so I'm concerned that this is a regression from the previous grunt build (which was just nabbed from the JSOxford site) which lowers our chances of achieving this.

The font is the same one used in the logo! (also, it's awesome).
I've tweaked it a bit to be more like the logo one - uppercase and spaced out a bit so it matches the logo.

I don't think bootstrap lowers barrier to entry - though maybe means that there are fewer arguments about markup/approach.  What content are we thinking of putting on here?  I think it should be crazy minimal and link off to other sites - we don't want to be worrying about keeping content shared over meetup/jsoxford/summerofhacks.

That looks really good. And yeah I think that was problem in the past keeping everything up to date? Could we reuse the meetup stuff in someway from jsoxford.com?

Re: the font. It does look good for the SoH logo, but there are some serious kerning issues when it's used elsewhere (see the spacing between the O and X of 'JSOxHack, the L and S of 'RailsBridge' and the A and C of 'SusHack'). We could make it less obvious by increasing the letter spacing, but it's not really suitable for other text.
I'm not bothered by Bootstrap, but I don't see a case for deliberately removing it as this PR does. It's fine if we're not adding much/any content to the site, but it means that anyone wanting to add in content in a responsive grid will need to reinvent the wheel (or include a grid library), and likewise for other components.
It's up for discussion, but I think this should be the central point for the summer of hacks. The content on Meetup.com is just to help people who've found it through that (and should be copied from and link to here). JSOxford.com pulls the events from Meetup anyway, so there's less to worry about there. This is where we're 'selling' SoH so minimal is good, but it needs to tell people:

what the event series is about
what the events are, when they're on and what they need to bring
what the code of conduct is

Effectively it's the same as a conference website and should 'work' standalone. If we've just put it up to have a fancy logo and link to somewhere else then I don't really see the benefit of building this at all considering there's so much else to do for SoH.
What does everyone else think?
@tomlane integrating it with Meetup and pre-rendering the avatars, etc. would be nice. As we're unlikely to update this site (or at least this year's event pages) once the events have happened I wouldn't recommend calling the API in-browser because in a few years time it almost certainly won't work, and it's nice to have a working site for posterity.

Re: the font. It does look good for the SoH logo, but there are some serious kerning issues when it's used elsewhere (see the spacing between the O and X of 'JSOxHack, the L and S of 'RailsBridge' and the A and C of 'SusHack'). We could make it less obvious by increasing the letter spacing, but it's not really suitable for other text.

I'd agree that it's not really suitable for main copy - though if we can use it for the main headers; I think it's cool that it's consistent with the logo/brand.

I'm not bothered by Bootstrap, but I don't see a case for deliberately removing it as this PR does. It's fine if we're not adding much/any content to the site, but it means that anyone wanting to add in content in a responsive grid will need to reinvent the wheel (or include a grid library), and likewise for other components.

This PR is to clean up/simplify stuff.  In the same way as jekyll & grunt are unnecessary - bootstrap doesn't really add anything to the site, in fact I'd say it over-complicates and bloats it. We could plonk it back in down the line if there would be use in it I guess.

It's up for discussion, but I think this should be the central point for the summer of hacks. The content on Meetup.com is just to help people who've found it through that (and should be copied from and link to here). JSOxford.com pulls the events from Meetup anyway, so there's less to worry about there. This is where we're 'selling' SoH so minimal is good, but it needs to tell people:
what the event series is about
what the events are, when they're on and what they need to bring
what the code of conduct is
Effectively it's the same as a conference website and should 'work' standalone. If we've just put it up to have a fancy logo and link to somewhere else then I don't really see the benefit of building this at all considering there's so much else to do for SoH.

Totally agree that it should say stuff about what the series is about, and having a common code of conduct is awesome.  But I don't think this needs to be the source of all information - I see it as less of a conference site and more of a "digital week/festival" site.
I think it would be cooler to have a short description about the event and a link to the the meetup page for detailed and practical information.  Duplicating all the info on sushack.co.uk for example - seems like it would take a lot of work and not be that useful for attendees.  Also - pushing people to meetup for the other events makes it easier to ask questions.

What does everyone else think?
@tomlane integrating it with Meetup and pre-rendering the avatars, etc. would be nice. As we're unlikely to update this site (or at least this year's event pages) once the events have happened I wouldn't recommend calling the API in-browser because in a few years time it almost certainly won't work, and it's nice to have a working site for posterity.

I don't think we should integrate with meetup - for the reasons I mentioned above, and also if we were to re-use expand down the line; it makes it a bit more open for other events.

In the interests of expediency, let's merge this. :+1:, assuming that font doesn't get used for body text (and if someone wanted to play around with spacing to see if it looks better a bit more spaced out that could be cool too).
:+1: to leaving meetup out for now. I think a gulp/grunt task which pulled the avatars/attendee list from Meetup.com would be great for posterity and to show momentum, but it's not critical to getting the site up. Also :+1: for the irony of pushing out all the JS as 'bloat' ;).
I quite liked the previous JSOxford setup where everything lived on the blog, though Meetup.com is very useful as a ticketing system. I'm pretty against using Meetup.com as our single point of truth for practical info for a variety of reasons, but primarily because GitHub (and markdown) is how we manage everything else, and it's a pain to trawl through previous events on Meetup looking for text to copy forward, but that's a discussion to be had somewhere else.
I also think the 'effort' required to duplicate the information across both sites is being a little bigged-up, but agree that duplication is generally a pain.

:+1:  :+1:  :+1:


[Business Approvals Kit - BUG] Custom Responses Not Working

Describe the issue
Creating an approval with custom responses is not working correctly.  When using custom responses the format that is noted does not create two separate buttons.  I tried several different formats but none worked correctly.
Node Instructions

Node

Teams Approval Only shows one button

Email Approval shows no buttons just a submit

Expected Behavior
Approval to show custom responses via Teams and Email.
What solution version are you using?
1.0.20240305.1 = March Release
What app or flow are you having the issue with?
Node - custom responses
Steps To Reproduce
See the screenshots above.
Anything else?
NA
AB#2676

This issue is due to setting the custom responses using a dynamic list if option in the cloud flow. Further investigation is needed with core engineering to resolve this issue

Verified this is now working and can be marked as Completed.


add missing equal sign to README.md

The documentation suggests "--www-prefix/my-mountpoint/" but it should be "--www-prefix=/my-mountpoint/"

please merge :).


Debug Profiler for Analysing Trace Execution

Description
Changes proposed in this pull request:

...
...
...

Related issue(s)

/test all

/test all

/test all

/test all

/test all

/test all


Splitting into shares needs to know request length

Currently shares for transactions, evidence, and intermediate state roots are arranged by first serializing an array of e.g. transactions, then splitting them into 255-byte shares (with the 256th byte reserved to indicate the starting location of the first start of a transaction in the share.
The issue here is that simply serializing an array of transactions doesn't return the length of each serialized transaction, so we can't properly compute the reserved byte value.
Splitting into shares should instead use the following procedure:

Serialize each transaction individually (which tells us the number of bytes for each transaction)
Create the byte array serialize(length of serialize(tx1)) || serialize(tx1) || serialize(length of serialize(tx2)) || serialize(tx2) || ...
Split the above byte array into 255-byte shares, and use the lengths from step (1) to compute reserved byte values

using protobuf this can be achieved without any manual implementation (at least in most languages):
https://developers.google.com/protocol-buffers/docs/techniques#streaming
Otherwise this is simple enough to implement in any language.

Two remarks here:
In 1. the individual serialzation of a TX does it include the lengths or not? Let's say Tx1 is 300 bytes of encoding, then 2. gives us:
serialize(length of serialize(tx1)) || serialize(tx1) || serialize(length of serialize(tx2)) || serialize(tx2)
So, If we split it up in 3. do the reserved byte value tell us where serialize(length of serialize(tx2)) starts, or, where serialize(tx2) starts?

The reserved byte should tell us where serialize(length of serialize(tx2)) starts, otherwise we wouldn't know how many bytes to use to decode a tx.

the computed lengths also include the length delimiter overhead

I don't think that's needed? The length is always a single integer, so a transaction can be parsed in two steps (first parse the length starting at the right offset, then parse the next length bytes as a tx).

OK, I think you are right.


Business Media Plugin Images Not Displaying on Snapshot.raintank.io

I'm having an issue with the Business Media plugin. It works perfectly on my localhost, but when I share my dashboard via snapshot.raintank.io, I encounter an image error stating, "Image renderer plugin not installed."
Is there a way to share my dashboard, including the Business Media plugin content, with users who don’t have Grafana installed, and without requiring them to install anything?
Thanks in advance!

@K-721 snapshot.raintank.io is managed by Grafana team and they control installed plugins. You can open support request to install it, but we have no insight how Grafana operates it.
Regarding sharing dashboard, Grafana introduced Public Dashboards, which has some limitations, but overall designed exactly for what you are looking for: https://grafana.com/docs/grafana/latest/dashboards/dashboard-public/

Hello Sir @mikhail-vl, thank you for the information! I was able to resolve the issue by exporting my dashboard as a JSON file and hosting it in Grafana Cloud instead. This approach allowed me to share the dashboard internally without making it public. The "image renderer plugin" issue was no longer a problem, and the Business Media plugin worked perfectly. Appreciate your reply and am grateful for the VolkovLabs plugins! Thanks!

@K-721 Great to hear! Let us know if there is anything else.


docs: update ApisixUpstream reference

Signed-off-by: Navendu Pottekkat<EMAIL_ADDRESS>Updates the ApisixUpstream reference page.

I don't I ever had all checks passing in the first try 😄


Can't get layer output for transformers

First of all thanks for your work, your library seems really useful and has reasonable API.
Problem
I want to extract features using transformer models. I tried this for bert and distilbert models and I get an error: AttributeError: Layer bert is not connected, no input to return.
I was wondering whether this was the case because model wasn't compiled: but after running lr_find it still throws this error.
Reproducible example:
categories = ['alt.atheism', 'soc.religion.christian',
             'comp.graphics', 'sci.med']
from sklearn.datasets import fetch_20newsgroups
train_b = fetch_20newsgroups(subset='train',
   categories=categories, shuffle=True, random_state=42)
test_b = fetch_20newsgroups(subset='test',
   categories=categories, shuffle=True, random_state=42)

print('size of training set: %s' % (len(train_b['data'])))
print('size of validation set: %s' % (len(test_b['data'])))
print('classes: %s' % (train_b.target_names))

x_train = train_b.data
y_train = train_b.target
x_test = test_b.data
y_test = test_b.target

import ktrain
from ktrain import text
MODEL_NAME = 'bert-base-uncased'
t = text.Transformer(MODEL_NAME, maxlen=200, classes=train_b.target_names)
trn = t.preprocess_train(x_train, y_train)
val = t.preprocess_test(x_test, y_test)
model = t.get_classifier()
learner = ktrain.get_learner(model, train_data=trn, val_data=val, batch_size=6)

learner.lr_find(show_plot=True, max_epochs=1)

learner.layer_output(2, example_id=5, use_val=True)

Thanks for your comments.
Yes, that doesn't seem to work. It might be because Hugging Face transformer models are built using TF2 subclassing API, which apparently doesn't support getting intermediate outputs.
If you're trying to extract features, you could try using the Transformer library directly and either modifying the configuration to return hidden states or using a different class that returns the raw hidden states by design.  Both are discussed in this thread.


Add Global Exp Modifier Option to Config

Add global experience modifier to scale exp gained according to modifier value.


UserWarning: This overload of nonzero is deprecated: 	nonzero()

I continually get this warning while training with the latest fastai2 library and pytorch 1.6.0 and torchvision 0.7.0 and git commit 2b19225. Happens with the first first notebook in the fastbook repository.

Here's the warning.
/home/fastai/fastai2/fastai2/callback/schedule.py:68: UserWarning: This overload of nonzero is deprecated:
	nonzero()
Consider using one of the following signatures instead:
	nonzero(*, bool as_tuple) (Triggered internally at  /opt/conda/conda-bld/pytorch_1595629427478/work/torch/csrc/utils/python_arg_parser.cpp:766.)
  idx = (pos >= pcts).nonzero().max()

Thanks!


bmake: 20240711 -> 20240722

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://repology.org/project/bmake/versions.
meta.description for bmake is: Portable version of NetBSD 'make'
meta.homepage for bmake is: https://www.crufty.net/help/sjg/bmake.html
Updates performed

Version update

To inspect upstream changes
Impact
Checks done

built on NixOS
The tests defined in passthru.tests, if any, passed
found 20240722 with grep in /nix/store/h8ywpfh6s8ap46r8cx83p6pvzsr60aa5-bmake-20240722
found 20240722 in filename of file in /nix/store/h8ywpfh6s8ap46r8cx83p6pvzsr60aa5-bmake-20240722

Rebuild report (if merged into master) (click to expand)

6 total rebuild path(s)

6 package rebuild(s)

First fifty rebuilds by attrpath

bmake
bozohttpd
bozohttpd-minimal
kgt
libfsm

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/h8ywpfh6s8ap46r8cx83p6pvzsr60aa5-bmake-20240722 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A bmake https://github.com/r-ryantm/nixpkgs/archive/ebcee2adb72313204ab55319774b801b5784daf4.tar.gz

Or:
nix build github:r-ryantm/nixpkgs/ebcee2adb72313204ab55319774b801b5784daf4#bmake

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/h8ywpfh6s8ap46r8cx83p6pvzsr60aa5-bmake-20240722
ls -la /nix/store/h8ywpfh6s8ap46r8cx83p6pvzsr60aa5-bmake-20240722/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review run on x86_64-linux 1

1 package failed to build:

bozohttpd

9 packages built:

bmake
bmake.man
bozohttpd-minimal
kgt
kgt.bin
kgt.doc
libfsm
libfsm.dev
libfsm.lib

Maintainer pings
cc @thoughtpolice @AndersonTorres for testing.

@NixOS/nixpkgs-merge-bot merge


LICENSE

Please add a license file. Otherwise it's unclear if I can use your library in my project. Thanks!

Thank you for reminding me
License was added to the project


Integration Tests: Create an initial checklist of permutations to test for

Come up with a check list:

postgres + primary key(int)
postgres + primary key(text)
...

Initial checklist + code. Posting as a gist since it doesn't fit in the comment:
https://gist.github.com/matthewmueller/d454c55b07022e0de640e3ac50948dca

This is implemented in https://github.com/prisma/gaps


Get-ServiceNowIncident with sys_created_on

Is there a way to request only incidents created on or after a certain date?
Was thinking that -MatchExact could be used with some sort of greater than or equal to thing.

#68 covers this topic.  The module doesn't support this feature today.
active=true^state!=6^sys_created_onBETWEENjavascript:gs.dateGenerate('2016-10-01','00:00:00')@javascript:gs.dateGenerate('2016-12-01','23:59:59')

That's an example format of what the query string needs to look like if you were to attempt to integrate it into what you need manually.  At least until we get time to plan out an integration that makes sense for the module.


Calling same relay connection with different aliases is not working

For example, if I have this edge on Post
        edge.To("comments", Comment.Type).
            Annotations(entgql.RelayConnection()),

When I call this query, the results for both publishedComments and draftComments will be same as publishedComments.
node(id: "xxx") {
  ... on Post {
    title
    body

    publishedComments: comments(where: { status: PUBLISHED }) {
      edges {
        node {
          id
          status
        }
      }
    }

    draftComments: comments(where: { status: DRAFT }) {
      edges {
        node {
          id
          status
        }
      }
    }
  }
}

I think this issue was mentioned briefly by @a8m here: https://github.com/ent/contrib/pull/344#pullrequestreview-1020415004
Your Environment 🌎

Tech
Version

Go
1.18

Ent
master

Database
Postgtres

Driver
pgx

Thanks for reporting this, @amrnt 🙏
We currently have a limitation in entql's fields-collection where it expects only one GraphQL field per edge. @giautm and I discussed this and we thought about adding some API to Ent (enabled by a FF) that can be integrated to entgql and solve this issue:
posts, err := client.Post.Query().
    WithNamedComments("published", func(q *ent.CommentQuery) {
        q.Where(comment.StatusEQ(comment.StatusPublished))
    })
    WithNamedComments("draft", func(q *ent.CommentQuery) {
        q.Where(comment.StatusEQ(comment.StatusDraft))
    }).
    Paginate(...)

// Then, get each named loaded edge as follows:
for _, p := range posts {
    published, err := p.Edges.NamedComments("published")
    // ...
    draft, err := p.Edges.NamedComments("draft")
    // ...
}

This API should be transparent to entgql users and a query like the one above should be loaded correctly in an efficient way.

Thanks @amrnt for the great bug report. The issue was addressed both in ent and ent/contrib.
Closed with https://github.com/ent/contrib/pull/355


[FEAT]: Add WalletConnect for better UX

Let's enhance user options by integrating WalletConnect, providing more than one way for users to connect their wallets. Presently, the DAPP exclusively supports Metamask.

@Mayank2808sharma Kindly assign me this issue under GSSOC24

@dakshsinghrathore
Go ahead I have assigned it to you.

@Mayank2808sharma Any readme to fire up the project locally ???

@dakshsinghrathore Someone is working on the readme.
to run it locally
you need do it
npm i
npm run dev


Active Directory / LDAP authentication: server discovery via DNS SRV records

Currently Rancher supports only specifying a single AD or LDAP server for authentication. Only hitting a single AD or LDAP server is problematic if that single server goes down, or if Rancher is failed over to a different site. Most sites have multiple domain controllers since authentication is such an important service.
These days the proper way to auth against AD is to discover available domain controllers via DNS SRV records. All you need to know is the domain name and have access to DNS and autodiscovery is pretty straightforward. This would apply to vanilla LDAP as well.
This would go a long way toward enterprise level acceptance and reliability for Rancher.
https://ldap.com/dns-srv-records-for-ldap/
https://docs.microsoft.com/en-us/troubleshoot/windows-server/identity/how-domain-controllers-are-located

Without SRV support, at least supporting configuring multiple servers would go a LONG way. :)

Still important

Still important


Upgraded deprecated CI

Summary
Addresses #951 by bumping github action versions.

@wshanks Since previous tests have passed and the rerun passed again, maybe it was poor timing after all?


Fix typos

Found few misspellings.
@sudheerj The command is typos -w
https://github.com/crate-ci/typos

@szepeviktor Thanks again for PR

Glad to contribute.


Fix CI by using a different webproperty

Builds are failing as the previous webproperty is no longer available.

PR #26


problem installing elm with npm

» sudo npm install -g elm                                        243 [16:45:16]
/usr/local/bin/elm -> /usr/local/lib/node_modules/elm/binwrappers/elm
/usr/local/bin/elm-package -> /usr/local/lib/node_modules/elm/binwrappers/elm-package
/usr/local/bin/elm-make -> /usr/local/lib/node_modules/elm/binwrappers/elm-make
/usr/local/bin/elm-reactor -> /usr/local/lib/node_modules/elm/binwrappers/elm-reactor
/usr/local/bin/elm-repl -> /usr/local/lib/node_modules/elm/binwrappers/elm-repl

><EMAIL_ADDRESS>install /usr/local/lib/node_modules/elm
> node install.js

sh: 1: node: not found
npm ERR! Linux 4.4.0-24-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "elm"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

npm ERR<EMAIL_ADDRESS>install: `node install.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the<EMAIL_ADDRESS>install script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the elm package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs elm
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls elm
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/flip111/npm-debug.log

that npm-debug.log is too big to put in a pastebin

Are you sure you have node installed correctly. I have node v4.4.5 and npm 2.15.5(installers from the official website). It might be some issue with Debian renaming the node command to nodejs. Check these out:

sudo apt-get remove nodejs nodejs-dev
sudo apt-get install nodejs-legacy
sudo npm install -g elm

installed elm and node v4.2.6 worked fine

I got  a problem when i want to install elm on my linux ubuntu 16.0, how do i do it if i may ask you guys.
Thank you in advance.


Features/compressit

This PR uses a potentially high-GPU solution to achieve extreme fees savings for people who commit PNGs. the backend can be optimized further by:

using more effective ML models
GPUs, lots of them
converting non-PNG images to PNGs4
I need to learn modesty and humility.

This PR has many issues:

Doesn't follow formatting style
Hard codes paths to /tmp
Inserts random formatting changes
Introduces dependency on python3
No tests

I'm going to go ahead and close it.

@redactedJare, I'm interested in exploring integrating this in arb if you'd like to open an issue.


[WIP] Add -x / --get-extended-information flag to retrieve custom fields

Closing due to inactivity. We can reopen this in the future if desired.


[stencil] choose between fastify and express

Description
Currently stencil ships with the base app running fastify, we plan to give the user option to choose between fastify or express.
Tasks

[ ] create sample projects for express
[ ] modify the schematics to hold the base app for both
[ ] modify the stencil-cli to give the option to bootstrap what's asked

Stencil is opinionated so, not adding support for this right now.


Analysis of project with v4.5.0 (Windows) is significantly slower than CppCheck GUI

I took the 4.5.0 release for Windows and integrated it with Qt Creator 4.5.0 (x86) and CppCheck v1.81 on Windows 10 (x64). The analysis is notably slower than with 4.3.0 and the same version of CppCheck, and with the CppCheck GUI. Both of those take around 10 minutes with my solution, but with v4.5.0 I gave up after 20 minutes at 10% done.

I have error:
C:\Qt\Qt5.7.0\Tools\QtCreator-4.5.0\lib\qtcreator\plugins\QtcCppcheck4.dll: Cannot load library C:\Qt\Qt5.7.0\Tools\QtCreator-4.5.0\lib\qtcreator\plugins\QtcCppcheck4.dll: Unknown error 0x000000c1.
What is wrong? I use Qt Creator 4.5.0 and I've downloaded QtcCppcheck-4.5.0-win1.zip.

@prepas Hi. Looks like there is something wrong with your Qt version. Qt Creator 4.5.0 is build with Qt 5.10, but it tries to load 5.7 version. Have you installed it via qt online installer? I test plugins only for that version.

No, I use Qt Creator 4.5.0 & Qt 5.7.0

If you use qt creator different to one from qt online installer, then you likely should rebuild plugin by yourself.


Run after transaction ShouldBeUniqueUntilProcessing job blocks jobs creation on DB transaction failed

Laravel Version: 9.46.0
PHP Version: 8.1.1
Database Driver & Version: MySQL 8.0.23

Description:
Run after transaction ShouldBeUniqueUntilProcessing job blocks jobs creation on DB transaction failed
Steps To Reproduce:

Start DB transaction.
Dispatch job with $afterCommit=true and implements ShouldBeUniqueUntilProcessing interface. Job will locked in cache.
Throw exception and rollback transaction.
Start DB transaction.
Dispatch previous job.
Commit transaction.
Job will not dispatched because it still locked in cache.

@KolyaSirik @driesvints I started working on something, but IDK if it's the best approach or if it should be something completely diff. I pushed a commit here. If someone could take a look and say if I'm moving in the right direction or not it would be great. Since this is my first time checking this side of the framework code I could be completely wrong, I'm just giving it a shot here. I would appreciate any feedback/help.

@WendellAdriel yes, I fixed this in 8 version by this way

@KolyaSirik in the commit I sent I'm having issues making a test suite to properly test this.
I think the solution is already working but I'm not sure the best way to handle this in a test suite.